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

Re: Process only nodes on a special axis

Subject: Re: Process only nodes on a special axis
From: Wendell Piez <wapiez@xxxxxxxxxxxxxxxx>
Date: Tue, 15 Aug 2006 16:15:08 -0400
Re:  Process only nodes on a special axis
Marco,

I'm unsure by what criteria you are determining what is an "outermost" element. The expression //element[not(preceding-sibling::element)] would get you the elements with keys 'Lichtausschnitt' and 'li' but not 're', but it would also get you '1,985', and it's not clear from your example why this one wouldn't (or would) be "outermost".

Clarify this and I'm sure someone will be able to help.

Cheers,
Wendell

At 02:56 PM 8/15/2006, you wrote:
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-2013 All Rights Reserved.