Re: Howto implement a node index extension to be shared across transform invocations on the same source document (DOMSource)

Michael Ludwig <[email protected]>
Newsgroups gmane.text.xml.xalan.java.user
Message-ID <[email protected]>
Christoffer Dam Bruun schrieb:

> I have a webapplication  where I hold a large XML tree in memory.  On
> this tree I perform several transforms as response to user requests.
> Each transform declares a <xsl:key> that serves as an index for
> important nodes in the tree.
>
> However, it is expensive to calculate this key and it should be
> possible to reuse it since I know that the source tree has not been
> modified.

Could XSLTC (which I don't have any experience with yet) be used to make
the <xsl:key> persist? Hmm, maybe the <xsl:key> would persist - but that
probably would still require its execution on a document instance.

Could you use the ID feature built into XML to achieve what you want?

<!ATTLIST elm id ID #IMPLIED>

Wouldn't that persist between invocations?

That would make for efficient lookup; however, it would constrain the
values of elm/@id to what's valid for an ID type attribute.

Also, see the following thread related to an XSLT feature related to
ID-typed attributes:

Xalan-J 2.7.1: document() function disregards URI fragment identifier
http://markmail.org/thread/ept5ifkshhjoagf3

Lots of "could" and "would" here. One more: It would be great to get
input from the experts on this one.

Michael Ludwig
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.