[xslt] libxslt-0.8 invalid node type complaint



I don't think this is a bug; I guess it comes of trying to treat a Result 
Tree Fragment as a node-set (I've used Saxon 6+ long enough to have stopped 
thinking about the difference).

Still, perhaps a clearer diagnostic, or a note in the docs would be useful.  
Even better would be a node-set() function...

Input:

<outline><o1><p>This</p></o1></outline>

Stylesheet:

<xsl:stylesheet version="1.0" 
  xmlns:xsl="http://www.w3.org/1999/XSL/Transform";>

<xsl:output method="xml" indent="no"/>

<xsl:variable name="nodes" select="/outline/o1"/>

<xsl:variable name="nths">
  <xsl:for-each select="$nodes">
    <nth id="{generate-id()}"><xsl:value-of select="position()"/></nth>
  </xsl:for-each>
</xsl:variable>

<xsl:template match="/">
  <xsl:apply-templates/>
</xsl:template>

<xsl:template match="outline">
  <xsl:apply-templates/>
</xsl:template>

<xsl:template match="o1">
  <xsl:call-template name="mk-title"/>
</xsl:template>

<xsl:template name="mk-title">
  <xsl:value-of select="$nths/nth[ id=generate-id(current())]"/>
</xsl:template>

</xsl:stylesheet>




[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]