aspose file tools*
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


Win a copy of Spring in Action this week in the Spring forum!
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: 10207
    
166

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]
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: How to call xsd file from xml file