I have am xml file and I have want to create an xsd file for it.
I have written my file, but am experiencing errors when trying to validate the xml to my xsd.
Any pointing in the right direction you can give would be appreciated.
XML file:
Expand|Select|Wrap|Line Numbers
- <?xml version="1.0"?>
- <letter date="2005/1/1"
- xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
- xsi:noNamespaceSchemaLocation="http://some-where letter.xsd">
- <to>
- <first>smith</first>
- <last>Lee</last>
- </to>
- <from>
- <first>Sylvie</first>
- <middle>S.</middle>
- </from>
- <title>Example</title>
- <msg>
- <paragraph>
- I have a question.
- <paragraph>
- Can you infer an XML Schema?
- </paragraph>
- </paragraph>
- </msg>
- </letter>
Expand|Select|Wrap|Line Numbers
- <?xml version="1.0"?>
- <xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" elementFormDefault="qualified" attributeFormDefault="unqualified">
- <xs:element name="letter">
- </xs:element>
- <xs:complexType>
- <xs:element name="to" type="xs:normalizednormalizedString"/>
- <xs:element name="from" type="xs:normalizedString"/>
- <xs:element name="heading" type="xs:normalizedString"/>
- <xs:element name="body" type="xs:normalizedString"/>
- </xs:complexType>
- <xs:attribute>
- <xs:attribute name="last" type="xs:normalizedString"/>
- <xs:attribute name="first" type="xs:normalizedString"/>
- <xs:attribute name="middle" type="xs:normalizedString"/>
- <xs:attribute name="title" type="xs:normalizedString"/>
- <xs:attribute name="msg" type="xs:normalizedString"/>
- <xs:attribute name="paragraph" type="xs:normalizedString"/>
- </xs:attribute>
- </xs:schema>
Ln 8 Col 64 - s4s-elt-invalid-content.1: The content of 'null' is invalid. Element 'element' is invalid, misplaced, or occurs too often.
Ln 7 Col 18 - s4s-att-must-appear: Attribute 'name' must appear in element 'complexType'.
Ln 13 Col 15 - s4s-att-must-appear: Attribute 'name' must appear in element 'attribute'.
Ln 14 Col 58 - s4s-elt-must-match.1: The content of '(no name)' must match (annotation?, (simpleType?)). A problem was found starting at: attribute.