xsl-list
[Top] [All Lists]

RE: XML to Table

2004-04-16 11:12:57
-----Original Message-----
From: Veronica Sanchez [mailto:vsguiseris(_at_)hotmail(_dot_)com]


Hi,

The question is that i have problems with the first step, the xsl is too
slow and i can't create the node that doesn't exist in the row and that I
want to visualize.


Try this:

<xsl:stylesheet ..>

<xsl:template match="/">
  <xsl:copy>
    <xsl:apply-templates select="ROWSET/ROW" />
  </xsl:copy>
</xsl:template>

<xsl:template match="ROW">
  <xsl:apply-templates select="../../DETAIL">
    <xsl:with-param name="prow" select="current()/@num">
  </xsl:apply-templates>
</xsl:template>

<xsl:template match="DETAIL">
  <xsl:param name="prow" select="0" />

  <xsl:for-each select="COLUMN">
    <xsl:element name="{current()/@name}">
       <xsl:value-of select="/XML/ROWSET/ROW[$prow]/*[
              name()=current()/@name]" />
    </xsl:element>
  </xsl:for-each>
</xsl:template>

I can change the structure of <DETAIL></DETAIL> if it would be necessary.

Nope. I don't think that's necessary. The trick in the above is that when
the xsl:value-of returns nothing, an empty node is created, so there is no
need for the xsl:choose.



If it's possible i would prefer the use of one only xml. can I do it?


Thanks to all.

_________________________________________________________________
Correos más divertidos con fotos y textos increíbles en MSN 8. Pruébalo
gratis dos meses. http://join.msn.com/?pgmarket=es-es&XAPID=45&DI=1055


--+------------------------------------------------------------------
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>