Subject: Re: [xsl] Selective output of half a tag? From: David Carlisle <davidc@xxxxxxxxx> Date: Tue, 11 Jun 2002 14:37:33 +0100 |
> to explain properly) above is to take a series of <foo/> tags Try to avoid using the word "tag". If you think in terms of tags then you get into precisely the problems you describe. XSLT does not deal with tags at all, all tags (that is linerised XML markup) have been processed by an XML parser before XSLT even starts. XSLT works on trees it does not see tags in teh input, nor can it directly create tags in the output. You can talk about a start tag without an end tag, as they are just two strings but you can't have half a node in a tree. If you think in terms of tree transformations then XSLT becomes a lot easier to understand. Your problem > Hence the need to determine if a <foo/> is the last in the group of > <foo/>'s, so it can append a </mytag>. No. wrong way to describe the problem. Your first description was better: > take a series of <foo/> tags in the > source, convert them all to <bar/> in the output, and then wrap the > group of <bar/> up in <mytag/>. but again you should not think in terms of tags take a series of foo eleemnts in the source, convert them all to bar elements in the output, and then wrap the group of bar up in mytag element: <xsl:template match="parent-of-foo"> .... <mytag> <xsl:template select="foo"/> </mytag> .... </xsl:template> <xsl:template match="foo"> <bar> <xsl;apply-templates/> </bar> </xsl:template> David _____________________________________________________________________ This message has been checked for all known viruses by Star Internet delivered through the MessageLabs Virus Scanning Service. For further information visit http://www.star.net.uk/stats.asp or alternatively call Star Internet for details on the Virus Scanning Service. XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list
Current Thread |
---|
|
<- Previous | Index | Next -> |
---|---|---|
Re: [xsl] Selective output of half , Antonio Fiol | Thread | RE: [xsl] Selective output of half , Michael Kay |
RE: [xsl] Selective output of half , Andrew Welch | Date | RE: [xsl] Selective output of half , Michael Kay |
Month |