You are viewing a plain text version of this content. The canonical link for it is here.
Posted to j-users@xalan.apache.org by Michael Hedenus <mh...@yahoo.de> on 2006/07/07 20:53:31 UTC

Grammar caching: bug extracted

Hello,

I'am Michael, I just changed my mail-address.

I have extracted the problem and tested with Xalan-J as it is bundled 
with Java 5.0 and Saxon. Here is the case...

The stylesheet:

<?xml version="1.0"?>
<xsl:stylesheet version="1.0" 
xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
    <xsl:output method="text"/>
    <xsl:template match="document">
        Data: <xsl:value-of select="unparsed-entity-uri(@data)"/>
        <xsl:apply-templates/>       
    </xsl:template>
    <xsl:template match="parent">
        Parent: <xsl:value-of select="."/>
        <xsl:if test="not(text()='nothing')">
        <xsl:apply-templates select="document(.)"/>
        </xsl:if>
    </xsl:template>
</xsl:stylesheet>

Three test documents: "doc1.xml", "doc2.xml", "doc3.xml"

<?xml version="1.0"?>
<!DOCTYPE document [
    <!NOTATION type PUBLIC "text/plain">
    <!ENTITY entity SYSTEM "data1" NDATA type>
    <!ELEMENT document (parent)>
    <!ATTLIST document data ENTITY #REQUIRED>
    <!ELEMENT parent (#PCDATA)>
]>
<document data="entity">
  <parent>doc2.xml</parent>
</document>


<?xml version="1.0"?>
<!DOCTYPE document [
    <!NOTATION type PUBLIC "text/plain">
    <!ENTITY entity SYSTEM "data2" NDATA type>
    <!ELEMENT document (parent)>
    <!ATTLIST document data ENTITY #REQUIRED>
    <!ELEMENT parent (#PCDATA)>
]>
<document data="entity">
  <parent>doc3.xml</parent>
</document>


<?xml version="1.0"?>
<!DOCTYPE document [
    <!NOTATION type PUBLIC "text/plain">
    <!ENTITY entity SYSTEM "data3" NDATA type>
    <!ELEMENT document (parent)>
    <!ATTLIST document data ENTITY #REQUIRED>
    <!ELEMENT parent (#PCDATA)>
]>
<document data="entity">
  <parent>nothing</parent>
</document>


Now transform the first document "doc1.xml" with the stylesheet.

Saxon behaves as one would expect it and the result is:
                Data: file:/D:/Michael/xslt/test/data1
                Parent: doc2.xml
                Data: file:/D:/Michael/xslt/test/data2
                Parent: doc3.xml
                Data: file:/D:/Michael/xslt/test/data3
                Parent: nothing

Here is the result of Xalan-J:
                Data: file:///D:/Michael/xslt/test/data1
                Parent: doc2.xml
                Data: file:///D:/Michael/xslt/test/data1
                Parent: doc3.xml
                Data: file:///D:/Michael/xslt/test/data1
                Parent: nothing

The result is always file:///D:/Michael/xslt/test/data**1**. Well, this 
is obviously a bug. I found that Xerces-C does Grammar caching, does 
Xerces-J caching, too? I found nothing about it, but my hope is that 
this solves the problem (I cannot wait for a bug-fix).

Greetings

Michael




	

	
		
___________________________________________________________ 
Gesendet von Yahoo! Mail - Jetzt mit 1GB Speicher kostenlos - Hier anmelden: http://mail.yahoo.de

Re: Grammar caching: bug extracted

Posted by Joseph Kesselman <ke...@us.ibm.com>.
My best guess is that this is simply a data retrieval bug (asking the wrong
document), not a "grammar caching" bug.

______________________________________
"... Three things see no end: A loop with exit code done wrong,
A semaphore untested, And the change that comes along. ..."
  -- "Threes" Rev 1.1 - Duane Elms / Leslie Fish
(http://www.ovff.org/pegasus/songs/threes-rev-11.html)


Re: Grammar caching: bug extracted

Posted by Michael Glavassevich <mr...@ca.ibm.com>.
Michael Hedenus <mh...@yahoo.de> wrote on 07/08/2006 08:45:49 AM:

> Hello Henry,
> > I tried your example and was able to reproduce the problem using XSLTC 

> > (the Xalan-J Compiling processor).  The Xalan-J Interpretive processor 

> > doesn't have the same problem.
> > 
> Fine! I am going to post a bug report... How do I tell Xalan not to use 
> XSLTC but to run in interpretive mode (using javax.xml.transform of 
JDK5.0)?

You should download a copy of Xalan 2.7.0. I'm fairly sure 
Xalan-Interpretive wasn't included in Sun's distribution of Java 5.
 
> Michael

Michael Glavassevich
XML Parser Development
IBM Toronto Lab
E-mail: mrglavas@ca.ibm.com
E-mail: mrglavas@apache.org


Re: Grammar caching: bug extracted

Posted by Michael Hedenus <mh...@yahoo.de>.
Hello Henry,
> I tried your example and was able to reproduce the problem using XSLTC 
> (the Xalan-J Compiling processor).  The Xalan-J Interpretive processor 
> doesn't have the same problem.
>   
Fine! I am going to post a bug report... How do I tell Xalan not to use 
XSLTC but to run in interpretive mode (using javax.xml.transform of JDK5.0)?

Michael



		
___________________________________________________________ 
Telefonate ohne weitere Kosten vom PC zum PC: http://messenger.yahoo.de

Re: Grammar caching: bug extracted

Posted by Henry Zongaro <zo...@ca.ibm.com>.
Hi, Michael.

Michael Hedenus <mh...@yahoo.de> wrote on 2006-07-07 02:53:31 PM:
> I have extracted the problem and tested with Xalan-J as it is bundled 
> with Java 5.0 and Saxon. Here is the case...

I tried your example and was able to reproduce the problem using XSLTC 
(the Xalan-J Compiling processor).  The Xalan-J Interpretive processor 
doesn't have the same problem.

Could I ask you to open a bug report in Jira?

Joseph Kesselman <ke...@us.ibm.com> wrote on 2006-07-07 03:01:25 PM:
> My best guess is that this is simply a data retrieval bug (asking the 
wrong
> document), not a "grammar caching" bug.

Agreed.

Thanks,

Henry
------------------------------------------------------------------
Henry Zongaro      XSLT Processors Development
IBM SWS Toronto Lab   T/L 969-6044;  Phone +1 905 413-6044
mailto:zongaro@ca.ibm.com