|
[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] RE: Process output from imported stylesheet?
so your included/imported file would have to be complete before the stylesheet was compiled.- ugh, bummer. Thanks Josh. You could use a two pass approach, where you generate the XSL in the first pass, and then use the generated XSL file to process your XML.- I'm letting my users process their XML data through a library of XSLs, this being one of them and the wish was to let them select which elements to avail and order of appearance. If I generate a unique XSL for each of the users, it may be unmanageable to add new features in the future. =\ Perhaps if you provide an example of the problem you are trying to solve someone could help with an alternative to dynamic call-templates?- Alright, here are very brief extracts of the various files involved, please pardon any errors. - Primary XML file where the contents to be manipulated are. <?xml version="1.0" encoding="UTF-8"?> <Test xmlns="http://www.test.test" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="../xmls/test.xsd"> <Content genre="Entries List"> <Section ID="0000000005"> <DocID>2</DocID> <Author>magnus</Author> <Title>violin..</Title> <Desc>and this would be the &lt;strong&gt;second&lt;/strong&gt;...</Desc> <DateCreated>2004-02-10 03:03:26</DateCreated> <DateModified>2004-02-10 03:03:26</DateModified> <DatePublished>2004-02-29 12:00:00</DatePublished> </Section> <Section ID="0000000039"> <DocID>2</DocID> <Author>magnus</Author> <Title>A super getChronInfo function</Title> <Desc>new url [expletive deleted], I feel like sleeping.. x_X</Desc> <DateCreated>2004-02-09 00:21:17</DateCreated> <DateModified>2004-02-09 03:01:08</DateModified> <DatePublished>2004-02-10 00:21:17</DatePublished> </Section> </Content> </Test> - Secondary XML file where settings of which elements to display are. <?xml version="1.0" encoding="UTF-8"?> <Test xmlns="http://www.test.test"> <Content genre="Some config"> <Order> <Element>Title</Element> <Element>DatePublished</Element> <Element>Desc</Element> <Element>DateModified</Element> <Element>Author</Element> </Order> </Content> </Test>
- Secondary XSL to process the elements desired and its order. <xsl:template match="/"> <xsl:element name="xsl:template"> <xsl:attribute name="match">base:Section</xsl:attribute> <xsl:for-each select="document(Secondary XML as above)/*/*/*/base:Element"> <xsl:element name="xsl:call-template"> <xsl:attribute name="name"><xsl:value-of select="." /></xsl:attribute> </xsl:element> </xsl:for-each> </xsl:element> </xsl:template> - And this secondary XSL was imported into the orignal primary XSL, amending the above.. <xsl:template match="base:Section"> <xsl:apply-imports /> </xsl:template> _________________________________________________________________ Find gifts, buy online with MSN Shopping. http://shopping.msn.com.sg/ 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
|

Cart








