Thanks Mark, 

That will get me by just fine for now.

It would be nice if XML::Document.new took a string.  Then you could use files & strings with the same method.

doc = XML::Document.new("<foo><bar>doug</bar></foo>")

or

doc = XML::Document.new(File.open("my_file.xml"))

Doug



On 5/25/06, Mark Van Holstyn < [EMAIL PROTECTED]> wrote:
parser=XML::Parser.new
parser.string= '<root><another_node>hey</another_node></root>'
doc = parser.parse

Anyone else have an easier way?

Mark

On 5/25/06, Doug Bryant <[EMAIL PROTECTED]> wrote:
I'm in the process of moving to libxml-ruby from rexml.  The speed was killing me.

Is there a way to create an XML::Document from a string rather than a file? I store all the documents in the database, so there is no file to parse from.

I have looked through the api docs, but don't see how to accomplish this.

Thanks, Doug

_______________________________________________
libxml-devel mailing list
libxml-devel@rubyforge.org
http://rubyforge.org/mailman/listinfo/libxml-devel




--
Mark Van Holstyn
[EMAIL PROTECTED]
http://lotswholetime.com

_______________________________________________
libxml-devel mailing list
libxml-devel@rubyforge.org
http://rubyforge.org/mailman/listinfo/libxml-devel


_______________________________________________
libxml-devel mailing list
libxml-devel@rubyforge.org
http://rubyforge.org/mailman/listinfo/libxml-devel

Reply via email to