how to define a key which generates unique sequence number?

Discussion in 'XML' started by XML fellow, Oct 3, 2008.

  1. XML fellow

    XML fellow Guest

    hi,
    i would like to define a unique key in the XSD, and once generating a
    default XML out of it (using XSD2INST tool), the XML will automaticaly
    be populated with a unique sequence number.

    similar to defining a sequence number in DB.

    can anyone advise how to do that?

    thanks :)


    *** Sent via Developersdex http://www.developersdex.com ***
     
    XML fellow, Oct 3, 2008
    #1
    1. Advertising

  2. XML fellow wrote:

    > i would like to define a unique key in the XSD, and once generating a
    > default XML out of it (using XSD2INST tool), the XML will automaticaly
    > be populated with a unique sequence number.
    >
    > similar to defining a sequence number in DB.
    >
    > can anyone advise how to do that?


    A key is defined with the xs:key element and its child elements
    xs:selector and xs:field, see
    http://www.w3.org/TR/xmlschema-0/#specifyingKeysAndtheirRefs

    Whether that tool you mention is then able to generate keys I don't
    know. You might want to check its documentation or find out whether
    there is a support forum or mailing list.


    --

    Martin Honnen
    http://JavaScript.FAQTs.com/
     
    Martin Honnen, Oct 3, 2008
    #2
    1. Advertising

  3. XML fellow

    XML fellow Guest

    thanks :)
    I'm familiar with the Key/Key-ref items.
    my question relates more to the 'sequence' issue. when you define
    selector it relates to some pre-defined key. i need this key to be a
    sequence, i.e. i++ each time it's being used.

    *** Sent via Developersdex http://www.developersdex.com ***
     
    XML fellow, Oct 3, 2008
    #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. writeOnceDebugEverywhere()

    Open-source tool which generates Java Value objects ?

    writeOnceDebugEverywhere(), Mar 23, 2005, in forum: Java
    Replies:
    5
    Views:
    724
    frebe
    Mar 23, 2005
  2. Mark Sullivan
    Replies:
    0
    Views:
    269
    Mark Sullivan
    Dec 21, 2007
  3. ToshiBoy
    Replies:
    6
    Views:
    850
    ToshiBoy
    Aug 12, 2008
  4. M P
    Replies:
    1
    Views:
    478
  5. Token Type
    Replies:
    9
    Views:
    359
    Chris Angelico
    Sep 9, 2012
Loading...

Share This Page