Anoop Singh wrote:
> Following is the right XML file::
>
> <?xml version="1.0" ?>
> <Request xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
> xsi:noNamespaceSchemaLocation="jasbir.xsd">
> <Transaction xsi:type="_Transaction_Login">
> <user_id>test</user_id>
> <password>xxx</password>
> </Transaction>
> </Request>
>
> Also, as u dont have DTD, so set the DTD feature to false , and true for
Schema
> xr.setFeature( "http://xml.org/sax/features/validation",false);
> xr.setFeature( "http://xml.org/sax/features/namespaces",true);
> xr.setFeature( "http://apache.org/xml/features/validation/schema",true);
For schema validation,"http://xml.org/sax/features/validation" should be set to
true.
The same is for JAXP, if you are using
http://java.sun.com/xml/jaxp/properties/schemaLanguage (SCHEMA_LANGUAGE)
property,
SAXParserFactory/DocumentBuilderFacotry should be set for validation
setValidating(true);
Neeraj
---------------------------------------------------------------------
To unsubscribe, e-mail: xerces-j-dev-unsubscribe@xml.apache.org
For additional commands, e-mail: xerces-j-dev-help@xml.apache.org
|