XML Programming
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me
Go Back   Dev Shed ForumsProgramming Languages - MoreXML Programming

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Dev Shed Forums Sponsor:
Stay one step ahead of the competition. Evaluate and give feedback on some of the hottest web development tools on the market today. Make your opinion heard! Click Here
  #1  
Old June 21st, 2001, 04:27 AM
stardotstar stardotstar is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Nov 2000
Posts: 63 stardotstar User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 8
XML Help Needed

Say I have a simple XML file including this:
Code:
<ProductInfo>The <item>shirt</item> comes in 3 sizes.</ProductInfo>
<Comments>One <item>shirt</item> costs £10</Comments>

I need the XML file to know that the two instances of "shirt" are the same, so something like this:
Code:
<ProductInfo>The <item id="S3"/> comes in 3 sizes.</ProductInfo>
<Comments>One <item id="S3"/> costs £10</Comments>
<item id="S3" name="shirt"/>

...something to that effect, but obviously I'm doing it the wrong way.

What I want to achieve is a document that will look like this:

The shirt comes in 3 sizes.
One shirt costs £10

...so if I change "shirt" to "t-shirt" it will change in both places.

I'm finding it quite difficult to explain, but I hope you understand and can help me.

Thanks.

Reply With Quote
  #2  
Old June 29th, 2001, 12:38 AM
rdominy rdominy is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Feb 2001
Posts: 81 rdominy User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 8
Send a message via ICQ to rdominy
What are planning to use to generate the resulting document? Because on it's own XML is just a tag language and there are many applications/ways of transforming XML into something viewable.

Also, typically one would not mix data with pseudo-formatted output in the same document. Usuallly you have things broken into data and view transforms.

For example, if you use XML with XSL, you might have the following documents. Your XML document would have the data:

<item type="shirt" cost="10" numsizes="3"/>

And your XSL document would define how to output that into say HTML. Here's an XSL fragment:

<xsl:template match="item">
<p>The <xsl:value-of select="@type"/> comes in <xsl:value-of select="@numsizes"/> sizes.</p>
</xsl:template>

So the key is how do you plan to view your XML?
__________________
Robert Dominy
About Guide for JavaScript
http://javascript.about.com
Software Consulting & Development
http://www.angusog.com

Reply With Quote
Reply

Viewing: Dev Shed ForumsProgramming Languages - MoreXML Programming > XML Help Needed


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump

 Free IT White Papers!
 
Accelerating Trading Partner Performance
One in five. That's how many partner transactions have at least one error. That is an amazing statistic, particularly given the extraordinary leaps in innovation across the global supply chain during the past two decades. Download this white paper to learn more.

 
Competing on Analytics
This Tech Analysis is designed to help identify characteristics shared by analytics competitors, and includes information about 32 organizations that have made a commitment to quantitative, fact-based analysis.

 
Cost Effective Scaling with Virtualization and Coyote Point Systems
An overview of the industry trend toward virtualization, how server consolidation has increased the importance of application uptime and the steps being taken to integrate load balancing technology with virtualized servers.

 
Five Checkpoints to Implementing IP Telephony
Implementation planning for IP PBX software and IP telephony has become vital as businesses replace discontinued legacy PBX phone systems. This informative whitepaper outlines five "checkpoints" for any implementation plan that will help make IP communications a successful proposition.

 
Hosted Email Security: Staying Ahead of New Threats
In the last two years, email has become a fierce battleground between the nefarious forces of spam and malware, and the heroes of messaging protection. The spam volumes increased alarmingly every month, bringing clever new forms of phishing and virus propagation attacks.

 

Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 2 hosted by Hostway