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 July 29th, 2003, 10:50 PM
btho btho is offline
Junior Member
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jul 2003
Location: Fort Worth, TX
Posts: 3 btho User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Send a message via ICQ to btho Send a message via Yahoo to btho
XML Programming

Can someone help me with my "issue"?

I need to take firstname, lastname, headling, askingprice and put it in a table - I have a keyref which is memberid and need to know how I can get this to work .. Each person has 2 "ads" under their member id .. but the way I have it set up right now is not working - it's pulling all ads for each person.

Can someone please help?!!!

<?xml version="1.0" encoding="UTF-8" ?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:template match="/">
<table width="100%" border="1">
<tr><th>First Name</th>
<th>Last Name</th>
<th>Headline</th>
<th>Asking Price</th>
</tr>
<xsl:for-each select="//members">
<tr>
<td><xsl:value-of select="firstname" /></td>
<td><xsl:value-of select="lastname" /></td>
<td><xsl:value-of select="memberid" /></td>
</tr>
<xsl:for-each select="//ads">

<td><xsl:value-of select="headline" /></td>
<td><xsl:value-of select="askingprice" /></td>
<xsl:value-of select="memberid" />
</xsl:for-each>
</xsl:for-each>
</table>
</xsl:template>
</xsl:stylesheet>

Reply With Quote
  #2  
Old July 30th, 2003, 12:08 AM
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
Could you post some of your XML code?

Reply With Quote
  #3  
Old July 30th, 2003, 12:59 PM
btho btho is offline
Junior Member
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jul 2003
Location: Fort Worth, TX
Posts: 3 btho User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Send a message via ICQ to btho Send a message via Yahoo to btho
<?xml version="1.0" encoding="utf-8" ?>
<!-- Developed by Barb Thorne -->
<!-- Final Exam, Problem 3 -->
<classified>
<members>
<memberid>71569</memberid>
<firstname>Barb</firstname>
<lastname>Thorne</lastname>
<password>btho</password>
<confnumber>345762</confnumber>
<confirmed>Yes</confirmed>
</members>
<members>
<memberid>20668</memberid>
<firstname>Robert</firstname>
<lastname>Rider</lastname>
<password>rrid</password>
<confnumber>693440</confnumber>
<confirmed>No</confirmed>
</members>
<members>
<memberid>61162</memberid>
<firstname>Cheri</firstname>
<lastname>Kunz</lastname>
<password>ckun</password>
<confnumber>192173</confnumber>
<confirmed>Yes</confirmed>
</members>
<members>
<memberid>81264</memberid>
<firstname>Edmond</firstname>
<lastname>Thorne</lastname>
<password>etho</password>
<confnumber>754303</confnumber>
<confirmed>Yes</confirmed>
</members>
<members>
<memberid>12655</memberid>
<firstname>James</firstname>
<lastname>Woodman</lastname>
<password>jwoo</password>
<confnumber>449387</confnumber>
<confirmed>Yes</confirmed>
</members>
<ads>
<adid>011</adid>
<headline>HP Printer</headline>
<askingprice>25.00</askingprice>
<memberid>71569</memberid>
</ads>
<ads>
<adid>234</adid>
<headline>Red Wagon</headline>
<askingprice>20.00</askingprice>
<memberid>71569</memberid>
</ads>
<ads>
<adid>555</adid>
<headline>Afghan</headline>
<askingprice>30.00</askingprice>
<memberid>61162</memberid>
</ads>
<ads>
<adid>556</adid>
<headline>Winter Jacket</headline>
<askingprice>15.00</askingprice>
<memberid>61162</memberid>
</ads>
<ads>
<adid>113</adid>
<headline>ProForm Treadmill</headline>
<askingprice>50.00</askingprice>
<memberid>20668</memberid>
</ads>
<ads>
<adid>114</adid>
<headline>B.B. Gun</headline>
<askingprice>12.00</askingprice>
<memberid>20668</memberid>>
<adid>432</adid>
<headline>Swing Set</headline>
<askingprice>60.00</askingprice>
<memberid>81164</memberid>
</ads>
<ads>
<adid>433</adid>
<headline>Meiter Saw</headline>
<askigprice>45.00</askigprice>
<memeberid>81164</memeberid>
</ads>
<ads>
<adid>715</adid>
<headline>Ferret</headline>
<askingprice>10.00</askingprice>
<memberid>12655</memberid>
</ads>
<ads>
<adid>716</adid>
<headline>Oriental Noodle Collection</headline>
<askingprice>15.00</askingprice>
<memberid>12655</memberid>
</ads>
</classified>

Reply With Quote
  #4  
Old July 30th, 2003, 04:12 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

Reply With Quote
  #5  
Old July 30th, 2003, 04:19 PM
btho btho is offline
Junior Member
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jul 2003
Location: Fort Worth, TX
Posts: 3 btho User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Send a message via ICQ to btho Send a message via Yahoo to btho
But there's nothing there on the xslt

Reply With Quote
  #6  
Old July 31st, 2003, 09:22 AM
mrusaw's Avatar
mrusaw mrusaw is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jul 2003
Location: Dallas, Texas
Posts: 138 mrusaw User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 6
Send a message via AIM to mrusaw Send a message via Yahoo to mrusaw
try adding the following <xsl:if> to your code and see if that gives you the results you need.

Code:
<xsl:for-each select="//members">
                <xsl:if test="memberid = '71569'"> 
                    <tr>
                        <td>
                            <xsl:value-of select="firstname" />
                        </td>
                        <td>
                            <xsl:value-of select="lastname" />
                        </td>
                        <td>
                            <xsl:value-of select="memberid" />
                        </td>
                    </tr>
                    <xsl:for-each select="//ads">
                        <td>
                            <xsl:value-of select="headline" />
                        </td>
                        <td>
                            <xsl:value-of select="askingprice" />
                        </td>
                        <xsl:value-of select="memberid" />
                    </xsl:for-each>
                </xsl:if>
            </xsl:for-each>
__________________
mr...

mike.rusaw@realpage.com
RalPage, Inc.

"I have made this letter longer than usual, only because I have not had the time to make it shorter." - Blaise Paschal

Reply With Quote
Reply

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


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