matth,
XML Schema does have advantages over DTDs, but DTD technology is probably more mature and understood at the moment. I think only the latest XML modules therefore understand XML Schema.
There are as you say quite a range of XML modules too use, for a quick comparison I would recomend mirod's Ways to Rome article as a good place to start.
I rather like the GNOME based XML::LibXML module, it's very fast, fairly feature complete, very feature rich, and under active development. Others no doubt will suggest other modules.
I'd suggest the following nodes to read, to see what people have said in the past:
To give you an idea of ease and speed, I've written simple code that can take one big XML file and parse it to produce over 2000 XHTML pages, and hundreds of folders, in under 1 minute with LibXML and LibXSLT.
Good luck!
update: For XML Schema support check out XML::Schema from Andy Wardley.
--
ajt
| [reply] |
Thanks Ajit. That advice is helpful.
Before I spend time on the XML::LibXML is there anybody else out there that would like to agree or disagree with Ajit's suggestion that XML::LibXML is the way to go?
| [reply] |
As far as I know, there's no Perl XML parser that handles XML Schema. A few weeks ago I did a project which involved schema, so I had to work in Java (Apache Xerces). According to the libxml2 webpage, it doesn't support schema either, although it is in the works.
XML Schema technology is well-supported and quite mature in the Java and C++ world, so it would be very nice if someone would do something about Perl's lack of XML Schema support (hint, hint, and yes, I know the standard reply to this, but I haven't got the time).
DTDs are no match for XML Schema, especially with respect to data type validation. Structure is okay with DTDs, although schema offer superior flexibility.
You might have a look at Apache's Xerces-Perl though. It was not an option for me unfortunately.
Just my 2 cents, -gjb-
| [reply] |
I'm not sure I understood your question... You talk about building XML documents and then about Schema, but Schema is intended to validate documents...
Anyway, if you need to validate some XML against a schema, there is XML::Schematron, which uses Sablotron or LibXSLT.
Ciao, Valerio
| [reply] |