xml-schema:Uniqueness attributes of differend elements

Discussion in 'XML' started by thijs.kupers@gmail.com, Jan 3, 2005.

  1. Guest

    Hi

    I want to define a schema for my xml. I want to transform the xml in
    java-code by xslt, so it is important (for naming conflicts) that the
    values of the name-attributes in the xml been unique.

    I have a xml file like this:

    <someroot>
    <A_Item name="foo">
    <B_Item name="123"/>
    <B_Item name="456"/>
    </A_Item>
    <B_Item name="foo"/>
    </someroot>

    The '<B_Item name="foo"/>' must give an error by the validator check.
    How can I do that with xml-schema?

    Regards,
    Thijs
     
    , Jan 3, 2005
    #1
    1. Advertising

  2. wrote:


    > I have a xml file like this:
    >
    > <someroot>
    > <A_Item name="foo">
    > <B_Item name="123"/>
    > <B_Item name="456"/>
    > </A_Item>
    > <B_Item name="foo"/>
    > </someroot>
    >
    > The '<B_Item name="foo"/>' must give an error by the validator check.
    > How can I do that with xml-schema?


    <xs:attribute name="name" type="xs:ID" />

    --

    Martin Honnen
    http://JavaScript.FAQTs.com/
     
    Martin Honnen, Jan 3, 2005
    #2
    1. Advertising

  3. Guest

    Is it so easy?

    Thanks

    Thijs
     
    , Jan 3, 2005
    #3
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Ognen Ivanovski
    Replies:
    0
    Views:
    951
    Ognen Ivanovski
    Jul 15, 2003
  2. Olaf Meyer

    XML schema uniqueness constraints

    Olaf Meyer, Jan 15, 2004, in forum: XML
    Replies:
    0
    Views:
    510
    Olaf Meyer
    Jan 15, 2004
  3. Victor
    Replies:
    3
    Views:
    987
    Martin Honnen
    Feb 6, 2004
  4. Replies:
    3
    Views:
    2,957
  5. Adam Gardner
    Replies:
    5
    Views:
    152
    Sebastian Hungerecker
    Nov 19, 2008
Loading...

Share This Page