XSD for elements string with attribute id - xsd

I would like to write a XSD element that permit something like that :
<CustomFields>
<CustomField id="1">some text data</CustomField>
<CustomField id="2">some text data</CustomField>
</CustomFields>
But I have some restrictions : I have to restrict the text (maxLenght = 36). And I would like to be impossible to have 2 CustomField with the same id.
So far I wrote this, but it not what I want :
<xs:element name="CustomFields" minOccurs="0">
<xs:complexType>
<xs:sequence>
<xs:element name="CustomField" minOccurs="0" maxOccurs="20">
<xs:complexType>
<xs:simpleContent>
<xs:extension base="xs:string">
<xs:attribute name="id" type="xs:integer" use="required"></xs:attribute>
</xs:extension>
</xs:simpleContent>
</xs:complexType>
</xs:element>
</xs:sequence>
</xs:complexType>
</xs:element>
Thanks for any help.
Regards.

You could use following attempt
<?xml version="1.0" encoding="UTF-8"?>
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" elementFormDefault="qualified" attributeFormDefault="unqualified">
<xs:simpleType name="restrictedString">
<!-- Make a new type to be a "descendant" of string-->
<xs:restriction base="xs:string">
<xs:maxLength value="36"/>
</xs:restriction>
</xs:simpleType>
<xs:element name="CustomFields">
<xs:complexType>
<xs:sequence>
<xs:element name="CustomField" minOccurs="0" maxOccurs="20">
<xs:complexType>
<xs:simpleContent>
<!-- reference new type you declared above -->
<xs:extension base="restrictedString">
<xs:attribute name="id" type="xs:integer" use="required"/>
</xs:extension>
</xs:simpleContent>
</xs:complexType>
</xs:element>
</xs:sequence>
</xs:complexType>
<!-- Restrict #id to be unique-->
<xs:unique name="id_uq">
<xs:selector xpath="CustomField"/>
<xs:field xpath="#id"/>
</xs:unique>
</xs:element>
</xs:schema>

Related

Make element required when attribute is set to some value using XSD (1.1)

I have a following schema (1.1). I would like to have schema that will check that a sequence of parameters has mendatory parameter of type '1' and optional parameter of type '2'. I did it using alternatives because different types have different list of attributes.
How write an assertion to check that parameter of type 1 is mendatory?
<?xml version="1.0" encoding="UTF-8"?>
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:vc="http://www.w3.org/2007/XMLSchema-versioning" elementFormDefault="qualified" vc:minVersion="1.1">
<xs:element name="rule">
<xs:complexType>
<xs:sequence>
<xs:element name="conditions" maxOccurs="unbounded">
<xs:complexType>
<xs:sequence>
<xs:element name="condition" maxOccurs="unbounded" minOccurs="1">
<xs:complexType>
<xs:sequence>
<xs:element name="parameter" maxOccurs="unbounded" minOccurs="1">
<xs:alternative test="#type = '1'" type="typeOne"/>
<xs:alternative test="#type = '2'" type="typeTwo" />
</xs:element>
</xs:sequence>
</xs:complexType>
</xs:element>
</xs:sequence>
</xs:complexType>
</xs:element>
</xs:sequence>
</xs:complexType>
</xs:element>
<xs:complexType name="typeOne">
<xs:attribute name="type" type="xs:string" use="required"/>
</xs:complexType>
<xs:complexType name="typeTwo">
<xs:attribute name="type" type="xs:string" use="required" />
</xs:complexType>
</xs:schema>
I did it using alternatives because different types have different list of attributes.
It would be like this:
<xs:element name="condition" maxOccurs="unbounded" minOccurs="1">
<xs:complexType>
<xs:sequence>
<xs:element name="parameter" maxOccurs="unbounded" minOccurs="1">
<xs:alternative test="#type = '1'" type="typeOne"/>
<xs:alternative test="#type = '2'" type="typeTwo" />
</xs:element>
</xs:sequence>
<xs:assert id="type-1-mandatory" test="parameter[#type eq '1']"></xs:assert>
</xs:complexType>
</xs:element>

How to fully define an XML Schema for same element name but differing subtype

Hi again SO community,
got another request regarding how to define an XSD schema correctly.
Given I have an XML file like:
<?xml version="1.0" encoding="UTF-8" ?>
<transformation xmlns="http://www.denktmit.de/pdi/ktr" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="
http://www.w3.org/2001/XMLSchema-instance
./test.xsd">
<info>
<name>TrafoName</name>
<description>TrafoDescription</description>
</info>
<changedby>LastUser</changedby>
<step>
<type>FileInput</type>
<description>FileInput Step description</description>
<FileInputParameterOne>FileInputParam</FileInputParameterOne>
<another>1</another>
</step>
<step>
<type>Select</type>
<description>Select Step description</description>
<SelectParameterOne>SelectParameterOne</SelectParameterOne>
<SelectParameterTwo>SelectParameterTwo</SelectParameterTwo>
<another>2</another>
</step>
</transformation>
This resembles the style of the transformation files as produced by http://community.pentaho.com/projects/data-integration/
As you can see, each step contains several sequence nodes on top
<type>Select</type>
<description>Select Step description</description>
and on bottom:
<another>2</another>
In between, arbitrary complex xml subtrees may occur. But what exactely max occur is determined by the value in "type". The use case is to store specific configurations for concrete Java classes, that all implement an interface, defining getters/setter for "type", "description" and "another" and defining addtional object structure themself. It would also be sufficient to neglect the order, as long as all the elements, needed for a specific class are somehow present.
I already read:
How to group types & subtypes in XSD
xsd: How to extend a type with an unordered list of elements
Use <xs:all> in XML schema's complexType?
xsd: How to extend a type with an unordered list of elements
And I tried something like
<?xml version="1.0" encoding="UTF-8"?>
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema"
targetNamespace="http://www.denktmit.de/pdi/ktr" elementFormDefault="qualified"
attributeFormDefault="unqualified" xmlns="http://www.denktmit.de/pdi/ktr">
<xs:element name="transformation">
<xs:complexType>
<xs:sequence>
<xs:choice minOccurs="0" maxOccurs="unbounded">
<xs:element name="step" type="fileInputStep"></xs:element>
<xs:element name="step" type="selectStep"></xs:element>
</xs:choice>
</xs:sequence>
</xs:complexType>
</xs:element>
<xs:complexType name="stepComplexType" abstract="true"></xs:complexType>
<xs:complexType name="fileInputStep">
<xs:complexContent>
<xs:extension base="stepComplexType">
<xs:sequence>
<xs:element name="type" minOccurs="1"
maxOccurs="1">
<xs:simpleType>
<xs:restriction base="xs:string"></xs:restriction>
</xs:simpleType>
</xs:element>
<xs:element name="description" type="xs:string"
minOccurs="1" maxOccurs="1"></xs:element>
<xs:element name="FileInputParameterOne" type="xs:string">
</xs:element>
<xs:element name="another" type="xs:int" minOccurs="1"
maxOccurs="1"></xs:element>
</xs:sequence>
</xs:extension>
</xs:complexContent>
</xs:complexType>
<xs:complexType name="selectStep">
<xs:complexContent>
<xs:extension base="stepComplexType">
<xs:sequence>
<xs:element name="type" minOccurs="1"
maxOccurs="1">
<xs:simpleType>
<xs:restriction base="xs:string">
<xs:pattern value="Select"></xs:pattern>
</xs:restriction>
</xs:simpleType>
</xs:element>
<xs:element name="description" type="xs:string"
minOccurs="1" maxOccurs="1"></xs:element>
<xs:element minOccurs="1" name="SelectParameterOne"
type="xs:string">
</xs:element>
<xs:element minOccurs="1" name="SelectParameterTwo"
type="xs:string">
</xs:element>
<xs:element name="another" type="xs:int" minOccurs="1"
maxOccurs="1"></xs:element>
</xs:sequence>
</xs:extension>
</xs:complexContent>
</xs:complexType>
</xs:schema>
But it is not working, telling me:
Multiple annotations found at this line: validation against this
schema, ambiguity would be created for those two particles.
- Start tag of element
- cos-element-consistent: Error for type '#AnonType_transformation'. Multiple elements with name 'step', with different types, appear in
the model group.
Any ideas?
You may use xsd Group. Here's an sample for your reference
XSD:
<?xml version="1.0" encoding="UTF-8"?>
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema">
<xs:element name="transformation">
<xs:complexType>
<xs:sequence>
<xs:choice minOccurs="0" maxOccurs="unbounded">
<xs:element name="step" type="stepType"/>
</xs:choice>
</xs:sequence>
</xs:complexType>
</xs:element>
<xs:complexType name="stepComplexType" abstract="true"></xs:complexType>
<xs:group name="selectParamGroup">
<xs:sequence>
<xs:element name="SelectParameterOne" type="xs:string" minOccurs="1" maxOccurs="1">
</xs:element>
<xs:element name="SelectParameterTwo" type="xs:string" minOccurs="1" maxOccurs="1">
</xs:element>
</xs:sequence>
</xs:group>
<xs:group name="paramGroup">
<xs:choice>
<xs:element name="FileInputParameterOne" type="xs:string">
</xs:element>
<xs:group ref="selectParamGroup">
</xs:group>
</xs:choice>
</xs:group>
<xs:complexType name="stepType">
<xs:complexContent>
<xs:extension base="stepComplexType">
<xs:sequence>
<xs:element name="type" minOccurs="1"
maxOccurs="1">
<xs:simpleType>
<xs:restriction base="xs:string"></xs:restriction>
</xs:simpleType>
</xs:element>
<xs:element name="description" type="xs:string"
minOccurs="1" maxOccurs="1"></xs:element>
<xs:group ref="paramGroup"></xs:group>
<xs:element name="another" type="xs:int" minOccurs="1"
maxOccurs="1"></xs:element>
</xs:sequence>
</xs:extension>
</xs:complexContent>
</xs:complexType>
</xs:schema>
XML:
<?xml version="1.0" encoding="UTF-8" ?>
<transformation>
<step>
<type>FileInput</type>
<description>FileInput Step description</description>
<FileInputParameterOne>FileInputParam</FileInputParameterOne>
<another>1</another>
</step>
<step>
<type>Select</type>
<description>Select Step description</description>
<SelectParameterOne>SelectParameterOne</SelectParameterOne>
<SelectParameterTwo>SelectParameterTwo</SelectParameterTwo>
<another>2</another>
</step>
</transformation>

Oxygen is telling me to terminate complexType despite being terminated

Right now oxygen is telling me to terminate complex type despite it already being terminated. Why is that happening? I tried removing the simpleType. I tried taking out the complex type and it still won't accept it. Here is the code.
<?xml version="1.0" encoding="UTF-8"?>
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" elementFormDefault="qualified" targetNamespace="http://www.engr.iupui.edu/~efernand/account" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:account="http://www.engr.iupui.edu/~efernand/account">
<xs:element name="account">
<xs:complexType>
<xs:sequence>
<xs:element ref="account:owner"/>
<xs:choice maxOccurs="unbounded">
<xs:element ref="account:deposit"/>
<xs:element ref="account:payment"/>
</xs:choice>
</xs:sequence>
<xs:attribute name="number" use="required" type="xs:NCName"/>
<xs:attribute name="type" use="required" />
<xs:simpleType>
<xs:restriction base="xs:NCName">
<xs:enumeration value="direct"/>
<xs:enumeration value="check"/>
<xs:enumeration value="cash"/>
<xs:enumeration value="transfer"/>
<xs:enumeration value="atm" />
</xs:restriction>
</xs:simpleType>
</xs:attribute> <!--ERROR HERE-->
</xs:complexType>
</xs:element>
<xs:element name="owner">
<xs:complexType>
<xs:sequence>
<xs:element ref="account:name"/>
<xs:element ref="account:address"/>
</xs:sequence>
</xs:complexType>
</xs:element>
<xs:element name="name">
<xs:complexType>
<xs:sequence>
<xs:element ref="account:first"/>
<xs:element ref="account:last"/>
</xs:sequence>
</xs:complexType>
</xs:element>
<xs:element name="first" type="xs:NCName"/>
<xs:element name="last" type="xs:NCName"/>
<xs:element name="address">
<xs:complexType>
<xs:sequence>
<xs:element ref="account:street"/>
<xs:element ref="account:city"/>
<xs:element ref="account:state"/>
<xs:element ref="account:zip"/>
</xs:sequence>
</xs:complexType>
</xs:element>
<xs:element name="street" type="xs:string"/>
<xs:element name="city" type="xs:NCName"/>
<xs:element name="state">
<xs:simpleType>
<xs:restriction base="xs:NCName">
<xs:pattern value="[a-zA-Z]{2}"/>
</xs:restriction>
</xs:simpleType>
</xs:element>
<xs:element name="zip" type="xs:integer"/>
<xs:element name="deposit">
<xs:complexType>
<xs:sequence>
<xs:element ref="account:from"/>
<xs:element ref="account:amount"/>
<xs:element ref="account:date"/>
<xs:element minOccurs="0" ref="account:description"/>
</xs:sequence>
<xs:attribute name="type" use="required" type="xs:NCName"/>
</xs:complexType>
</xs:element>
<xs:element name="from">
<xs:complexType mixed="true">
<xs:attribute name="category" use="required" type="xs:NCName"/>
</xs:complexType>
</xs:element>
<xs:element name="payment">
<xs:complexType>
<xs:sequence>
<xs:element ref="account:to"/>
<xs:element ref="account:amount"/>
<xs:element ref="account:date"/>
<xs:element minOccurs="0" ref="account:description"/>
</xs:sequence>
<xs:attribute name="checknum">
<xs:simpleType>
<xs:restriction base="xs:NCName">
<xs:pattern value="C[0-9]{4}"/>
</xs:restriction>
</xs:simpleType>
</xs:attribute>
<xs:attribute name="type" use="required" type="xs:NCName"/>
</xs:complexType>
</xs:element>
<xs:element name="to">
<xs:complexType mixed="true">
<xs:attribute name="category" use="required">
<xs:simpleType>
<xs:restriction base="xs:NCName">
<xs:enumeration value="income" />
<xs:enumeration value="other"/>
<xs:enumeration value="cash"/>
<xs:enumeration value="food"/>
<xs:enumeration value="utilites"/>
<xs:enumeration value="clothing"/>
<xs:enumeration value="savings"/>
<xs:enumeration value="entertainment"/>
</xs:restriction>
</xs:simpleType>
</xs:attribute>
</xs:complexType>
</xs:element>
<xs:element name="amount" type="xs:decimal"/>
<xs:simpleType name="amount">
<xs:restriction base="xs:decimal">
<xs:minExclusive value="0"/>
<xs:fractionDigits value="2"/>
</xs:restriction>
</xs:simpleType>
<xs:element name="date" type="xs:date"/>
<xs:simpleType name="date">
<xs:restriction base="xs:date">
<!--No month number begins with 2-->
<xs:pattern value="[0-9]{4}-[0-1][0-9]-[0-9]{2}"/>
</xs:restriction>
</xs:simpleType>
<xs:element name="description" type="xs:string"/>
</xs:schema>
<xs:attribute name="type" use="required" />
I don't think you want the / there.

XSD Restriction on Attribute

I think I have searched a lot about this but still no go.
Will appreciate any help.
I am trying to restrict an attribute for an element with empty content. "color" should have a restriction to only hold 3 digit or minLength=3 and maxLength=3. It should not have any content.
<?xml version="1.0" encoding="utf-8"?>
<items xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="">
<product id="" name="">
<article id="1001">
<umbrella color="100"/>
<umbrella color="101"/>
</article>
<article id="1002">
<umbrella color="110"/>
</article>
</product>
</items>
EDIT: I know how to do a XSD Restriction on a simpleType. But I don't how to combine it to one entity with a ComplexType.
If you could provide a more detailed (or full) solution I would be happy.
Btw, "color" is not limited to xs:integer. It is actually a xs:string.
You can define your attribute similar to the following. This example uses a pattern to restrict the value, but you could also use min and max if that's more appropriate.
<xs:attribute name="color">
<xs:simpleType>
<xs:restriction base="xs:integer">
<xs:pattern value="[0-9][0-9][0-9]"/>
</xs:restriction>
</xs:simpleType>
</xs:attribute>
Then in your element definition, you just use a ref to reference the defined attribute:
<xs:attribute ref="color"/>
UPDATE (in response to comment from OP):
Here's what the entire schema might look like:
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema">
<xs:attribute name="color">
<xs:simpleType>
<xs:restriction base="xs:integer">
<xs:pattern value="[0-9][0-9][0-9]"/>
</xs:restriction>
</xs:simpleType>
</xs:attribute>
<xs:attribute name="id">
<xs:simpleType>
<xs:restriction base="xs:integer">
<xs:pattern value="[0-9][0-9][0-9][0-9]"/>
</xs:restriction>
</xs:simpleType>
</xs:attribute>
<xs:attribute name="name" type="xs:string"/>
<xs:complexType name="article_type">
<xs:attribute ref="color" use="required"/>
</xs:complexType>
<xs:element name="article">
<xs:complexType>
<xs:choice maxOccurs="unbounded" minOccurs="0">
<xs:element name="umbrella" type="article_type"/>
</xs:choice>
<xs:attribute ref="id" use="required"/>
</xs:complexType>
</xs:element>
<xs:element name="product">
<xs:complexType>
<xs:choice maxOccurs="unbounded" minOccurs="0">
<xs:element ref="article"/>
</xs:choice>
<xs:attribute ref="id" use="required"/>
<xs:attribute ref="name"/>
</xs:complexType>
</xs:element>
<xs:element name="items">
<xs:complexType>
<xs:choice maxOccurs="unbounded" minOccurs="0">
<xs:element ref="product"/>
</xs:choice>
</xs:complexType>
</xs:element>
</xs:schema>
The following should work
<element name="umbrella" nillable="true" type="umbrellaType">
<complexType name="umbrellaType">
<attribute name="color">
<simpleType>
<restriction base="int">
<minExclusive value="99"></minExclusive>
<maxInclusive value="999"></maxInclusive>
</restriction>
</simpleType>
</attribute>
</complexType>

Bind an attribute to an other existing attribute

i want to create a XSD.
One optional element in the XSD is <PrintoutSettings OrderSource="NameOfOrder_X" .../>
Another substructure of the XSD is
<Order Name="NameOfOrder">...</Order>
<Order Name="NameOfOrder2">...</Order>
...
My aim is it, that the attribute NameOfOrder_X of <PrintoutSettings .../> must be a string that was defined in one of the <Order>...</Order> - elements.
How can i realize it in a XSD?
Kind regards
sb
---
---
Here some of my XSD:
<xs:complexType name="Order">
<xs:sequence>
<xs:element form="qualified" minOccurs="0" name="Documents" type="Documents"/>
</xs:sequence>
<xs:attribute name="Name" type="xs:string" use="required"/>
<xs:attribute name="Translator" type="xs:string" use="required"/>
<xs:attribute name="Proofreader" type="xs:string" use="required"/>
<xs:attribute name="LockedBy" type="xs:string" use="optional"/>
</xs:complexType>
<xs:complexType name="Orders">
<xs:sequence>
<xs:element maxOccurs="unbounded" name="Order" type="Order"/>
</xs:sequence>
</xs:complexType>
<xs:complexType name="QQDBData">
<xs:sequence>
<xs:element minOccurs="0" name="Orders" type="Orders"/>
<xs:element minOccurs="0" name="LocalSettings" type="Settings"/>
</xs:sequence>
<xs:attribute default="2000-01-01" name="CreationDate" type="xs:date" use="optional"/>
</xs:complexType>
<xs:element name="QQDBData" type="QQDBData">
<xs:key name="PK-Orders">
<xs:selector xpath="Order"/>
<xs:field xpath="#Name"/>
</xs:key>
<xs:keyref name="FK-PrintoutSettings" refer="PK-Orders">
<xs:selector xpath="PrintoutSettings"/>
<xs:field xpath="#OrderSource"/>
</xs:keyref>
</xs:element>
The answer you've got from #DevNull is technically correct (+1); it is, however, not so much XSD; have a look at this section from the schema primer to understand the limitations you have with ID/IDREF.
I'll take the schema put forward by DevNull and modify it to show you the recommended XSD approach that relies on key/keyref.
UPDATE: I took your schema and updated to make sure it is sufficient for my tests:
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" elementFormDefault="qualified">
<xs:complexType name="Order">
<xs:sequence>
<xs:element form="qualified" minOccurs="0" name="Documents" type="Documents"/>
</xs:sequence>
<xs:attribute name="Name" type="xs:string" use="required"/>
<xs:attribute name="Translator" type="xs:string" use="required"/>
<xs:attribute name="Proofreader" type="xs:string" use="required"/>
<xs:attribute name="LockedBy" type="xs:string" use="optional"/>
</xs:complexType>
<xs:complexType name="Documents"/>
<xs:complexType name="Orders">
<xs:sequence>
<xs:element maxOccurs="unbounded" name="Order" type="Order"/>
</xs:sequence>
</xs:complexType>
<xs:complexType name="QQDBData">
<xs:sequence>
<xs:element minOccurs="0" name="Orders" type="Orders"/>
<xs:element minOccurs="0" name="LocalSettings" type="Settings"/>
</xs:sequence>
<xs:attribute default="2000-01-01" name="CreationDate" type="xs:date" use="optional"/>
</xs:complexType>
<xs:complexType name="Settings">
<xs:attribute name="OrderSource" use="required" type="xs:string"/>
</xs:complexType>
<xs:element name="QQDBData" type="QQDBData">
<xs:key name="PK-Orders">
<xs:selector xpath="Orders/Order"/>
<xs:field xpath="#Name"/>
</xs:key>
<xs:keyref name="FK-PrintoutSettings" refer="PK-Orders">
<xs:selector xpath="LocalSettings"/>
<xs:field xpath="#OrderSource"/>
</xs:keyref>
</xs:element>
</xs:schema>
What I had to do is to update the selectors, since by introducing additional tags, the XPath has changed. I always try to visualize the constraints, to ensure that the XPaths as described still make sense.
An updated sample XML:
<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<!-- Sample XML generated by QTAssistant (http://www.paschidev.com) -->
<QQDBData xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" CreationDate="2000-01-01">
<Orders>
<Order Name="Name1" Translator="Translator1" Proofreader="Proofreader1" LockedBy="LockedBy1">
<Documents/>
</Order>
<Order Name="Name1" Translator="Translator1" Proofreader="Proofreader1" LockedBy="LockedBy1">
<Documents/>
</Order>
</Orders>
<LocalSettings OrderSource="OrderSource1"/>
</QQDBData>
An error message, for the same invalid XML may look like (I am using QTAssistant to validate):
Error occurred while loading [], line 12 position 3
The key sequence 'OrderSource1' in Keyref fails to refer to some key.
You can use an attribute type of xs:ID for <Order> and an attribute type of xs:IDREF for <PrintoutSettings>.
Example XSD:
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" elementFormDefault="qualified">
<xs:element name="doc">
<xs:complexType>
<xs:sequence>
<xs:element maxOccurs="unbounded" ref="Order"/>
<xs:element ref="PrintoutSettings"/>
</xs:sequence>
</xs:complexType>
</xs:element>
<xs:element name="Order">
<xs:complexType>
<xs:simpleContent>
<xs:extension base="xs:NMTOKEN">
<xs:attribute name="Name" use="required" type="xs:ID"/>
</xs:extension>
</xs:simpleContent>
</xs:complexType>
</xs:element>
<xs:element name="PrintoutSettings">
<xs:complexType>
<xs:attribute name="OrderSource" use="required" type="xs:IDREF"/>
</xs:complexType>
</xs:element>
</xs:schema>
Example of INVALID XML: (Gives the error "There is no ID/IDREF binding for IDREF 'NameOfOrder_X'." in Xerces.)
<doc xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="book.xsd">
<Order Name="NameOfOrder">...</Order>
<Order Name="NameOfOrder2">...</Order>
<PrintoutSettings OrderSource="NameOfOrder_X"/>
</doc>
Example of VALID XML:
<doc xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="book.xsd">
<Order Name="NameOfOrder">...</Order>
<Order Name="NameOfOrder2">...</Order>
<PrintoutSettings OrderSource="NameOfOrder2"/>
</doc>

Resources