XML Validation

Discussion in 'Ruby' started by Michel Casabianca, Jan 17, 2008.

  1. Hello,

    I need to validate XML documents in Ruby. I was told that REXML can't
    perform validation, thus I tried using libxml.

    SaxParser can't validate against a given DTD, so I tried DOM Parser.
    But I can't find a way to get DOCTYPE from Document resulting from
    parsing. I could find DTD file with a regexp against document source,
    but it seems quite unefficient to me.

    Is there a way to properly validate against a DTD using libxml-ruby or
    is there a gem providing such a feature ?

    NOTE: please don't try to convince me that I don"t need validation!
    --
    Michel Casabianca
     
    Michel Casabianca, Jan 17, 2008
    #1
    1. Advertising

  2. Michel Casabianca wrote:
    > NOTE: please don't try to convince me that I don"t need validation!


    I wouldn't think of it. XML, now, that's something you don't need. ;-)

    --
    vjoel : Joel VanderWerf : path berkeley edu : 510 665 3407
     
    Joel VanderWerf, Jan 17, 2008
    #2
    1. Advertising

  3. Le 17 janv. 08 =E0 23:24, Joel VanderWerf a =E9crit :

    > Michel Casabianca wrote:
    >> NOTE: please don't try to convince me that I don"t need validation!

    >
    > I wouldn't think of it. XML, now, that's something you don't need. ;-)


    Well done ;o)

    Now, do you know a replacement for structured document format? YAML is =20=

    great, but I can't figure how to use it for that purpose... RDoc is =20
    great for README files, but it ends with hugly HTML tags for more =20
    complex documents. SGML is great also, but writing a DTD is far too =20
    complex. LaTeX is great too, but I can't parse it. That's why I'm =20
    stuck with XML and need validation.

    --
    Michel Casabianca
     
    Michel Casabianca, Jan 17, 2008
    #3
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.

Share This Page