• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Schema

 
author and deputy
Posts: 3150
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,
In xml i have an element which occurs at two different places(in two different complex types)
In schema,is it possible to restrict this single element to have same value on its occurences.
Like
<A>
<B>1234</B>
<C>dkjds</C>
</A>
<X>
<B>1234</B>
</X>
This element B should have same value on all its occurences.
Is it possible to specify this in schema.
 
Greenhorn
Posts: 12
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Just give it a facet enumeration value
<xs:element name="B">
<xs:simpleType>
<xs:restriction base="xs:short">
<xs:enumeration value="1234"/>
</xs:restriction>
</xs:simpleType>
</xs:element>
 
Balaji Loganathan
author and deputy
Posts: 3150
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi Jerry,
Unfortunately I cant force my user to use a fixed value like 1234.
I removed that constraints from my reqts
Thanks for your reply.
Regards
Balaji
 
Don't get me started about those stupid light bulbs.
reply
    Bookmark Topic Watch Topic
  • New Topic