Rats. But thanks for the quick responses! I'm not quite clever enough to figure out how to split up my .xml source file. I have .xsl like that shown below, and I'm not sure how to redo this with document(). Perhaps I could even find a different way to do the secondary index entries described below, and that this other way might avoid running afoul of the size limits?
(I understand that this mailing list isn't really the right place to ask, so I'll post this question to http://www.mulberrytech.com/xsl/xsl-list/ and wherever else you wizards suggest. Code included below in case you folks have an instant clue.) Meanwhile, there's the issue of how to improve xalan. Shane suggested posting the .xml and .xsl on a bug ticket. Do I understand correctly that the problem is already well understood (e.g., by Joseph) and that the existing code posted in, for example, Bug 2983 has got it covered? -------------------- .xsl code --------------------- <!-- ********************************************************** --> <!-- FIRST ISSUE: matching up references to what they point to. --> <!-- A HEAD is a heading, and HEAD-REF is a reference to that HEAD. --> <!-- There's actually a whole bunch of such pairs, like BIB-HEAD/BIB-REF, GLOS-HEAD/GLOS-REF, etc. --> <!-- How could I rewrite this key and the use of it when the HEAD and HEAD-REFS can be in different .xml source documents? --> <xsl:key name="head" match="HEAD" use="."/> <xsl:template match="HEAD-REF"> <!-- This is the text we're trying to match. --> <xsl:variable name="match-name"> <xsl:apply-templates select="." mode="name"/> </xsl:variable> <!-- Formats the text of this element as a link to the corresponding definition-node. I haven't included that code here.--> <!-- The rules for make-link-to-definition do depend on the $definition-node being a node-set, not a result-tree fragment. --> <xsl:apply-templates select="." mode="make-link-to-definition"> <xsl:with-param name="definition-node" select="key('head', $match-name)"/> </xsl:apply-templates> </xsl:template> <!-- Notice that "name" isn't always something that can be computed in a pattern or expression. --> <xsl:template match="*" mode="name"> <xsl:choose> <xsl:when test="./@name"> <xsl:value-of select="./@name"/> </xsl:when> <xsl:otherwise> <xsl:apply-templates select="." mode="simple-text"/> <!-- ... which has it's own occasional complications that I haven't included the code for here. --> </xsl:otherwise> </xsl:choose> </xsl:template> <!-- *************************************************** --> <!-- SECOND ISSUE: finding all references to a location. --> <!-- As above, this actually occurs for a whole bunch of element pairs. --> <!-- How could I rewrite this key and the use of it when the HEAD and HEAD-REFS can be in different .xml source documents? --> <!-- Maybe there's a better way to do this altogether, such that it doesn't blow the limits on the number of nodes in the XSLT processor?--> <xsl:key name="references" match="HEAD-REF" use="generate-id(//HEAD[.=current()])"/> <!-- The INDEX element causes every interesting link destination to appear in an alphabetized list. --> <xsl:template match="INDEX"> <!-- How could this select be rewritten when the source is spread over several documents? --> <xsl:apply-templates select="//HEAD | //CATEGORY-HEAD | //BIB-HEAD | //REF-NAME | //GLOS-HEAD" mode="index"> <xsl:sort select="translate(., 'ABCDEFGHIJKLMNOPQRSTUVWXYZ', 'abcdefghijklmnopqrstuvwxyz')"/> <xsl:sort select="."/> </xsl:apply-templates> </xsl:template> <xsl:template match="*" mode="index"> <!-- make-full-index-entry is not interesting and not shown here. --> <xsl:call-template name="make-full-index-entry"> <xsl:with-param name="secondary"> <xsl:apply-templates select="." mode="index.secondary"/> </xsl:with-param> </xsl:call-template> </xsl:template> <!-- The secondary items for each index entry is a listing of all the sections (DIV elements) that contain references to this index term. These are sorted by how many occurences of the reference occurs within the section. --> <xsl:template match="*" mode="index.secondary"> <xsl:variable name="key" select="."/> <xsl:variable name="id" select="generate-id(.)"/> <xsl:apply-templates select="key('references', $id)/ancestor::DIV[1]" mode="secondary-index-entry"> <!-- secondary-index-entry is not shown here. --> <xsl:sort select="count(key('references', $id) [generate-id(ancestor::DIV[1]) = generate-id(current())])" data-type="number" order="descending"/> </xsl:apply-templates> </xsl:template>
