[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] Re: multiple input sources to Saxon
Lee Pollington wrote: > I looking for direction in terms of an effective strategy for "munging" > several input sources togethor to supply as a "super document" to Saxon. We > have multiple javax.xml.transform.sources, we want to combine them togethor > under a given root element and supply them to the transformer. I'm curious as to what your goal is here. Perhaps you'd like to use XSLT as a kind of query language over multiple documents without having to explicitly invoke the document() function (and without knowing the URIs of those documents)? If that's the case, then another approach might be to use a top-level parameter in your stylesheets, the value of which is bound by the external API. That value could consist of a set of root nodes (the same as what's returned by the document() function). This would have the additional advantage that the id() function wouldn't break and you wouldn't lose the information as to which document contains which nodes. This would be important to support processing instructions and comments outside of the root element in well-formed documents, as well as documents that are only "well-balanced", e.g. an external general parsed entity. An example of what a particular "query" might look like: <xsl:transform version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"> <xsl:param name="input"/> <xsl:template match="/"> <bib> <xsl:for-each select="$input/bib/book[publisher='Addison-Wesley' and @year > 1991]"> <book year="{@year}"> <xsl:copy-of select="title"/> </book> </xsl:for-each> </bib> </xsl:template> </xsl:transform> Email me privately about Java source code for achieving this. I've been doing this very thing using SAXON. Evan Lenz XYZFind Corp. 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
|