Home. 
.

transparent

transparent

transparent

Altova Mailing List Archives


[xsl] Conditional in-context nodeset variables

From: "Vyacheslav Sedov" <vyacheslav.sedov@--------->
To:
Date: 1/3/2008 3:32:00 PM
have problem

for example (as input any valid XHTML)
and context is first h1 node


        <xsl:variable name="level1" select="following-sibling::h1[1]"/>
        <xsl:variable name="level2" select="following-sibling::h2[1]"/>

        <xsl:variable name="next-stop">
            <xsl:choose>
                <xsl:when test="not($level1 and $level2)">
                    <xsl:sequence select="following-sibling::*[last()]"/>
                </xsl:when>
                <xsl:when test="$level1 &lt;&lt; $level2">
                    <xsl:sequence select="$level1"/>
                </xsl:when>
                <xsl:otherwise>
                    <xsl:sequence select="$level2"/>
                </xsl:otherwise>
            </xsl:choose>
        </xsl:variable>

<xsl:apply-templates select="following-sibling::*[. &lt;&lt $next-stop]"/>

$level1 and $leve2 contain links to live in-context node
but variable $next-stop contain copy (not reference to node) of level1
or level2 variable
and even following-sibling::*[last()] provide just copy instead of
in-context nodeset
so << not work as expected :(

regards,
Slav


transparent
Print
Mail
Like It
Disclaimer
.

These Archives are provided for informational purposes only and have been generated directly from the Altova mailing list archive system and are comprised of the lists set forth on www.altova.com/list/index.html. Therefore, Altova does not warrant or guarantee the accuracy, reliability, completeness, usefulness, non-infringement of intellectual property rights, or quality of any content on the Altova Mailing List Archive(s), regardless of who originates that content. You expressly understand and agree that you bear all risks associated with using or relying on that content. Altova will not be liable or responsible in any way for any content posted including, but not limited to, any errors or omissions in content, or for any losses or damage of any kind incurred as a result of the use of or reliance on any content. This disclaimer and limitation on liability is in addition to the disclaimers and limitations contained in the Website Terms of Use and elsewhere on the site.

.
.

transparent

transparent