SunQuest
           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 August 11th, 2003, 11:56 AM
imbrokn imbrokn is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Sep 2001
Location: NJ
Posts: 428 imbrokn User rank is Corporal (100 - 500 Reputation Level)imbrokn User rank is Corporal (100 - 500 Reputation Level)imbrokn User rank is Corporal (100 - 500 Reputation Level)imbrokn User rank is Corporal (100 - 500 Reputation Level) 
Time spent in forums: 11 h 34 m 8 sec
Reputation Power: 10
Send a message via AIM to imbrokn
xsl transformation of element yeilds entire node set

My XML document is a little bit more complicated than this example but the principle remains the same. Lets say I have a XML doc defined as follows
PHP Code:
<cds>
  <
cd>
    <
artist></artist>
    <
title></title>
  </
cd>
  <
cd>
    <
artist></artist>
    <
title></title>
  </
cd>
  ...
  ...
</
cds


Ok, now using Microsofts XMLDOM object I'll get a "cd" element object. What i'm trying to do is mearly transform the cd object, however when I do this I'm getting my entire set of CD's as if i had called "transformNode" on the documentelement. Is it possible to just transform an element and not the entire document? My xsl doc would look something like this :

PHP Code:
<?xml version="1.0" encoding="iso-88859-1"?> 
<xsl:stylesheet version="1.0" xmlns:xsl=http://www.w3.org/1999/XSL/Transform">
   <xsl:template match="cd">
      <b><xsl:value-of select="Artist"/></b>
  </xsl:template>
</xsl:stylesheet>


Does this make sense? And is what I wish to do possible?

Reply With Quote
  #2  
Old August 12th, 2003, 12:18 PM
mulligh mulligh is offline
Junior Member
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jul 2003
Posts: 19 mulligh User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
How would the style sheet know which <cd> element you want to process? If you use <xsl:template match="cd">, you are going to match all <cd> elements unless you give it some criteria so it knows what you want to do.

Reply With Quote
  #3  
Old August 14th, 2003, 09:30 AM
opt-d5 opt-d5 is offline
Member
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Aug 2003
Location: Helsinki, Finland
Posts: 5 opt-d5 User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
If yo're using ASP, then try the following:
Code:
selectNodes("nodeset/nodes")

or

selectSingleNode("nodeset/nodes/node")


Haven't tried those myself yet, but they should to the trick

Reply With Quote
Reply

Viewing: Dev Shed ForumsProgramming Languages - MoreXML Programming > xsl transformation of element yeilds entire node set


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


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





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