Re: [xsl] How to emit opening and closing tags separately

Subject: Re: [xsl] How to emit opening and closing tags separately
From: David Carlisle <davidc@xxxxxxxxx>
Date: Mon, 08 Mar 2010 10:45:21 +0000
On 08/03/2010 10:23, Wolfgang Laun wrote:
tree in teh result. You can not have "half a node".

All right, all right - I think I gave some indications that I'm aware of all that.

:-)




The problem with grouping is that the input is just lines of texts, wrapped in an element, and the only attribute there is a time stamp. The data results from a test system that itself is currently under development, so that the groups aren't stable,



If you have a regexp that you can apply to your text to say you want to start a new group, then (in xslt 2) you can use
<xsl:for-each-group with group-starting-with testing that regexp.


positional grouping is a little more involved in xslt 1.

As always, it's easier to give advice on a small running example.

> or they may not be well formed etc.

Not sure what that would mean, xslt always (excepting disable-output-escaping and character maps) produces well formed results. It may be that the input isn't groupable because of conflicting constraints, but that's a different issue.

Of course it may be (if you setup supports it) you can just do what you ask in the subject line

<xsl:value-of disable-output-encoding">&lt;tag&gt;</xsl:value-of>

...


<xsl:value-of disable-output-encoding">&lt;/tag&gt;</xsl:value-of>


But using d-o-e is almost always the wrong thing to do, and if you have xpath predicates that can reliably decide to insert thise tags, you can use the same predicates for grouping and not need d-o-e.

David



________________________________________________________________________
The Numerical Algorithms Group Ltd is a company registered in England
and Wales with company number 1249803. The registered office is:
Wilkinson House, Jordan Hill Road, Oxford OX2 8DR, United Kingdom.

This e-mail has been scanned for all viruses by Star. The service is
powered by MessageLabs. ________________________________________________________________________


Current Thread