DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT <http://nagoya.apache.org/bugzilla/show_bug.cgi?id=4506>. ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND INSERTED IN THE BUG DATABASE.
http://nagoya.apache.org/bugzilla/show_bug.cgi?id=4506 for-each processes idrefs infinitely Summary: for-each processes idrefs infinitely Product: XalanJ2 Version: 2.2.x Platform: PC OS/Version: Other Status: NEW Severity: Normal Priority: Other Component: Xalan AssignedTo: [EMAIL PROTECTED] ReportedBy: [EMAIL PROTECTED] The following example is from "XSLT" by Doug Tidwell (O'Reilly, 2001), chapter 5. It was executed on Windows 2000 Professional. The for-each below is not terminated, that is processing continues without end. <xsl:for-each select="id(@refids)"> <a href="#{@id}"> <xsl:choose> <xsl:when test="@xreftext"> <xsl:value-of select="@xreftext"/> </xsl:when> <xsl:otherwise> <xsl:value-of select="."/> </xsl:otherwise> </xsl:choose> </a> <xsl:if test="not(position()=last())"> <xsl:text>, </xsl:text> </xsl:if> </xsl:for-each> input xml file contents below (terms.xml): <?xml version="1.0" ?> <!DOCTYPE glossary SYSTEM "glossary.dtd"> <glossary> <glentry> <term id="applet">applet</term> <defn> An application program, written in the Java programming language, that can be retrieved from a Web server and executed by a Web browser. A reference to an applet appears in the markup for a Web page, in the same way that a reference to a graphics file appears; a browser retrieves an applet in the same way that it retrieves a graphics file. For security reasons, an applet's access rights are limited in two ways: the applet cannot access the file system of the client upon which it is executing, and the applet's communication across the network is limited to the server from which it was downloaded. Contrast with <xref refid="servlet"/>. <seealso refids="wildcard-char DMZlong pattern-matching"/> </defn> </glentry> <glentry> <term id="DMZlong" xreftext="demilitarized zone">demilitarized zone (DMZ)</term> <defn> In network security, a network that is isolated from, and serves as a neutral zone between, a trusted network (for example, a private intranet) and an untrusted network (for example, the Internet). One or more secure gateways usually control access to the DMZ from the trusted or the untrusted network. </defn> </glentry> <glentry> <term id="DMZ">DMZ</term> <defn> See <xref refid="DMZlong"/>. </defn> </glentry> <glentry> <term id="pattern-matching">pattern-matching character</term> <defn> A special character such as an asterisk (*) or a question mark (?) that can be used to represent one or more characters. Any character or set of characters can replace a pattern-matching character. </defn> </glentry> <glentry> <term id="servlet">servlet</term> <defn> An application program, written in the Java programming language, that is executed on a Web server. A reference to a servlet appears in the markup for a Web page, in the same way that a reference to a graphics file appears. The Web server executes the servlet and sends the results of the execution (if there are any) to the Web browser. Contrast with <xref refid="applet" />. </defn> </glentry> <glentry> <term id="wildcard-char">wildcard character</term> <defn> See <xref refid="pattern-matching"/>. </defn> </glentry> </glossary> xsl file contents below (crossref1.xsl): <?xml version="1.0"?> <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"> <xsl:output method="html" indent="yes"/> <xsl:strip-space elements="*"/> <xsl:template match="/"> <xsl:apply-templates select="glossary"/> </xsl:template> <xsl:template match="glossary"> <html> <head> <title> <xsl:text>Glossary Listing: </xsl:text> <xsl:value-of select="glentry[1]/term"/> <xsl:text> - </xsl:text> <xsl:value-of select="glentry[last()]/term"/> </title> </head> <body> <h1> <xsl:text>Glossary Listing: </xsl:text> <xsl:value-of select="glentry[1]/term"/> <xsl:text> - </xsl:text> <xsl:value-of select="glentry[last()]/term"/> </h1> <xsl:apply-templates select="glentry"/> </body> </html> </xsl:template> <xsl:template match="glentry"> <p> <b> <a name="{term/@id}"/> <xsl:value-of select="term"/> <xsl:text>: </xsl:text> </b> <xsl:apply-templates select="defn"/> </p> </xsl:template> <xsl:template match="defn"> <xsl:apply-templates select="*|comment()|processing-instruction()|text()"/> </xsl:template> <xsl:template match="xref"> <a href="#{@refid}"> <xsl:choose> <xsl:when test="id(@refid)/@xreftext"> <xsl:value-of select="id(@refid)/@xreftext"/> </xsl:when> <xsl:otherwise> <xsl:value-of select="id(@refid)"/> </xsl:otherwise> </xsl:choose> </a> </xsl:template> <xsl:template match="seealso"> <b> <xsl:text>See also: </xsl:text> </b> <xsl:for-each select="id(@refids)"> <a href="#{@id}"> <xsl:choose> <xsl:when test="@xreftext"> <xsl:value-of select="@xreftext"/> </xsl:when> <xsl:otherwise> <xsl:value-of select="."/> </xsl:otherwise> </xsl:choose> </a> <xsl:if test="not(position()=last())"> <xsl:text>, </xsl:text> </xsl:if> </xsl:for-each> <xsl:text>. </xsl:text> </xsl:template> </xsl:stylesheet> command line: java org.apache.xalan.xslt.Process -in terms.xml -xsl crossref1.xsl Results: <lan.xslt.Process -in terms.xml -xsl crossref1.xsl <html> <head> <META http-equiv="Content-Type" content="text/html; charset=UTF-8"> <title>Glossary Listing: applet - wildcard character</title> </head> <body> <h1>Glossary Listing: applet - wildcard character</h1> <p> <b><a name="applet"></a>applet: </b> An application program, written in the Java programming language, that can be retrieved from a Web server and executed by a Web browser. A reference to an applet appears in the markup for a Web page, in the same way that a reference to a graphics file appears; a browser retrieves an applet in the same way that it retrieves a graphics file. For security reasons, an applet's access rights are limited in two ways: the applet cannot access the file system of the client upon which it is executing, and the applet's communication across the network is limited to the server from which it was downloaded. Contrast with <a href="#servlet">servlet</a>. <b>See also: </b><a href="#DMZlong">demilitarized zone</a>, <a href="#wild card-char">wildcard character</a><a href="#wildcard-char">wildcard character</a> <a href="#wildcard-char">wildcard character</a><a href="#wildcard-char">wildcard character</a><a href="#wildcard-char">wildcard character</a><a href="#wildcard- char">wildcard character</a><a href="#wildcard-char">wildcard character</a><a hr ef="#wildcard-char">wildcard character</a><a href="#wildcard-char">wildcard char acter</a><a href="#wildcard-char">wildcard character</a><a href="#wildcard-char" >wildcard character</a><a href="#wildcard-char">wildcard character</a><a href="# wildcard-char">wildcard character</a><a href="#wildcard-char">wildcard character </a><a href="#wildcard-char">wildcard character</a><a href="#wildcard-char">wild card character</a><a href="#wildcard-char">wildcard character</a><a href="#wildc ard-char">wildcard character</a><a href="#wildcard-char">wildcard character</a>< a href="#wildcard-char">wildcard character</a><a href="#wildcard-char">wildcard character</a><a href="#wildcard-char">wildcard character</a><a href="#wildcard-c har">wildcard character</a><a href="#wildcard-char">wildcard character</a><a hre f="#wildcard-char">wildcard character</a><a href="#wildcard-char">wildcard chara cter</a><a href="#wildcard-char">wildcard character</a><a href="#wildcard-char"> wildcard character</a><a href="#wildcard-char">wildcard character</a><a href="#w ildcard-char">wildcard character</a><a href="#wildcard-char">wildcard character<...........
