You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@xalan.apache.org by Craig Jardine <ja...@dcs.gla.ac.uk> on 2000/07/19 22:32:06 UTC

xalan apply-templates problem

Hi folk's, i was advised to try here for some advice about my stylesheet.

OK. Here's the problem:

I've got a simple Java program which inputs xml files and uses xalan to
query them. It seems to work fine, except when the stylesheet contains more
than one template. The is example is straight out the professional XML book:

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

<xsl:template match="/Catalog">
	<xsl:copy>
		<xsl:for-each select="//Book[Authors/Author='Alex Homer']">
			<xsl:copy>
				<xsl:apply-templates name="childnodes" /> 
			</xsl:copy>
		</xsl:for-each>
	</xsl:copy>
</xsl:template>

<xsl:template name="childnodes" match="*">
	<xsl:copy>
		<xsl:apply-templates name="childnodes" /> 
	</xsl:copy>
</xsl:template>

</xsl:stylesheet>

The error is:

XSL Error: xsl:apply-templates has an illegal attribute: name, Location
file:/C:/WINNT/Profiles/jardinec/Desktop/project/xml-xsl/RowWise.xsl, line
6, offset 57
XSL Error: Could not parse
C:\WINNT\Profiles\jardinec\Desktop\project\xml-xsl\RowWise.xsl document!,
Location
file:/C:/WINNT/Profiles/jardinec/Desktop/project/xml-xsl/RowWise.xsl, line
6, offset 57
org.apache.xalan.xslt.XSLProcessorException: 
	at org.apache.xalan.xslt.XSLTEngineImpl.error(XSLTEngineImpl.java:1630)
	at
org.apache.xalan.xslt.XSLTEngineImpl.processStylesheet(XSLTEngineImpl.java:7
22)
	at RunQuery.<init>(RunQuery.java:42)
	at setToolBarContents.actionPerformed(setToolBarContents.java:115)
	at javax.swing.AbstractButton.fireActionPerformed(AbstractButton.java:1066)
		etc.....

any clues?

thank's Craig.