473,325 Members | 2,792 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,325 software developers and data experts.

XSD - Howto specify element whose name is unknown

<title>
<A ID="ID_1"/>
<B ID="ID_2"/>
<SomeThingElse ID="ID_1000"/>
</title>
What I want to do is to write a schema for <title>'s children, which
element type is restricted to <xs:attribute name="ID" type="ID">, but
it's name is variable.

Thanks any way.
Jul 20 '05 #1
1 2175
sl******@21cn.com (slimzhao) wrote:
<title>
<A ID="ID_1"/>
<B ID="ID_2"/>
<SomeThingElse ID="ID_1000"/>
</title>
What I want to do is to write a schema for <title>'s children, which
element type is restricted to <xs:attribute name="ID" type="ID">, but
it's name is variable.


You might consider using substitutionGroup, e.g.

<xs:element name="id-elem" abstract="true">
<xs:complexType>
<xs:attribute name="ID" type="ID"/>
</xs:complexType>
</xs:element>

<xs:element name="A" substitutionGroup="id-elem">
....
</xs:element>

<xs:element name="B" substitutionGroup="id-elem">
....
</xs:element>

<xs:element name="SomeThingElse" substitutionGroup="id-elem">
....
</xs:element>

<xs:element name="title">
<xs:complexType>
<xs:element ref="id-elem" maxOccurs="unbounded"/>
</xs:complexType>
</xs:element>

Cheers

Jens
--
(Intentionally left blank.)
Jul 20 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: unwiseone | last post by:
Hello, Does any know how to specify a value of a DTD element? For example, here's an external DTD that I have: ======================================= <!ELEMENT summercamps (Camp+)>...
1
by: Sam Vanhoutte | last post by:
Hello, I am generating an XML schema for the use in Biztalk 2004. Everything works, except for one simple thing. I cannot add XmlSchemaElements to a XmlSchemaComplexType. This is necessary...
1
by: jrmsmo | last post by:
Hi there, I have an interesting problem that maybe you pros can suggest how I solve. I'm working with a third party program that serializes an XML document (it was obviously not designed with schema...
6
by: David B. Bitton | last post by:
I am having a problem deserializing XML when the root node is missing a namespace declaration. My Type has an XmlTypeAttribute with a namespace defined. If I attempt to deserialize the XML, I get...
2
by: Mark Doerbandt | last post by:
Hi, I need to validate a XML document where some of the element names are unnknown. <xs:any processContents="lax"/> or "skip" allows me to do so. But: I want to validate those elements -...
29
by: Ancient_Hacker | last post by:
It sure would be nice if I could have a macro that add a level of indirection to its argument. So if I write: AddIndirection( X ) The macro AddIndirection will do: #define X (*X) ...
12
by: Stef Mientki | last post by:
In the example below, "pin" is an object with a number of properties. Now I want 1- an easy way to create objects that contains a number of these "pin" 2- an multiple way to access these "pin",...
1
by: JavaXMLDev | last post by:
Hi I'm new to XML schema work, but wondered how, if at all possible, can you specify a relationship between the values of an element's attributes. Essentially I want context sensitive...
0
by: Horace A. 'Kicker' Vallas | last post by:
.... or using multiple dtd's for doctype. sorry if this is an infantile question - scouring an html to xhtml conversion is not something I often do :-( QUESTION: does anyone know how we can...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.