[libxml-devel] Validating xml in a string
Chris McGrath
chris at octopod.info
Thu Apr 24 04:03:11 EDT 2008
I've been playing around with XML::Parser recently, and during my
irbing I discovered you need to do p.parse before the context is
created.
Chris
On 22 Apr 2008, at 11:06, dwTwiLighT a.k.a. dwCyMpaK wrote:
> Greetings.
> I want to check if xml received by my application (made with RoR and
> libxml-ruby) via POST request is well-formed.
> This is the source code of that part:
>
> p = XML::Parser.new
> p.string = params[:xml]
> if p.context.well_formed?
> doc = p.parse
>
> surely that is wrong, because I get the following message:
> "NoMethodError: undefined method `context' for #<XML::Parser:
> 0xb779c838>"
>
> I have no idea about what am I doing wrong and what should I do to
> make it work. Can you help me with this problem?
> _______________________________________________
> libxml-devel mailing list
> libxml-devel at rubyforge.org
> http://rubyforge.org/mailman/listinfo/libxml-devel
More information about the libxml-devel
mailing list