wood burning stoves 2.0*
The moose likes XML and Related Technologies and the fly likes How to call xsd file from xml file Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Engineering » XML and Related Technologies
Bookmark "How to call xsd file from xml file" Watch "How to call xsd file from xml file" New topic
Author

How to call xsd file from xml file

praneeth ram
Ranch Hand

Joined: Sep 21, 2009
Posts: 60
Hi All,
My intention is when ever i invoke the xml file through browser, My xml file must be call and validated by xsd file. how can achive this. Which tag and attribute i need to write in xml file. I mentioned my file in the bellow.

emp.xsd
<? xml version="1.0" encoding="UTF-8" ?>
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema">
<xs:element name="employees" type="xsd:string"/>
</xsd:schema>

emp.xml
<!-- Here i want to mention emp.xsd file location -->
<employee>
praneeth
</employees>

both files are placed inside D:\praneeth folder.

Thanks & Regards,
Praneeth.
Jaikiran Pai
Marshal

Joined: Jul 20, 2005
Posts: 9963
    
163

First, your xsd has to specify the namespace under which the elements will be available. And once you do that, the elements in your xml can then refer to that namespace. See if this helps



[My Blog] [JavaRanch Journal]
 
jQuery in Action, 2nd edition
 
subject: How to call xsd file from xml file
 
Similar Threads
How to add jsp-api.jar or servlet-api.jar file to my programm in editplus2.x
Xerces: Using the method sax.Counter in xercesSamples.jar from the command line
XML Schema Help
XSL Read element Problem
Overwriting a specific XML section