You are viewing a plain text version of this content. The canonical link for it is here.
Posted to j-users@xerces.apache.org by Piccand Régis <re...@imtf.ch> on 2002/04/22 11:29:11 UTC

RE: How to store Schema separately and xml separately and still v alidate the xml against the schema

Hello,
 
You have to options : either enter the full path to the schema in your xml
file, or set it programmatically.
 
To have the full path in the xml instance document :
 
<root xmlns=" http://www.yournamespace.com <http://www.yournamespace.com> "
xmlns:xsi=" http://www.w3.org/2001/XMLSchema-instance
<http://www.w3.org/2001/XMLSchema-instance> " xsi:schemaLocation="
http://www.yournamespace.com  <http://www.yournamespace.com>
file://thePathToSchema">
 
To set it programmatically :
DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance();
factory.setAttribute("
<http://apache.org/xml/properties/schema/external-schemaLocation>
http://apache.org/xml/properties/schema/external-schemaLocation",
"http://yournamespace.com " + thePathToSchema);
 
Hope this Helps,
 
Régis

-----Original Message-----
From: Kumuda Rajarshi [mailto:kumuda@learningmate.com]
Sent: mardi, 22. mai 2001 09:14
To: xerces-j-user@xml.apache.org
Subject: How to store Schema separately and xml separately and still
validate the xml against the schema



Hello,
I have a directory where I am storing all my Schema's and I have another
directory where I am storing my XML file. I have to store like this only.
If I do so, and If I validate, the XML, I am getting error which means that
the Schema is not found. 
How to validate those XML's whose schema is in separate Directory
Please do answer soon as possible.
Thanking you
KumudaRajarshi
 
 

 

			
____________________________________________________
 <http://www.incredimail.com/redir.asp?ad_id=309&lang=9>   IncrediMail -
Email has finally evolved -
<http://www.incredimail.com/redir.asp?ad_id=309&lang=9> Click Here


RE: How to store Schema separately and xml separately and still v alidate the xml against the schema

Posted by Kumuda Rajarshi <ku...@learningmate.com>.
Hello,
Thank you for your suggestion.
But If I have more than one Schema' s  Then How to write in the
thePathToSchema

can you please provide an Example?
 
factory.setAttribute("http://apache
org/xml/properties/schema/external-schemaLocation", "http://yournamespace
com " + thePathToSchema);
 
Thank You
 -------Original Message-------

From: xerces-j-user@xml.apache.org
Date: Monday, April 22, 2002 03:18:57 PM
To: 'xerces-j-user@xml.apache.org'
Subject: RE: How to store Schema separately and xml separately and still v
alidate the xml against the schema

Hello,
 
You have to options : either enter the full path to the schema in your xml
file, or set it programmatically.
 
To have the full path in the xml instance document :
 
<root xmlns="http://www.yournamespace.com" xmlns:xsi="http://www.w3
org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.yournamespace
com file://thePathToSchema">
 
To set it programmatically :
DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance();
factory.setAttribute("http://apache
org/xml/properties/schema/external-schemaLocation", "http://yournamespace
com " + thePathToSchema);
 
Hope this Helps,
 
Régis
-----Original Message-----
From: Kumuda Rajarshi [mailto:kumuda@learningmate.com]
Sent: mardi, 22. mai 2001 09:14
To: xerces-j-user@xml.apache.org
Subject: How to store Schema separately and xml separately and still
validate the xml against the schema


Hello,
I have a directory where I am storing all my Schema's and I have another
directory where I am storing my XML file. I have to store like this only.
If I do so, and If I validate, the XML, I am getting error which means that
the Schema is not found. 
How to validate those XML's whose schema is in separate Directory
Please do answer soon as possible.
Thanking you
KumudaRajarshi