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:[EMAIL PROTECTED] 
Sent: Friday, July 07, 2006 3:29 PM
To: [email protected]
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)

Reply via email to