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

Templatized processing

Subject: Templatized processing
From: owner-xsl-list@xxxxxxxxxxxxxxxxxxxxxx (by way of MulberryTechnologies List Owner)
Date: Tue, 28 Aug 2001 11:48:24 -0400
subseted
From: "Larry Mason" <larry.mason@xxxxxx>
To: <XSL-List@xxxxxxxxxxxxxxxxxxxxxx>
Subject: Templatized processing
Date: Tue, 28 Aug 2001 08:39:21 -0500

I would like to process my XML document in a subseted, user driven mode. =
 Given the following raw data
<data>
<record id=3D"1"><field1>field 1</field1><field2>field =
2</field2><field3> field 3</field3><field4> field 4</field4></record>
<record id=3D"2"><field1> field 1</field1><field2> field =
2</field2><field3> field 3</field3><field4> field 4</field4></record>
</data>

I would like to define a user "view" as such (format of next snippet is =
open to change)
<displayorder>
<field>field3</field>
<field>field2</field>
</displayorder>
which would extract only fields 3 and 2 and in that order vs document =
order.

Here are my attempts.
  <xsl:template match=3D"record">
    <TR><TD nowrap=3D"yes">record id=3D<xsl:value-of =
select=3D"@id"/></TD></TR>
    <TR><TD nowrap=3D"yes">brute force method</TD>
    <xsl:apply-templates =
select=3D"*[local-name()=3Dxt:node-set(document($customFile)/displayorder=
/field)[1]]"/>
    <xsl:apply-templates =
select=3D"*[local-name()=3Dxt:node-set(document($customFile)/displayorder=
/field)[2]]"/>
    <xsl:apply-templates =
select=3D"*[local-name()=3Dxt:node-set(document($customFile)/displayorder=
/field)[3]]"/>
    </TR>
    <TR><TD nowrap=3D"yes">subseted but in document order</TD>
    <xsl:apply-templates =
select=3D"*[local-name()=3Dxt:node-set(document($customFile)/displayorder=
/field)]"/>
    </TR>
    <TR><TD nowrap=3D"yes">not working at all</TD>
    <xsl:for-each =
select=3D"xt:node-set(document($customFile)/displayorder/field)">
need help here.  I have trouble getting to the proper context
    </xsl:for-each>
    </TR>
   </xsl:template>
  <xsl:template match=3D"record/*">
    <TD nowrap=3D"yes"><xsl:value-of select=3D"."/></TD>
  </xsl:template>
=20
Next would be to make fewer calls to document !
TIA,
Larry Mason


 XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list


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.