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:
Get inside! Sample the range of functionality easily built with JMSL Library for Time Series Data Analysis, Heat Maps, Portfolio Optimization, Monte Carlo Simulation, Stock Price Charting and more. Download Now!
  #1  
Old August 10th, 2002, 03:59 AM
getchoo getchoo is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Feb 2002
Posts: 20 getchoo User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
filtering xml output using xsl for-each select

I'm having difficulty filtering the xml output below


computerStore storeName="Mac Store">[code]
<model picture="images/imac.jpg">[code]
<name type="desktop">iMac</name>
<package>A</package>
<cpu speed="600">600MHz PowerPC G3</cpu>
<memory mem="128">128MB SDRAM</memory>
<hd size="40">40GB Ultra ATA drive</hd>
<drive>CD-ROM</drive>
<video>Rage 128 Ultra graphics</video>
<modem>56K internal modem</modem>
<price>799</price>
<tax>0.14</tax>
<shipping>20</shipping>
</model>
</computerStore>

I'm trying to write a stament that selects all desktop computers and its features(name,package, cpu) for each desktop computers

I created this stament:
<xsl:for-each select="computerStore/model["name/[@type='desktop']"]"> however its not working.

What am I doing wrong?

And another thing, how do I format code when I post on forum?

Please Help

getchoo

Reply With Quote
  #2  
Old August 10th, 2002, 03:26 PM
reemjacob reemjacob is offline
Junior Member
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jul 2002
Posts: 8 reemjacob User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Hello,

I hope this will help

<xsl:for-each select="computerStore/model[name[@type='desktop']]">


I did not get u regarding the formatting.

Reply With Quote
  #3  
Old August 10th, 2002, 08:04 PM
getchoo getchoo is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Feb 2002
Posts: 20 getchoo User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Hi thanx it worked....

Hi

What I meant by the second question is whenever I paste my code on this forum, the indentations and nesting is not preserved. How do I paste my code on this forum and it looks exactly like my original code.

Thanx

getchoo

Reply With Quote
  #4  
Old August 11th, 2002, 01:49 AM
reemjacob reemjacob is offline
Junior Member
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jul 2002
Posts: 8 reemjacob User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Hi

I guess this is something u have to ask the moderator. They could help u in this regard.


Reem

Reply With Quote
  #5  
Old August 11th, 2002, 11:01 AM
justin_dago justin_dago is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Apr 2002
Location: new york
Posts: 84 justin_dago User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 7
getchoo,

try this:

[ CODE] ...insert code here [ /CODE]

and remove the space between [ and C
same for [ and /


justin.dago();

Reply With Quote
Reply

Viewing: Dev Shed ForumsProgramming Languages - MoreXML Programming > filtering xml output using xsl for-each select


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