unique element field as element?

Discussion in 'XML' started by Mike, Sep 23, 2005.

  1. Mike

    Mike Guest

    I have a dataset that I need to validate. Here an example similar to what I
    need to do:

    <Company>
    <Employee>
    <Name>...</Name>
    <EmployeeID>1234</EmployeeID>
    </Employee>
    <Employee>
    <Name>...</Name>
    <EmployeeID>1235</EmployeeID>
    </Employee>
    </Company>

    In the schema, I want to say:

    <xsd:unique name="uniqueEmployeeID">
    <xsd:selector xpath="Employee"/>
    <xsd:field xpath="EmployeeID"/>
    </xsd:unique>

    For some reason, it doesn't work. I know the normal case is to specify the
    field as an attribute, which I *can't* do.

    Thanks.
     
    Mike, Sep 23, 2005
    #1
    1. Advertising

  2. Mike

    Mike Guest

    I fixed my own problem -- had defined that unique element one level too
    deep.

    "Mike" <> wrote in message
    news:...
    >I have a dataset that I need to validate. Here an example similar to what I
    >need to do:
    >
    > <Company>
    > <Employee>
    > <Name>...</Name>
    > <EmployeeID>1234</EmployeeID>
    > </Employee>
    > <Employee>
    > <Name>...</Name>
    > <EmployeeID>1235</EmployeeID>
    > </Employee>
    > </Company>
    >
    > In the schema, I want to say:
    >
    > <xsd:unique name="uniqueEmployeeID">
    > <xsd:selector xpath="Employee"/>
    > <xsd:field xpath="EmployeeID"/>
    > </xsd:unique>
    >
    > For some reason, it doesn't work. I know the normal case is to specify the
    > field as an attribute, which I *can't* do.
    >
    > Thanks.
    >
    >
     
    Mike, Sep 23, 2005
    #2
    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. =?Utf-8?B?Q2hyaXM=?=

    form field auto numbering with unique value

    =?Utf-8?B?Q2hyaXM=?=, Dec 31, 2004, in forum: ASP .Net
    Replies:
    3
    Views:
    444
    John Saunders
    Jan 1, 2005
  2. ToshiBoy
    Replies:
    6
    Views:
    852
    ToshiBoy
    Aug 12, 2008
  3. Sound
    Replies:
    2
    Views:
    454
    Randy Webb
    Sep 28, 2006
  4. jr
    Replies:
    3
    Views:
    426
  5. Token Type
    Replies:
    9
    Views:
    360
    Chris Angelico
    Sep 9, 2012
Loading...

Share This Page