xml-xalan-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From xalan-...@xml.apache.org
Subject [jira] Updated: (XALANJ-1685) Redirect produces duplicate document type declaration
Date Sun, 05 Sep 2004 01:08:37 GMT
The following issue has been updated:

    Updater: Brian Minchau (mailto:minchau@ca.ibm.com)
       Date: Sat, 4 Sep 2004 6:07 PM
    Changes:
             assignee changed from Xalan Developers Mailing List
             description changed from Input XML:

<?xml version="1.0" encoding="UTF-8"?>
<site-map>
  <pages>
    <page>
      <id>page-1</id>
    </page>
    <page>
      <id>page-2</id>
    </page>
  </pages>
</site-map>

XSLT:

<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet version="1.0"
                xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
                xmlns:redirect="http://xml.apache.org/xalan/redirect"
                extension-element-prefixes="redirect">
    
  <xsl:output
     method="html"
     version="4.01"
     indent="yes"
     encoding="UTF-8"
     doctype-system="http://www.w3.org/TR/html4/strict.dtd"
     doctype-public="-//W3C//DTD HTML 4.01//EN"
  />
  
  <xsl:template match="/">
    <xsl:apply-templates select="//page"/>
  </xsl:template>
  
  <xsl:template match="page">
    <redirect:write select="concat(id, '.html')">
      <HTML lang="en">
        <BODY>
          <xsl:value-of select="id"/>
        </BODY>
      </HTML>
    </redirect:write>
  </xsl:template>

</xsl:stylesheet>

Produces these output files:

cat page-1.html 
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"
"http://www.w3.org/TR/html4/strict.dtd">
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"
"http://www.w3.org/TR/html4/strict.dtd">
<HTML lang="en">
<BODY>page-1</BODY>
</HTML>

cat page-2.html 
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"
"http://www.w3.org/TR/html4/strict.dtd">
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"
"http://www.w3.org/TR/html4/strict.dtd">
<HTML lang="en">
<BODY>page-2</BODY>
</HTML>

Note the two doctype tags.

This bug seems to of appeared between Xalan versions 2.4.1 and 2.5.1.

I'm working round the bug at the moment by passing the output through sed to
remove the first line. to Input XML:

<?xml version="1.0" encoding="UTF-8"?>
<site-map>
  <pages>
    <page>
      <id>page-1</id>
    </page>
    <page>
      <id>page-2</id>
    </page>
  </pages>
</site-map>

XSLT:

<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet version="1.0"
                xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
                xmlns:redirect="http://xml.apache.org/xalan/redirect"
                extension-element-prefixes="redirect">
    
  <xsl:output
     method="html"
     version="4.01"
     indent="yes"
     encoding="UTF-8"
     doctype-system="http://www.w3.org/TR/html4/strict.dtd"
     doctype-public="-//W3C//DTD HTML 4.01//EN"
  />
  
  <xsl:template match="/">
    <xsl:apply-templates select="//page"/>
  </xsl:template>
  
  <xsl:template match="page">
    <redirect:write select="concat(id, '.html')">
      <HTML lang="en">
        <BODY>
          <xsl:value-of select="id"/>
        </BODY>
      </HTML>
    </redirect:write>
  </xsl:template>

</xsl:stylesheet>

Produces these output files:

cat page-1.html 
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"
"http://www.w3.org/TR/html4/strict.dtd">
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"
"http://www.w3.org/TR/html4/strict.dtd">
<HTML lang="en">
<BODY>page-1</BODY>
</HTML>

cat page-2.html 
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"
"http://www.w3.org/TR/html4/strict.dtd">
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"
"http://www.w3.org/TR/html4/strict.dtd">
<HTML lang="en">
<BODY>page-2</BODY>
</HTML>

Note the two doctype tags.

This bug seems to of appeared between Xalan versions 2.4.1 and 2.5.1.

I'm working round the bug at the moment by passing the output through sed to
remove the first line.
             environment changed from Operating System: Linux
Platform: PC to Operating System: Linux
Platform: PC
             priority changed to Blocker
             Component changed to Xalan extensions
             Component changed from Xalan-interpretive transformation
    ---------------------------------------------------------------------
For a full history of the issue, see:

  http://issues.apache.org/jira/browse/XALANJ-1685?page=history

---------------------------------------------------------------------
View the issue:
  http://issues.apache.org/jira/browse/XALANJ-1685

Here is an overview of the issue:
---------------------------------------------------------------------
        Key: XALANJ-1685
    Summary: Redirect produces duplicate document type declaration
       Type: Bug

     Status: Unassigned
   Priority: Blocker

    Project: XalanJ2
 Components: 
             Xalan extensions
   Versions:
             2.5

   Assignee: 
   Reporter: Matthew Haas

    Created: Tue, 14 Oct 2003 4:10 PM
    Updated: Sat, 4 Sep 2004 6:07 PM
Environment: Operating System: Linux
Platform: PC

Description:
Input XML:

<?xml version="1.0" encoding="UTF-8"?>
<site-map>
  <pages>
    <page>
      <id>page-1</id>
    </page>
    <page>
      <id>page-2</id>
    </page>
  </pages>
</site-map>

XSLT:

<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet version="1.0"
                xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
                xmlns:redirect="http://xml.apache.org/xalan/redirect"
                extension-element-prefixes="redirect">
    
  <xsl:output
     method="html"
     version="4.01"
     indent="yes"
     encoding="UTF-8"
     doctype-system="http://www.w3.org/TR/html4/strict.dtd"
     doctype-public="-//W3C//DTD HTML 4.01//EN"
  />
  
  <xsl:template match="/">
    <xsl:apply-templates select="//page"/>
  </xsl:template>
  
  <xsl:template match="page">
    <redirect:write select="concat(id, '.html')">
      <HTML lang="en">
        <BODY>
          <xsl:value-of select="id"/>
        </BODY>
      </HTML>
    </redirect:write>
  </xsl:template>

</xsl:stylesheet>

Produces these output files:

cat page-1.html 
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"
"http://www.w3.org/TR/html4/strict.dtd">
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"
"http://www.w3.org/TR/html4/strict.dtd">
<HTML lang="en">
<BODY>page-1</BODY>
</HTML>

cat page-2.html 
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"
"http://www.w3.org/TR/html4/strict.dtd">
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"
"http://www.w3.org/TR/html4/strict.dtd">
<HTML lang="en">
<BODY>page-2</BODY>
</HTML>

Note the two doctype tags.

This bug seems to of appeared between Xalan versions 2.4.1 and 2.5.1.

I'm working round the bug at the moment by passing the output through sed to
remove the first line.


---------------------------------------------------------------------
JIRA INFORMATION:
This message is automatically generated by JIRA.

If you think it was sent incorrectly contact one of the administrators:
   http://issues.apache.org/jira/secure/Administrators.jspa

If you want more information on JIRA, or have a bug to report see:
   http://www.atlassian.com/software/jira


---------------------------------------------------------------------
To unsubscribe, e-mail: xalan-dev-unsubscribe@xml.apache.org
For additional commands, e-mail: xalan-dev-help@xml.apache.org


Mime
View raw message