"Geert Theys" <[EMAIL PROTECTED]> writes:

> can someone give me a working example in for perl xerces howto
> validate a XML against a DTD? With the limited documentation I'm
> stuck...

Hey Geert,

Welcome back to Xerces!

Check out the examples in the samples/ directory. Anyone of them will
work for you. For example:

perl samples/DOMCount -v foo.xml

will validate the file foo.xml using the DOM interface. It creates a
DOMParser instance, an InputSource instance, sets the validation
scheme, and then calls parse() on the input source.

The tests in the t/ directory give a lot of low-level examples as
opposed to the more complete ones in samples/.

Also, I do recommend using the Xerces-C documentation:

http://xml.apache.org/xerces-c/apiDocs/index.html

They are very complete, and the Xerces.pm API maps almost 1-to-1 with
the Xerces-C API. The only differences are specifically dealt with in
the README:

Even though Xerces.pm is based on the C++ API, it has been modified in
a few ways to make it more accessible to typical Perl usage, primarily
in the handling:
* strings (DOMString, XMLCh, and perl string)
* lists   (DOM_NodeList and perl list)
* hashes  (DOM_NamedNodeMap and perl hash)
* DOMParse.pm (for serializing a DOM tree)
* implementing Perl handlers for C++ event callbacks
* handling exceptions C++ ({XML,DOM,SAX}Exception's)

HTH,
jas.

PS. I'm also accepting volunteers to help improved the "limited"
documentation ...


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to