Может ли кто-нибудь помочь мне понять, почему этот блок кода вызывает преждевременную ошибку конца файла xml?
<cfxml variable="xslt">
<xsl:transform version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<!--- Start by matching the root node. --->
<xsl:template match="/nodes">
<nodes>
<!---
Inside our new root node, output all the top-
level NODE elements (ie. those with a parentID
value of zero).
--->
<xsl:call-template name="getChildNodes" />
</nodes>
</xsl:template>
<!--- This function outputs all child node elemenst of the node with the given ID. --->
<xsl:template name="getChildNodes">
<!--- Param our parent ID. --->
<xsl:param name="parentID" select="0" />
<!--- Select all the child node elements that have the given parentID. --->
<xsl:for-each select="//node[@parent-id=$parentID]">
<!--- Sort this node list on ID. --->
<xsl:sort select="@id" />
<!--- Output the new node. --->
<node id="{@id}" parent-id="{@parent-id}" name="{@name}">
<!---
Now that are outputting a given node, let's
output all the child nodes that might be a
descendant of it.
NOTE: This is the recursive aspect of this
XSTL approach.
--->
<xsl:call-template name="getChildNodes">
<xsl:with-param name="parentID" select="@id"/>
</xsl:call-template>
</node>
</xsl:for-each>
</xsl:template>
</xsl:transform>
</cfxml>
сегмент выше является частью этой полной функции:
<cffunction name="xmlNav" access="private" returntype="struct" output="false">
<cfargument name="qGetNav" type="query" required="true">
<cfset var qNav = arguments.qGetNav>
<cfset var rawNodeTree="">
<cfset var xslt="">
<cfxml variable="rawNodeTree">
<cfoutput>
<nodes>
<cfloop query="qNav">
<node id="#qNav.navid#" parent-id="#qNav.navparentID#" name="#qNav.TextDesc#"/>
</cfloop>
</nodes>
</cfoutput>
</cfxml>
<cfxml variable="xslt">
<xsl:transform version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<!--- Start by matching the root node. --->
<xsl:template match="/nodes">
<nodes>
<!---
Inside our new root node, output all the top-
level NODE elements (ie. those with a parentID
value of zero).
--->
<xsl:call-template name="getChildNodes" />
</nodes>
</xsl:template>
<!--- This function outputs all child node elemenst of the node with the given ID. --->
<xsl:template name="getChildNodes">
<!--- Param our parent ID. --->
<xsl:param name="parentID" select="0" />
<!--- Select all the child node elements that have the given parentID. --->
<xsl:for-each select="//node[@parent-id=$parentID]">
<!--- Sort this node list on ID. --->
<xsl:sort select="@id" />
<!--- Output the new node. --->
<node id="{@id}" parent-id="{@parent-id}" name="{@name}">
<!---
Now that are outputting a given node, let's
output all the child nodes that might be a
descendant of it.
NOTE: This is the recursive aspect of this
XSTL approach.
--->
<xsl:call-template name="getChildNodes">
<xsl:with-param name="parentID" select="@id"/>
</xsl:call-template>
</node>
</xsl:for-each>
</xsl:template>
</xsl:transform>
</cfxml>
<cfset myXmlNav.xmlNav=rawNodeTree>
<cfset myXmlNav.IsXml=IsXML(myXmlNav.xmlNav)>
<cfreturn myXmlNav>
</cffunction>
Я подтвердил, что могу запустить его отдельно от cfc