[XML-DEV Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

ID and tag value uniqueness, how?

  • From: "Glenn R. Kronschnabl" <grk@a...>
  • To: xml-dev@i...
  • Date: Wed, 28 Oct 1998 12:23:32 -0600

tag value
Hi,

I am doing a simple xml document that contains a list of action items.
I want each action item to have a *unique* number that can
automatically be validated during the parser process.  This unique
number should facilitate file integrity (give me an error when run
thru a processor if there are duplicate entries) and be printed out as
the identifier colument (think of an excel spreadsheet) when I print
out the list.  The question I am wrestling with is how is the best way
(or is there a way?) to automagically guarantee/enforce uniqueness?  I
thought I could use an ID attribute, and specify a number (see Method
1 below), of course THIS IS INCORRECT!  (ID's must start with a
'Letter').  I don't want to do something like id="num1" because then I
would have to parse it, etc.  Method 2 is simple, but I can't
automagically check for uniqueness unless I write special code.  Is it
possible to use XML and/or DTD and/or the parser to generate unique
ID's - I would think that would solve my (part of the) problem.  [Of
course, the numbering would change if an item got deleted, which is
probably a bad thing since once the number is assigned to an item it
should never change.]  Thanks for any ideas/comments.

Method 1

  <item id="1">
    <title>Modify acceptance test plan</title>
    <description>UT to modify acceptance test to
                 include additional tests</description>
    <assigned>
      <duedate>1998-10-15</duedate>
      <whom>Joe Bob</whom>
    </assigned>
    <summary status="closed">
      <resolution>Test plan modified and sumbitted for review</resolution>
      <date>1998-10-15</date>
      <whom>Joe Bob</whom>
    </summary>
  </item>

Method 2

  <item>
    <id>1</id>
    <title>Modify acceptance test plan</title>
    <description>UT to modify acceptance test to
                 include additional tests</description>
    <assigned>
      <duedate>1998-10-15</duedate>
      <whom>Joe Bob</whom>
    </assigned>
    <summary status="closed">
      <resolution>Test plan modified and sumbitted for review</resolution>
      <date>1998-10-15</date>
      <whom>Joe Bob</whom>
    </summary>
  </item>

Cheers,
Glenn                                  
--------------------
Glenn R. Kronschnabl
Applied Research Laboratories        | grk@a... (PGP/MIME ok)
The University of Texas at Austin    | http://www.arlut.utexas.edu/~grk
PO Box 8029, Austin, TX 78713-8029   | (Ph) 512.835.3642 (FAX) 512.835.3808
10,000 Burnet Road, Austin, TX 78758 | ... but an Aggie at heart!

xml-dev: A list for W3C XML Developers. To post, mailto:xml-dev@i...
Archived as: http://www.lists.ic.ac.uk/hypermail/xml-dev/
To (un)subscribe, mailto:majordomo@i... the following message;
(un)subscribe xml-dev
To subscribe to the digests, mailto:majordomo@i... the following message;
subscribe xml-dev-digest
List coordinator, Henry Rzepa (mailto:rzepa@i...)


PURCHASE STYLUS STUDIO ONLINE TODAY!

Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
Email
First Name
Last Name
Company
Subscribe in XML format
RSS 2.0
Atom 0.3
 

Stylus Studio has published XML-DEV in RSS and ATOM formats, enabling users to easily subcribe to the list from their preferred news reader application.


Stylus Studio Sponsored Links are added links designed to provide related and additional information to the visitors of this website. they were not included by the author in the initial post. To view the content without the Sponsor Links please click here.

Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery ™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2013 All Rights Reserved.