[XSL-LIST Mailing List Archive Home] [By Thread] [By Date]

[xsl] XPath syntax error problem

Subject: [xsl] XPath syntax error problem
From: Kenneth Stephen <marvin.the.cynical.robot@xxxxxxxxx>
Date: Fri, 21 Jan 2005 19:32:58 -0600


    I have the following template in my XSL :

	<xsl:template match="xsd:element">
		<xsl:variable name="elementName" select="@name" />
		<xsl:if test="count(//*[substring-after(@ref,':') = $elementName] = 0">
			<xsl:if test="count(@name) = 1">
				<xsl:if test="/xsd:schema/@elementFormDefault = 'qualified'">
					<xsl:value-of select="concat($prefix,':')" />
				<xsl:value-of select="@name" />

    On execution, Saxon (and Xalan too) complain about a syntax error
on the outermost "xsl:if" . The Saxon error is shown below :

bash-2.05b$ java net.sf.saxon.Transform ../data/Metadata_0101.xsd
Error at xsl:if on line 24 of
  XPath syntax error in {...(@ref,':') = $elementName] ...}:
    expected ")", found "<eof>"
Transformation failed: Failed to compile stylesheet. 1 error detected.

    What am I doing wrong? What I want to do is find out if the value
of the "name" attribute on an xsd:element in the input occurs within a
"ref" attribute elsewhere in my XML Schema file.


Current Thread