#1
  1. Madden Maniac
    Devshed Novice (500 - 999 posts)

    Join Date
    Jun 2001
    Location
    Finland
    Posts
    519
    Rep Power
    14

    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>
  2. #2
  3. No Profile Picture
    Junior Member
    Devshed Newbie (0 - 499 posts)

    Join Date
    Jun 2001
    Posts
    11
    Rep Power
    0
    What are you getting with that code?
  4. #3
  5. No Profile Picture
    Junior Member
    Devshed Newbie (0 - 499 posts)

    Join Date
    Jun 2001
    Posts
    11
    Rep Power
    0

    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.
  6. #4
  7. Madden Maniac
    Devshed Novice (500 - 999 posts)

    Join Date
    Jun 2001
    Location
    Finland
    Posts
    519
    Rep Power
    14
    Figured it out... Template match = "node()" and for-each select="//DCOM_TABLE/item"

    Your way prob. works too...

    Thanks for helps!

    Miska

IMN logo majestic logo threadwatch logo seochat tools logo