RE: [xsl] Implementing a (fairly) complex business rule

Subject: RE: [xsl] Implementing a (fairly) complex business rule
From: "Bradley, Peter" <pbradley@xxxxxxxxxx>
Date: Tue, 30 Sep 2008 15:38:06 +0100
Thanks a lot, David.  That's clear (and a copy of your email has gone
straight to our knowledge base).

Cheers


Peter

-----Original Message-----
From: David Carlisle [mailto:davidc@xxxxxxxxx]
Sent: 30 September 2008 15:30
To: xsl-list@xxxxxxxxxxxxxxxxxxxxxx
Subject: Re: [xsl] Implementing a (fairly) complex business rule


> I know that this is pushing your goodwill a bit far, but would you
mind
> explaining when I do need text() and when I don't.

You almost never need it. At times when you need to ask, then you don't
need it.

That is you almost never need it to pass to any further string handling
as it's almost always better to pass the element node instead. The only
time you do need it is if you explictly want to test for an element
being there but empty as opposed to not being there.
not(POSTCODE) is true if there is no POSTCODE but false if there is
<POSTCODE/>
not(POSTCODE/text()) is true if there is no text in the POSTCODE,
although uusually I'd check
not(POSTCODE/node())  (the difference showing up on things like
<POSTCODE><!-- --></POSTCODE> which has a comment node but no text.


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