xsl-list
[Top] [All Lists]

Re: [xsl] Passing xml nodes to a function

2006-08-10 09:00:23

 This is the complete XML.

The code that I posted last time works on that for me:

<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform";>

<xsl:output indent="yes"/>
  <xsl:template match="/">
        <table style="position:relative; left:30px;">
                        
                    <xsl:apply-templates select=".//response/*/response/*" 
mode="table"/>
                </table>
  </xsl:template>

                   <xsl:template match="*" mode="table">
                     <tr>
                       <td><xsl:value-of select="name()"/></td>
                       <xsl:if test="not(*)"><td><xsl:value-of 
select="."/></td></xsl:if>
                     </tr>
<xsl:apply-templates mode="table" select="*"/>
                  </xsl:template>
                

</xsl:stylesheet>



$ saxon resp.xml resp.xsl
<?xml version="1.0" encoding="utf-8"?>
<table style="position:relative; left:30px;">
   <tr>
      <td>client</td>
   </tr>
   <tr>
      <td>welcomeName</td>
      <td>Joe</td>
   </tr>
   <tr>
      <td>title</td>
      <td>Mrs</td>
   </tr>
   <tr>
      <td>name</td>
   </tr>
   <tr>
      <td>firstName</td>
      <td>JEANETTE</td>
   </tr>
   <tr>
      <td>surname</td>
      <td>CHANDLER</td>
   </tr>

--~------------------------------------------------------------------
XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
or e-mail: <mailto:xsl-list-unsubscribe(_at_)lists(_dot_)mulberrytech(_dot_)com>
--~--

<Prev in Thread] Current Thread [Next in Thread>