Re: [xsl] When to use text()

Subject: Re: [xsl] When to use text()
From: Martin Holmes <mholmes@xxxxxxx>
Date: Sun, 23 Mar 2014 12:22:52 -0700
On 14-03-23 11:26 AM, Ihe Onwuka wrote:

Btw... the tip where you showed me where you recreate elements the way
you want so you can apply templates to them.

Brilliant. It was very useful last week.

I think it's a common technique. The thing to watch out for is that your created nodes have no context -- so for instance if you create a <date> node, it won't trigger a template such as:

<xsl:template match="birth/date">

I mostly seem to use this approach when I'm unravelling nested items. TEI, for instance, allows <tei:list> inside <tei:p>, but HTML doesn't allow <html:ol> or <html:ul> inside <html:p>; ODT presents similar challenges. One way to handle this is to pass your <p> elements to a template that spits out the bits-between-lists as new <tei:p> elements, and the lists between them, in sequence, and then call apply-templates on the newly-created elements. Arguably you're changing the conceptual structure here by breaking up <p> elements, but sometimes it doesn't matter, especially if the output is for some temporary purpose and won't be archived.



On Sun, Mar 23, 2014 at 6:21 PM, Martin Holmes <mholmes@xxxxxxx> wrote:
On 14-03-23 11:05 AM, Ihe Onwuka wrote:

On Sun, Mar 23, 2014 at 6:01 PM, David Carlisle <davidc@xxxxxxxxx> wrote:

On 23/03/2014 17:52, Ihe Onwuka wrote:


What on earth is that?

in this day and age of mobile technology a 5 year old could tell you.

It sounds like you are expecting it to return an SMS message. :-)


Current Thread