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

Re: Convert apply-templates to call-template?

Subject: Re: Convert apply-templates to call-template?
From: Phillip B Oldham <phillip.oldham@xxxxxxxxxx>
Date: Tue, 31 Jan 2006 08:29:43 +0000
apply templates call template
You'd need to say what the problem you were having, and what exactly you
meant bu using call-tempate. You need to somehow traverse the input tree
in order to get the input, apply-templates does that, call-template does
not, the current node never changes on a call-template.



Ah, I didn't know that.


Your question could be trivially answered by having a named template
that you call with call-template, that just uses apply-templates to
traverse the tree.



Thats exactly what I'm looking for.


The app I'm using returns a very basic XML tree based on the request URL. Most of the time the main section of the document, the part that requires translation, is a nodeset showing the url as an attribute, containing lots of <item> tags which in turn contain what is essentially RDBMS row data, eg:

<container url="/Departments/ViewAll">
   <item>
      <id>1</id>
      <name>Managers</name>
      <lh>1</lh>
      <rh>6</rh>
   </item>
   <item>
      <id>2</id>
      <name>Supervisors</name>
      <lh>2</lh>
      <rh>5</rh>
   </item>
   <item>
      <id>3</id>
      <name>Employees</name>
      <lh>3</lh>
      <rh>4</rh>
   </item>
   <item>
      <id>4</id>
      <name>Directors</name>
      <lh>7</lh>
      <rh>8</rh>
   </item>
</container>

The data in the item tags changes dependent on the URL, but basically they always output <item> tags.

I'm currently passing the item nodeset to a template using <xsl:call-template /> based on the url, which is working fine for other parts of the system. The Celko technique is being used to store a BTree in SQL, which I need to reproduce based on the lh and rh tags.

I don't think <xsl:apply-templates /> will work, because I can't match the <item> tag as there are other parts of the app which use it.

Any advice would be great.

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.