IBM developerWorks
           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 March 4th, 2002, 07:29 AM
Miska's Avatar
Miska Miska is offline
Madden Maniac
Dev Shed Novice (500 - 999 posts)
 
Join Date: Jun 2001
Location: Finland
Posts: 519 Miska User rank is Lance Corporal (50 - 100 Reputation Level)Miska User rank is Lance Corporal (50 - 100 Reputation Level)Miska User rank is Lance Corporal (50 - 100 Reputation Level) 
Time spent in forums: 1 Day 3 h 47 m 50 sec
Reputation Power: 8
Simple XSL -- XML question

A XSL newbie question: I've need to get everything that is inside the <item> -tags, nothing else. How can I do this?

Here's the xml:
PHP Code:
<biztalk_1 xmlns="urn:biztalk-org:biztalk:biztalk_1">
  <
header>
    <
delivery>
      <
message>
        <
messageID>8DC017F4F70D67E00000045C</messageID>
        <
sent>2002-02-27T09:29:06</sent>
      </
message>
      <
to>
        <
address>urn:sap-com:logical-system:BC2</address>
      </
to>
      <
from>
        <
address>urn:sap-com:logical-system:BC1</address>
      </
from>
    </
delivery>
  </
header>
  <
body>
    <
doc:Z_LISTEN_MMC.Response xmlns:doc="urn:sap-com:document:sap:rfc:functions" xmlns="">
      <
DCOM_TABLE>
        <
item>
          <
VKGRP>402</VKGRP>
          <
BEZEI/>
          <
KATR10>F4</KATR10>
          <
KUNNR>0010333001</KUNNR>
//And so on... 
And here's the xsl file:
PHP Code:
<?xml version="1.0"?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">
<xsl:output method="text" media-type="text/plain" indent="no" encoding="ISO-8859-1"/>
<xsl:template match="DCOM_TABLE">
<xsl:for-each select="item">
    <xsl:value-of select="VKGRP"/>,<xsl:value-of select="BEZEI"/>,<xsl:value-of select="KATR10"/>,<xsl:value-of select="KUNNR"/>;
</xsl:for-each>
</xsl:template>
</xsl:stylesheet>

Reply With Quote
  #2  
Old March 4th, 2002, 04:01 PM
kingjr3 kingjr3 is offline
Junior Member
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jun 2001
Posts: 11 kingjr3 User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Send a message via Yahoo to kingjr3
What are you getting with that code?

Reply With Quote
  #3  
Old March 4th, 2002, 04:04 PM
kingjr3 kingjr3 is offline
Junior Member
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jun 2001
Posts: 11 kingjr3 User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Send a message via Yahoo to kingjr3
have you tried this?

have you tried this?
...
<xsl:value-of select="./VKGRP"/>,<xsl:value-of select="./BEZEI"/>,
...

notice the "./" before the child node name.

Reply With Quote
  #4  
Old March 5th, 2002, 12:57 AM
Miska's Avatar
Miska Miska is offline
Madden Maniac
Dev Shed Novice (500 - 999 posts)
 
Join Date: Jun 2001
Location: Finland
Posts: 519 Miska User rank is Lance Corporal (50 - 100 Reputation Level)Miska User rank is Lance Corporal (50 - 100 Reputation Level)Miska User rank is Lance Corporal (50 - 100 Reputation Level) 
Time spent in forums: 1 Day 3 h 47 m 50 sec
Reputation Power: 8
Figured it out... Template match = "node()" and for-each select="//DCOM_TABLE/item"

Your way prob. works too...

Thanks for helps!

Miska

Reply With Quote
Reply

Viewing: Dev Shed ForumsProgramming Languages - MoreXML Programming > Simple XSL -- XML question


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 1 hosted by Hostway