Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Archived » XML Schema Definition (XSD) » Substitution Group
Substitution Group [message #597969] Tue, 18 April 2006 11:21
tatini venkate is currently offline tatini venkateFriend
Messages: 19
Registered: July 2009
Junior Member
Hi

I have a schema file which has 'persons' as root element.
'persons' has 'person' as child element which has 'Name' as child element.

I declared another element called 'FirstName' which can be substituted to
element 'Name'

Now I need to identify what are all the elements can be substuted in place
of element 'Name'.

In the above example I can use 'FirstName' instede of 'Name' in my XML doc.

Is there any way to get substitution list from XSD parser ?.

Here I am attaching sample schema and XML docs.

Thanks
Param

Family.xsd

<?xml version="1.0" encoding="ISO-8859-1"?>
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema"
xmlns="http://www.gxs.com" targetNamespace="http://www.gxs.com"
elementFormDefault="qualified">
<xs:element name="person" >
<xs:complexType>
<xs:sequence>
<xs:element ref="Name"/>
</xs:sequence>
</xs:complexType>
</xs:element>
<xs:element name="persons">
<xs:complexType>
<xs:sequence>
<xs:element ref="person" maxOccurs="40" />
</xs:sequence>
</xs:complexType>
</xs:element>
<xs:element name="Name" type="xs:string"/>
<xs:element name="FirstName" type="xs:string" SubstitutionGroup="Name"/>
</xs:schema>

Family.xml

<?xml version="1.0" encoding="UTF-8"?>
<!--Sample XML file generated by XMLSpy v2005 rel. 3 U
(http://www.altova.com)-->
<persons xmlns="http://www.gxs.com"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://www.gxs.com
family.xsd">
<person>
<Name>Name</Name>
</person>
<person>
<FirstName>FirstName</FirstName>
</person>
</persons>
Previous Topic:Good place to start?
Next Topic:Substitution Group
Goto Forum:
  


Current Time: Fri Apr 19 21:24:00 GMT 2024

Powered by FUDForum. Page generated in 0.03058 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top