[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

Re: When to use text()

Subject: Re: When to use text()
From: Martin Holmes <mholmes@xxxxxxx>
Date: Sun, 23 Mar 2014 12:22:52 -0700
Re:  When to use text()
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.

Cheers,
Martin


Thanks.


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:


text.


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. :-)

Cheers,
Martin

Current Thread

PURCHASE STYLUS STUDIO ONLINE TODAY!

Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
Email
First Name
Last Name
Company
Subscribe in XML format
RSS 2.0
Atom 0.3
Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery ™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2013 All Rights Reserved.