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:
  #1  
Old September 12th, 2004, 11:28 PM
poisontheused poisontheused is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Aug 2004
Posts: 13 poisontheused User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 2 h 52 m 56 sec
Reputation Power: 0
Question Read More link/Excluding certain Data

Is it possible for example with the XML below use XSL to display each <cd> listing but only the <artist> and <title> then have a read more link below each <cd> to display all the info for that particular CD???? If so where to start??

Code:
<catalog>
<cd>
  <title>Empire Burlesque</title> 
  <artist>Bob Dylan</artist> 
  <country>USA</country> 
  <company>Columbia</company> 
  <price>10.90</price> 
  <year>1985</year> 
  </cd>
<cd>
  <title>Hide your heart</title> 
  <artist>Bonnie Tyler</artist> 
  <country>UK</country> 
  <company>CBS Records</company> 
  <price>9.90</price> 
  <year>1988</year> 
</cd>


Also I know how to select data that matches certain criteria.. but how would you go about selecting everything that doesnt match a certain criteria.. for example selecting every <cd> that doesn't have a <artist> value of 'Bob Dylan'??

Any help appreciated.. Thanks

Reply With Quote
  #2  
Old September 14th, 2004, 09:37 PM
fpmurphy fpmurphy is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Dec 2003
Location: USA
Posts: 305 fpmurphy User rank is Corporal (100 - 500 Reputation Level)fpmurphy User rank is Corporal (100 - 500 Reputation Level)fpmurphy User rank is Corporal (100 - 500 Reputation Level)fpmurphy User rank is Corporal (100 - 500 Reputation Level) 
Time spent in forums: 1 Day 7 h 17 m 54 sec
Reputation Power: 7
In answer to your second question i.e. output all except
Bob Dylan, here is a simple example:

Code:
<?xml version="1.0" encoding="UTF-8" ?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:output method="html" />

<xsl:template match="/">
    <xsl:apply-templates select="/catalog/cd/artist" />
</xsl:template>

<xsl:template match="/catalog/cd/artist">
    <xsl:if test="not(contains(., 'Bob Dylan'))">
       Artist: <xsl:value-of select="."/>
    </xsl:if>
</xsl:template>

</xsl:stylesheet>

Reply With Quote
Reply

Viewing: Dev Shed ForumsProgramming Languages - MoreXML Programming > Read More link/Excluding certain Data


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 5 hosted by Hostway
Stay green...Green IT