IMPORTANT:
this is not a Support Forum! Experienced users might answer from time to time questions posted here. If you need a professional and reliable answer, or if you want to report a bug, please contact Altova Support instead.

restriction on attribute value Options · View
seribop
Posted: Thursday, September 3, 2009 2:07:31 PM
Rank: Newbie

Joined: 9/3/2009
Posts: 2
Location: Illinois
Hello,
I would like to make a schema that allows the same element name with different fixed attribute values. Sample xml:
<List>
<Object>
<String name="firmware-revision" value="b"/>
<String name="database-revision" value="10"/>
</Object>
<Object>
<String name="firmware-revision" value="f"/>
<String name="database-revision" value="50"/>
</Object>
</List>

I am having trouble making a "String" element have different fixed "name" attribute values, "firwmare-revision" and "database-revision".

I would appreciate any hints.

vlad
Posted: Thursday, September 3, 2009 2:45:45 PM
Rank: Advanced Member

Joined: 12/13/2005
Posts: 2,856
Location: Mauritius
Did you try to simply let XMLSpy generate a schema for you? I think it will very close to what you want.
seribop
Posted: Friday, September 4, 2009 5:37:46 PM
Rank: Newbie

Joined: 9/3/2009
Posts: 2
Location: Illinois
Thanks for the reply. But, that just makes a list of possible values for the attribute with an enumeration restriction. I need to force the values for the attribute values. I need <Object> to have a <String name="firmware-revision"/> and <String name="database-revision"/>.
vlad
Posted: Friday, September 4, 2009 8:45:37 PM
Rank: Advanced Member

Joined: 12/13/2005
Posts: 2,856
Location: Mauritius
If you mean that you want to ensure that every Object element has one String element with attribute name="firwmare-revision" and another one with name="database-revision", then I must disappoint you - there is no way to express this kind of restriction in XML Schema.
Users browsing this topic
guest

Forum Jump
You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.

Use of the Altova User Forum(s) is governed by the Altova Terms of Use.