You are viewing a plain text version of this content. The canonical link for it is here.
Posted to p-dev@xerces.apache.org by "BENHAJ-ABDELLATIF,TAHIA (HP-France,ex1)" <ta...@hp.com> on 2002/07/02 16:56:32 UTC

validates file

Hello,

I want to validate the presentation of the XML document before
writing it in the file.

-To enable parameters:
 my $parser = XML::Xerces::DOMParser->new();
$validate = $XML::Xerces::DOMParser::Val_Always;
$parser->setValidationScheme($validate);
$parser->setDoNamespaces(1);
$parser->setToCreateXMLDeclTypeNode(1);
$parser->setDoSchema(1);

-modifications
- Here I want to check the validation of the content, I don't know how!!
-writing  in the XML file

What I got is that, I write the modification that I want 
but it does not validated before!!
When I parse the modified file, then it tells me that the file is invalid.

So what should I do
to validate the tree at the nmoment of the modification (before writing in
the file)??

---------------------------------------------------------------------
To unsubscribe, e-mail: xerces-p-dev-unsubscribe@xml.apache.org
For additional commands, e-mail: xerces-p-dev-help@xml.apache.org


Re: validates file

Posted by "Jason E. Stewart" <ja...@openinformatics.com>.
"BENHAJ-ABDELLATIF,TAHIA (HP-France,ex1)" <ta...@hp.com> writes:

> What I got is that, I write the modification that I want but it does
> not validated before!!  When I parse the modified file, then it
> tells me that the file is invalid.
> 
> So what should I do to validate the tree at the nmoment of the
> modification (before writing in the file)??

There is currently no way to validate a DOM Tree without first writing
it to a string using serialize(). Then create a MemBufInputSource and
parse that InputSource, with validation on.

jas.

---------------------------------------------------------------------
To unsubscribe, e-mail: xerces-p-dev-unsubscribe@xml.apache.org
For additional commands, e-mail: xerces-p-dev-help@xml.apache.org