[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

RE: XML to Table

Subject: RE: XML to Table
From: "Andreas L. Delmelle" <a_l.delmelle@xxxxxxxxxx>
Date: Fri, 16 Apr 2004 20:12:57 +0200
xml to table
> -----Original Message-----
> From: Veronica Sanchez [mailto:vsguiseris@xxxxxxxxxxx]
>

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 mas divertidos con fotos y textos incrembles en MSN 8. Pruibalo
> gratis dos meses. http://join.msn.com/?pgmarket=es-es&XAPID=45&DI=1055

Current Thread

PURCHASE STYLUS STUDIO ONLINE TODAY!

Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
Email
First Name
Last Name
Company
Subscribe in XML format
RSS 2.0
Atom 0.3
Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery ™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2013 All Rights Reserved.