Re: Writing array elements based on a an evaluation of
So now I have...
^^^^^^^^^^^^^^ Well, guessing isn't going to help much.
because somehow I'm not refering to the correct occurence of the ACCOUNT-NO
child > > node I'm dealing with? And I'll need some xsl:for-each logic Why the for-each? Why wouldn't you be referring to the correct occurence. Not likely we'll know unless you actually show the input.
I see the xsl above as saying...the current node (ACCOUNT-LIST).
Well, change 1) to say check if the first text child of ACCOUNT-NO has a length of 0, which David Carlisle already pointed out is pointless since it wouldn't be created if it didn't.
I guess I'm mising a whole chunk that specifies the current occurence^^^ that darn word again.
Well, without any example of input and only having vaguely folllowed this thread, I'll have to do some guess of my own.
What is the text length between the dashes?: - - What is the text length between these dashes?: - -
The point I'm trying to make is that XSLT will count the whitespace. If you think it shouldn't, you need to tell it not too. Notice too you've ignored the advice of several people on the list and are still just getting the first text node. If you read the specs you'll find more information about string manipulation and how to get the string value. (The xslt 1.0 really is readable) The short answer can also be found in the FAQ (Under Empty Elements -> Testing for Empty elements). You need to normalize the space of the text value of the element.
Also it sounds like you'll always create Account-List but not necessarily Account-No. So why are you bothering with that this in the template for account list?
So anyhow, combining the advice
<xsl:template match="ACCOUNT-LIST"> <xsl:copy> <xsl:apply-templates /> </xsl:copy> </xsl:template>
<xsl:template match="ACCOUNT-NO"> <xsl:if test="normalized-space(.)"> <xsl:copy> <xsl:apply-templates /> </xsl:copy> </xsl:if> </xsl:template>
the child elements----- Original Message ---- From: Florent Georges <darkman_spam@xxxxxxxx> To: xsl-list@xxxxxxxxxxxxxxxxxxxxxx Sent: Wednesday, 24 May, 2006 1:31:01 PM Subject: Re: Writing array elements based on a an evaluation of one of
PURCHASE STYLUS STUDIO ONLINE TODAY!
Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!
Download The World's Best XML IDE!
Accelerate XML development with our award-winning XML IDE - Download a free trial today!
Subscribe in XML format