cstaprogrammer
Programmer
Hello
I am really new to xml and really struggling with getting started validating my test xml file with a schema. I have a web server running on my local machine with the schema in the root directory of my web server folder.
Here is my xml file:
<metaData
xmlns="xmlns:xsi="xsi:schemaLocation=" tserverschema.xsd">
<cfgApplication type="1" version="7.6.000.40" templateVersion="8.0.000.00">
<description>
Here the Application description located, where the roles and base functionality described.
</description>
<installation>
</installation>
</cfgApplication>
</metaData>
And here is my schema:
<?xml version="1.0"?>
<xs:schema xmlns:xs=" targetNamespace=" xmlns=" elementFormDefault="qualified">
<xs:element name="metaData">
<xs:complexType>
<xs:sequence>
<xs:element name="cfgApplication" type="xs:string"/>
<xs:attribute name="type" type="xs:string" use="required"></xs:attribute>
<xs:attribute name="version" type="xs:string" use="required"></xs:attribute>
<xs:attribute name="templateVersion" type="xs:string" use="required"></xs:attribute>
<xs:complexType>
<xs:sequence>
<xs:element name="description" type="xs:string"/>
<xs:element name="configuration" type="xs:string"/>
<xs:element name="linkedResources" type="xs:string"/>
<xs:element name="installation" type="xs:string"/>
</xs:sequence>
</xs:complexType>
<xs:element name="cfgDN" type="xs:string"/>
<xs:element name="cfgAgentLogin" type="xs:string"/>
</xs:sequence>
</xs:complexType>
</xs:element></xs:schema>
In Altova XMLSpy I get the error message that xml file is not valid. Unable to locate a reference to a supported schema type (DTD, W3C Schema) within this document instance.
What am I doing wrong?
Angus
I am really new to xml and really struggling with getting started validating my test xml file with a schema. I have a web server running on my local machine with the schema in the root directory of my web server folder.
Here is my xml file:
<metaData
xmlns="xmlns:xsi="xsi:schemaLocation=" tserverschema.xsd">
<cfgApplication type="1" version="7.6.000.40" templateVersion="8.0.000.00">
<description>
Here the Application description located, where the roles and base functionality described.
</description>
<installation>
</installation>
</cfgApplication>
</metaData>
And here is my schema:
<?xml version="1.0"?>
<xs:schema xmlns:xs=" targetNamespace=" xmlns=" elementFormDefault="qualified">
<xs:element name="metaData">
<xs:complexType>
<xs:sequence>
<xs:element name="cfgApplication" type="xs:string"/>
<xs:attribute name="type" type="xs:string" use="required"></xs:attribute>
<xs:attribute name="version" type="xs:string" use="required"></xs:attribute>
<xs:attribute name="templateVersion" type="xs:string" use="required"></xs:attribute>
<xs:complexType>
<xs:sequence>
<xs:element name="description" type="xs:string"/>
<xs:element name="configuration" type="xs:string"/>
<xs:element name="linkedResources" type="xs:string"/>
<xs:element name="installation" type="xs:string"/>
</xs:sequence>
</xs:complexType>
<xs:element name="cfgDN" type="xs:string"/>
<xs:element name="cfgAgentLogin" type="xs:string"/>
</xs:sequence>
</xs:complexType>
</xs:element></xs:schema>
In Altova XMLSpy I get the error message that xml file is not valid. Unable to locate a reference to a supported schema type (DTD, W3C Schema) within this document instance.
What am I doing wrong?
Angus