|
|
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.
|
|
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.
|
|
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"/>.
|
|
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.
|
|
|
guest |