xsl-list
[Top] [All Lists]

[xsl] Process only nodes on a special axis

2006-08-15 11:56:46
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


--~------------------------------------------------------------------
XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
or e-mail: <mailto:xsl-list-unsubscribe(_at_)lists(_dot_)mulberrytech(_dot_)com>
--~--

<Prev in Thread] Current Thread [Next in Thread>