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

Process only nodes on a special axis

Subject: Process only nodes on a special axis
From: Marco Baumgartl <Marco.Baumgartl@xxxxxx>
Date: Tue, 15 Aug 2006 20:56:23 +0200
 Process only nodes on a special axis
Hi,

I have the following structure in my document:

<y-axis>
  <element>
    <key>1,985</key>
    <element>
      <key>Lichtausschnitt</key>
      <element>
        <key>li</key>
        <values>
          <value>
            <x>73,5</x>
            <y>7629</y>
          </value
        </values>
      </element>
      <element>
        <key>re</key>
        <values>
          <value>
            <x>81,0</x>
            <y>9282</y>
          </value
        </values>
      </element>
    </element>
    <element>
    ....
    </element>
  </element>
</y-axis>

Let the context node be element[parent::y-axis]. At this point I need to process only nodes on a special axis (I don't mean the XPath axes) to create some correct html output.

What I want/need is a XPath expression (or XSLT/XPath solution) that returns me only outermost nodes:
The element node with the key "Lichtausschnitt" and the element node with the key "li" but not the element node with the key "re".


This structure is created dynamically (elements can be of any depth) so I cannot use a fixed XPath expression. I tried to do this with a named template (which calls itself) but my problem is when I start calling it with

<xsl:call-template name="foobar">
  <xsl:with-param name="nodeSet" select="element[1]" />
</xsl:call-template>

I get the the complete element with the key "Lichtausschnitt" but I only want it with the child element with the key "li".

I hope that I could make my problem plain to you and you can give me a method of resolution.


Thanks in advance.



regards Marco

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-2011 All Rights Reserved.