[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] RE: Newbie: template matching and multiple document ou
> Dear List, > > This is my second attempt to post this problem. I have read > all recent posts > on template matching but can't get the answer. > > The aim is to convert the xml file below into: 1) an index > page in html, > with links to all sub-files - this uses template "id" and > works fine, 2) one > html page for each "part", with the file name MSC01.html, > MSC02.html, etc, > containing just the text from that part. The best I can get > is one html > page, named MSC01.html, which contains the text from all the "parts". > You are calling this code <xsl:template name="document" match="//@id"> <xsl:for-each select = "part"> <xsl:document href = "{//@id}.html" method = "html"> Once for each document you want to generate. But because you use "//@id" to form the filename, each document has the same name. You should use @id, since the context node at the time you call the template is a <part> element with an @id attribute. And get rid of the match attribute, since you are calling the template by name, not using apply-templates. Actually, you would be better off restructuring this so you do use apply-templates rather than call-template, but that's irrelevant to the problem. You're going to have to correct a few other errors, most of your patterns and path expressions, e.g. <xsl:template name="kind" match="/@kind"> <xsl:for-each select="/*[@kind != '']"> suggest that you haven't really grasped the difference between absolute and relative paths. Mike Kay 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
|