You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@xalan.apache.org by "Chris P. McCabe" <ch...@choicehotels.com> on 2001/02/07 00:55:11 UTC

Xalan-J2.0.0 bug

I have isolated a bug that causes an exception in the transformer for
Xalan-J2.0.0 (released version), but worked fine for J1.  Below is the
stripped down input xml and stylesheet to reproduce the problem.  The
line in the stylesheet that causes the exception is when it tries to
reference a non-existent attribute on an element
($hotelnode/location/@country).
  Let me know if you need more info.

Chris

XML
-------------------
<standard-page>
   <page-contents>
      <availability>
         <hotel>
            <location city="Seattle" state="WA"/>
         </hotel>
      </availability>
   </page-contents>
</standard-page>



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

   <xsl:output method="html" indent="yes"/>

   <xsl:template match="/standard-page">
      <html>
      <xsl:call-template name="BrandHeader">
         <xsl:with-param name="hotelnode"
            select="/standard-page/page-contents/availability/hotel"/>
      </xsl:call-template>
      </html>
   </xsl:template>

   <xsl:template name="BrandHeader">
      <xsl:param name="hotelnode"/>

      <!-- ***** The following causes the exception *** -->
      <xsl:value-of select="$hotelnode/location/@country"/>

   </xsl:template>

</xsl:stylesheet>