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

RE: Newline problems

Subject: RE: Newline problems
From: me@xxxxxxxxxxxx
Date: Mon, 05 May 2003 17:12:56 -0700 (PDT)
.net newline
Ok, this thread is getting boring. :)

Here is what I see as the main problem with the logic
of the sheet as it stands (if I am reading it
correctly).

This

<xsl:template mode="stripNewline"  match="text()">
  <xsl:value-of select="normalize-space(.)"/>
</xsl:template>

Will normalize-space on the text node =>IF<= 

<xsl:template mode = "Attribs" match = "info">
  <xsl:apply-templates mode="stripNewline"
select="text()"/>
   <xsl:element name = "PO_NUMBER">
    <xsl:value-of
select="attr/atomicValue[../name='ponumber']"/>
   </xsl:element>
   ...
</xsl:template>

"[LF]ponumber" = "ponumber". Which it never will. So
the text nodes will never be "cleaned".

So you are in a catch 22 if you refuse to use 
...
select="attr/atomicValue[normalize-space(../name)='ponumber']"/>

People use trim() all the time on Char values from a
database or input from the console. As I see it (and I
am by no means a Guru) You have several things you can
do - all of which have been given to you already.

1. Have the original xml manipulated first. As Michael
said.
2. Use normalize-space() on the item you are testing
3. Perhaps ../name = '[lf]ponumber' would work?
4. Don't use xslt, find another solution

Cheers, and good luck
Rob

    _/  _/_/    _/_/_/
   _/_/   _/ _/     _/
  _/               _/
 _/             _/
_/          _/_/_/_/
http://treebeard.sourceforge.net
http://ashpool.sourceforge.net

 XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list


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.