This is the mail archive of the xsl-list@mulberrytech.com mailing list .


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: concatenating ranges of nodes



> I can't think of a way of concatenating text nodes within the single
> stylesheet.

You can do this, although it's a bit of a pain, basically you just have
to arrange that the templates coming "down" from the block elements
only select the first of each group of nodes you want to class as text,
then the templates for each of those have to use following-sibling to
grab th eadjacent nodes.

The FAQ's on grouping would have details, but as you indicate a two pass
approach is probably easier, take the result you have and then process
itagain with a template that does the identity transform except for
merging text elements (as above, but easier as you only have one sort of
element node to collect)

you don't need to use a separate stylesheet if your processor supports a
node-set() extension function that allows you tosave the first transform
in a variable and then convert it to a node set for the second pass.
Most of the major xslt systems have a node-set function.

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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]