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 "Hedenus, Michael (EXT)" <Mi...@siemensvdo.com> on 2006/07/07 15:52:38 UTC

RE: Grammar caching

Hallo Joseph,

thank you for reply.

I have different documents with the following structure:

DOCTYPE document [
<!ENTITY entity "http://..." NDATA type>
]

<document data="entity">...
  <parent>http://parent-uri</parent>
</document>

Each document has a different entity defined.

Within the the stylesheet I have something in form of the following:


<xsl:template match="document">
	<xsl:value-of select="unparsed-entity-uri(@data)"/>
</xsl:template>

<xsl:template match="parent">
	<xsl:apply-templates select="document(parent)"/>
</xsl:template>


i.e. If the transformer matches the <parent> element, the parent
document is opened and the transformer continues the to transform the
data contained by the parent document (i.e. the documents are linked
together in form of a tree and the tree is traversed recursively to the
root).

This works fine BUT <xsl:value-of select="unparsed-entity-uri(@data)"/>
returns ALWAYS the entity of the FIRST document. Obviously the
transformer is aware of the definition of the entity but it does not
recognize the redefinition of the entity of the newly opened document.

Xerces-C has a feature called grammer caching and this would nicely
explain my problem because according to the documenation of this feature
the grammars of all documents would be the same (because they are only
internal DTDs with the same root element <document>). If caching is not
the explenation, there seems to be a subtle bug.

Hope my problem is clear now and please apologize my bad English :>

Michael



-----Original Message-----
From: Joseph Kesselman [mailto:keshlam@us.ibm.com] 
Sent: Friday, July 07, 2006 3:29 PM
To: xalan-j-users@xml.apache.org
Subject: Re: Grammar chaching

XSLT is barely aware of DTDs. What's the actual symptom you're seeing,
and
why do you think it has something to do with the DTD?

______________________________________
"... 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

Posted by David Bertoni <db...@apache.org>.
Hedenus, Michael (EXT) wrote:
> Hallo Joseph,
> 
> 
> Xerces-C has a feature called grammer caching and this would nicely
> explain my problem because according to the documenation of this feature
> the grammars of all documents would be the same (because they are only
> internal DTDs with the same root element <document>). If caching is not
> the explenation, there seems to be a subtle bug.
> 

Are you really using Xalan-J, or are you using Xalan-C?  If you're using Xalan-C, then you're asking on the wrong list. 
  If you're using Xalan-J, I'm confused as to why you are quoting Xerces-C documentation, since you would be using 
Xerces-J, not Xerces-C.

Dave


RE: Grammar caching

Posted by Joseph Kesselman <ke...@us.ibm.com>.
Just to clarify: Are you using Xalan-J or Xalan-C? (You're posting to the
Java mailing list, but you mentioned an option on the C++ version of
Xerces...)

This could well be a bug in Xalan; I don't think we currently have a
testcase which exercises that detail of the spec. I'd suggest posting this
as an official bug report.

______________________________________
"... 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)