[XSL-LIST Mailing List Archive Home] [By Thread] [By Date]

[xsl] Multi-source documents: difference between document() and entities?


Subject: [xsl] Multi-source documents: difference between document() and entities?
From: Randolph Kahle <randy.kahle@xxxxxxxxxxxxx>
Date: Tue, 27 Jan 2004 11:50:37 -0700

I am trying to determine the best way to manage the metadata related to an XSL transformation.

To create a document, I assemble parts from separate XML-formatted "topic" files. I currently use a master XML document and define entities:

<<<<<

<?xml version="1.0" encoding="iso-8859-1" ?>

<!DOCTYPE class
[
<!ENTITY pINTRODUCTION    SYSTEM  "topics/introduction.xml" >
<!ENTITY pOVERVIEW        SYSTEM  "topics/overview.xml" >
]>

<class>
    &pINTRODUCTION;
    &pOVERVIEW;
</class>

>>>>>

This entity-based approach allows me to clearly anchor all references to portions of the tree via "/", which is important when I add cross-reference links to my processing.

The other way I could do this is to use the document() function to read in an XML-formatted file that contains the class structure metadata, loop through that and read in each topic file with the document() function.

I prefer to externalize the metadata into a pure data-based XML file and use the document() function, but it is not clear to me how I would define a path to the different trees.

As I understand it, document() returns the root node of a tree and if I use the "/" path while processing a tree, I do *not* get the "root" above all document()-retrieved trees. What I get is the root of that specific XML file's tree.

My question is: How do I construct a path that will search all trees returned by the document() function?

-- Randy




XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list




Current Thread
Keywords