Change:

<xsl:apply-templates select="//member[not(//following-sibling::member/child
::state = child::state)]" >

...to....

<xsl:apply-templates select="//member[not(following-sibling::member/child
::state = child::state)]" >

It certainly appears that you've created some type of circular reference
with the //following-sibling notation.

Also, you might wish to use the xalan:distinct (or exslt:distinct) extension
function, if platform-neutrality isn't important, as it is MUCH more
efficient in extracting distinct node values.

================

<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform";
version="1.0" xmlns:xalan="http://xml.apache.org/xalan";
exclude-result-prefixes="xalan">
  <xsl:output method="html" media-type="text/html"/>

  <xsl:template match="/">
    <html>
      <head>
        <title>
          <xsl:value-of select="/ushousemembers/metadata/congress" />,
          <xsl:value-of select="/ushousemembers/metadata/compiler" />,
          <xsl:value-of select="/ushousemembers/metadata/date" />
        </title>
        <link href="http://cscie153.dce.harvard.edu/css/congress .css"
type="text/css" rel=
"stylesheet" />
      </head>
      <body>
        <h1>
          <xsl:value-of select="/ushousemembers/metadata/congress" />,
          <xsl:value-of select="/ushousemembers/metadata/date" />
        </h1>

        <xsl:for-each select="xalan:distinct(//member/state)">
              [<xsl:value-of select="." />]<br />
        </xsl:for-each>

      </body>
    </html>
  </xsl:template>

</xsl:stylesheet>

================

Rick Bullotta
CTO
Lighthammer Software (www.lighthammer.com)


-----Original Message-----
From: [EMAIL PROTECTED] [mailto:bugzilla@;apache.org]
Sent: Thursday, October 31, 2002 8:46 AM
To: [EMAIL PROTECTED]
Subject: DO NOT REPLY [Bug 14126] New: - Xalan hangs forever given this
input


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=14126>.
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=14126

Xalan hangs forever given this input

           Summary: Xalan hangs forever given this input
           Product: XalanJ2
           Version: 2.4
          Platform: All
        OS/Version: All
            Status: NEW
          Severity: Major
          Priority: Other
         Component: Xalan
        AssignedTo: [EMAIL PROTECTED]
        ReportedBy: [EMAIL PROTECTED]


If you run

java org.apache.xalan.xslt.Process -in
http://xml.house.gov/Members/mbr107.xml -xsl
hang.xsl

it prints the following, then hangs forever:

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/
TR/html4/strict. dtd">
<html>
<head>
<title>One Hundred Seventh Congress,
          Jeff Trandahl, Clerk of the House of Representatives,
          July 24, 2002</title>
<link rel="stylesheet" type="text/css"
href="http://cscie153.dce.harvard.edu/css/congress
.css" />
</head>
<body>
<h1>One Hundred Seventh Congress,

Here is hang.xsl :

<?xml version="1.0"?>

<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform";
version="1.0">
  <xsl:output method="xml"
              doctype-public="-//W3C//DTD XHTML 1.0 Transitional//EN"
              doctype-system="http://www.w3.org/TR/html4/strict. dtd"
              indent="yes" />

  <xsl:template match="/">
    <html>
      <head>
        <title>
          <xsl:value-of select="/ushousemembers/metadata/congress" />,
          <xsl:value-of select="/ushousemembers/metadata/compiler" />,
          <xsl:value-of select="/ushousemembers/metadata/date" />
        </title>
        <link href="http://cscie153.dce.harvard.edu/css/congress .css"
type="text/css" rel=
"stylesheet" />
      </head>
      <body>
        <h1>
          <xsl:value-of select="/ushousemembers/metadata/congress" />,
          <xsl:value-of select="/ushousemembers/metadata/date" />
        </h1>

        <xsl:apply-templates
select="//member[not(//following-sibling::member/child ::state =
child::state)]" >
        </xsl:apply-templates>

      </body>
    </html>
  </xsl:template>

  <xsl:template match="member">
      [<xsl:value-of select="child::state" />]<br />
  </xsl:template>

</xsl:stylesheet>

Reply via email to