[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] Re: Perpetuating xsl instructions
Hi Alan, > The solution requires dynamically writing a web page by aggregating > n number of XML docs without writing any code (a one off solution). > Essentially a chain reaction is initiated where the first XSL > document runs up a 'tree' of XML documents, merging XML into itself. > The terminating transformation results in a pure XML document (minus > the XSL) with all the content needed to build the web page. > > If you can think of another solution, we'd love to hear it. I'll take a wild stab in the dark and guess that your documents look like: <foo> <bar /> <include href="doc1.xml" /> </foo> and you want the content of doc1.xml to replace the <include> element with, naturally, doc1.xml containing its own <include> elements that need to be replaced and so on. If that's the case, then you need a stylesheet based on an identity transformation (one that just copies the content of the document, recursively): <xsl:template match="node()|@*"> <xsl:copy> <xsl:apply-templates select="@*|node()" /> </xsl:copy> </xsl:template> where <include> elements are treated specially, by applying templates to the referenced document (retrieved using the document() function): <xsl:template match="include"> <xsl:apply-templates select="document(@href, .)/*" /> </xsl:template> Of course it might be that I'm way off the mark. If you want something more helpful, I really recommend that you put together a short example that shows what your documents look like and what the final result you want looks like. Without that information, it is really hard for us to give you any advice. Cheers, Jeni --- Jeni Tennison http://www.jenitennison.com/ XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list
|
PURCHASE STYLUS STUDIO ONLINE TODAY!Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced! Download The World's Best XML IDE!Accelerate XML development with our award-winning XML IDE - Download a free trial today! Subscribe in XML format
|