Wrox Programmer Forums
Go Back   Wrox Programmer Forums > XML > XML
|
XML General XML discussions.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the XML section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old June 24th, 2004, 10:59 AM
Registered User
 
Join Date: Jun 2004
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts
Default Defining ID attributes

I have a number of documents that have a lot of part numbers in them. Some of these part numbers are related to multiple documents. I would like to have one XML document that would pull in the needed part numbers for any other given XML document. My thoughts would be to create an ID attribute in the part_numb element. Then link using IDREF.
Example:
<part_numb id="123456">123456</part_numb>
<part_numb id="789101">789101</part_numb>
etc...

Would this be the best way of handling this type of situation or are there better solutions.

Thanks
 
Old June 30th, 2004, 09:41 AM
Registered User
 
Join Date: Jun 2004
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Hi,

Do you need to restate the part number as both an attribute *and* as text?

I would have thought that either <part_numb>123456</part_numb> or <part_numb id="123456 /> would function equally well to reference the distinct parts. If you have other content to go within the part reference, you could have an ID attribute with nested tags.

<part_numb id="1234560">
<tag1>stuff</tag1>
<tag2>more stuff</tag2>
</part_numb>

Depends what's most relevant to your data.

I'm open to correction if I'm way off the mark there! Still banging my head against the padded cell of XML.







Similar Threads
Thread Thread Starter Forum Replies Last Post
Defining a process snufse ASP.NET 2.0 Basics 5 April 23rd, 2008 07:13 AM
help with defining in the database derrida BOOK: Beginning PHP5, Apache, and MySQL Web Development ISBN: 978-0-7645-7966-0 0 April 14th, 2007 03:17 AM
Defining the Variables. dpkbahuguna Beginning VB 6 2 November 1st, 2006 12:40 PM
how to parse xml with an attributes of type ID kirkpng XSLT 1 January 25th, 2005 04:44 PM
why not index.asp?id=1 can be www.myweb.com/?id=1 BurhanKhan Classic ASP Professional 11 September 6th, 2004 02:06 PM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.