|
[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] RE: Strip CRLF/newline only
Peter,
The xsl:strip-space instruction should do the trick.
For example, the following identity transformation
strips the whitespace that you don't want:
<?xml version="1.0"?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
version="1.0">
<xsl:output method="xml" indent="no"/>
<xsl:strip-space elements="*"/>
<!-- Identity transformation. -->
<xsl:template match="/">
<xsl:copy-of select="."/>
</xsl:template>
</xsl:stylesheet>
Hope this helps.
Bob
<sig name = 'Bob Lyons'
title = 'B2B Integration Consultant'
company = 'Unidex, Inc.'
phone = '+1-732-975-9877'
email = 'boblyons@xxxxxxxxxx'
url = 'http://www.unidex.com/'
product = 'XML Convert: transforms flat files to XML and vice versa' />
-----Original Message-----
Up until now I've watched the white space issues bounce around wondering why
it's a problem, now I've got a whitespace issue I'm not having a lot of luck
with....
I have a bunch of XML formatted with CRLF (newlines) to make the XML look
pretty, e.g.:
<person>
<name>
<last/>, <first/>
</name>
<dateofbirth/>
<address>
<addr1/>, <city/>, <state/>
</address>
</person>
In the text nodes there are significant spaces (the ones following the
commas) that I want to preserve. I don't want the extension to see the
newline/CRLF's. I assume this is a filter, but what's it look like?
XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list
|
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
|

Cart








