[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] Re: Converting XML to CSV - how to eliminate output w
Hi Norm, Thanks! Your suggestion was close, but it also removed all the newlines: customer,1234schemaName,schema_nameschemaVersion,1.0PN_ID,1111111111PN_ID,111 1111ADM_ORG_CD,urn:NORM:DEPTentUserRoles,a:b:c But I was able to add <xsl:text> to get it to work: <?xml version="1.0" encoding="ISO-8859-1"?> <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"> <xsl:output method="text" encoding="UTF-8" disable-output-escaping="YES"/> <xsl:strip-space elements="*"/> <xsl:template match="*[not(*)]"> <xsl:value-of select="local-name()"/> <xsl:text>,</xsl:text> <xsl:value-of select="."/> <xsl:text> </xsl:text> </xsl:template> </xsl:stylesheet> And then, I got: customer,1234 schemaName,schema_name schemaVersion,1.0 PN_ID,1111111111 PN_ID,1111111 ADM_ORG_CD,urn:NORM:DEPT entUserRoles,a:b:c Thanks! Jim On Monday, November 6, 2023 at 03:24:06 AM EST, Norm Tovey-Walsh <ndw@xxxxxxxxxx> wrote: > Notice the whitespace in front of each line and also the blank lines > between sub-nodes, e.g., so the output would be just: Try adding <xsl:strip-space elements="*"/>. I think that will fix it, though my XSLT 1.0 is a bit rusty these days. B B B B B B B B B B B B B B B B B B B B Be seeing you, B B B B B B B B B B B B B B B B B B B B B norm -- Norm Tovey-Walsh <ndw@xxxxxxxxxx> https://norm.tovey-walsh.com/ > We are the universe, trying to understand itself.--Delenn
|
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
|