moxol
12-30-2007, 07:36 PM
I have couple of questions.
I have created XML file and XML Schema for that file. I will first give them here:
example.xml:
<?xml version="1.0"?>
<COMPUTERS xmlns:="http://www.somesite.com/somename">
<MANUFACTURER>INTEL</MANUFACTURER>
<MODEL>Core2Duo</MODEL>
</COMPUTERS>
example.xsd:
<xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema"
targetNamespace="http://www.somesite.com/somename">
<xsd:element name="COMPUTERS" type="COMPUTERSType"/>
<xsd:complexType name="COMPUTERSType">
<xsd:sequence>
<xsd:element name="MANUFACTURER" type="xsd:string"/>
<xsd:element name="MODEL" type="xsd:string"/>
</xsd:sequence>
</xsd:complexType>
</xsd:schema>
My questions are:
1) Are both files correct? Is there any error?
2) If example.xsd file is stored on http://www.somesite.com/somename/example.xsd and example.xml on some different site, how to validate example.xml with example.xsd? Is that possible?
3) What program can I use to validate example.xml with example.xsd? Is there some online program?
4) Can someone explain me purpose of targetNamespace?
I have created XML file and XML Schema for that file. I will first give them here:
example.xml:
<?xml version="1.0"?>
<COMPUTERS xmlns:="http://www.somesite.com/somename">
<MANUFACTURER>INTEL</MANUFACTURER>
<MODEL>Core2Duo</MODEL>
</COMPUTERS>
example.xsd:
<xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema"
targetNamespace="http://www.somesite.com/somename">
<xsd:element name="COMPUTERS" type="COMPUTERSType"/>
<xsd:complexType name="COMPUTERSType">
<xsd:sequence>
<xsd:element name="MANUFACTURER" type="xsd:string"/>
<xsd:element name="MODEL" type="xsd:string"/>
</xsd:sequence>
</xsd:complexType>
</xsd:schema>
My questions are:
1) Are both files correct? Is there any error?
2) If example.xsd file is stored on http://www.somesite.com/somename/example.xsd and example.xml on some different site, how to validate example.xml with example.xsd? Is that possible?
3) What program can I use to validate example.xml with example.xsd? Is there some online program?
4) Can someone explain me purpose of targetNamespace?