dara wrote:
> Hi All,
>
> I am just wondering if any of you have any neat ideas about validating
> a newly constructed DOM before writing it to a file.
>
> Basically I wish to :
>
>     -create the DOM tree complete with data in the elements
>     -validate this using an XSD specific to the document
>     -write the XML to a file/buffer
>
> The first and last items I have working fine, but the validation of
> the document before writing is proving sligthly elusive for the
> moment.
>
> There is validation of the data before it is entered into the DOM, but
> I would like to validate it against the XSD as an added measure, and
> without having the expense of re-parsing the serialised DOM if
> possible.
>
> I don't see anything obvious, in the DOMDocument class at least.

Hi Dara,

the only way to validate a constructed DOM tree is to serialize and 
re-parse it. Xerces has no support for 'smart editor' capabilities, but 
is a standard-conform validating xml parser.

Cheers,
                        Axel

-- 
Humboldt-Universität zu Berlin
Institut für Informatik
Signalverarbeitung und Mustererkennung
Dipl.-Inf. Axel Weiß
Rudower Chaussee 25
12489 Berlin-Adlershof
+49-30-2093-3050
** www.freesp.de **

Reply via email to