You are viewing a plain text version of this content. The canonical link for it is here.
Posted to j-users@xalan.apache.org by Jing Yang <jy...@jbmanagement.com> on 2006/12/14 23:01:37 UTC

attribute out of element (compiler warning in XSLTC Xalan-j- 2-7-0)

OK with interpretive processor.

But using XSLTC(Xalan-j-2-7-0)  with  following  xml and  xsl.
It  did't  complete job and got  error as below:

Compiler warnings:
  file:///C:/Testing/TestXSLTC/sample.xsl: line 11: Attribute 'settype'
outside of element.
  file:///C:/Testing/TestXSLTC/sample.xsl: line 12: Attribute 'setid'
outside of element.


----------------------------------------------------------------------------
-------------------
<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform" >
<xsl:template match="/">
<xsl:for-each select="//country">
<xsl:choose>
<xsl:when test="@name">
<xsl:element name="AAAA">
<xsl:for-each select=".">
   <xsl:attribute name="option"><xsl:value-of select="."/></xsl:attribute>
</xsl:for-each>
<xsl:attribute name="settype"><xsl:text>columnar</xsl:text></xsl:attribute>
<xsl:attribute name="setid"><xsl:value-of select="*"/></xsl:attribute>
   </xsl:element>
   </xsl:when>
</xsl:choose>
   </xsl:for-each>
</xsl:template>
</xsl:stylesheet>

----------------------------------------------------------------------------
---------------------------
<?xml version="1.0" encoding="UTF-8"?>
<countries>
    <country name="France"/>
    <country name="USA" selected="yes"/>
      <country name="USSA"/>

</countries>