XML Editor
Sign up for a WebBoard account Sign Up Keyword Search Search More Options... Options
Chat Rooms Chat Help Help News News Log in to WebBoard Log in Not Logged in
Conferences Close Tree View
+ Stylus Studio Feature Requests (1192)
+ Stylus Studio Technical Forum (14621)
+ Website Feedback (249)
- XSLT Help and Discussion (7625)
-> + Use of before and after string (3) Sticky Topic
-> - How do I substitute element ty... (1)
-> + How does one add working days ... (4)
-> - Help, I have existing XLT and... (1)
-> + Need help on XSLT issue - (2)
-> + EDI to XML Conversion (7)
-> - XML To JSON Conversion using X... (1)
-> + Formatting Paragraphs to same ... (2)
-> - Grouping of records (1)
-> + Problems with xsd 1.1 (4)
-> + XML to HL7 mapping (3)
-> + XSLT 3 and Iterate (2)
-> + XSL-FO to PDF preview (3)
-> + java.lang.RuntimeException: Er... (2)
-> + Create Acroforms with Stylus X... (2)
-> + How to change XSLT parameter s... (3)
-> + how to change format of the da... (2)
-> + Search "Next 8 Results " doesn... (2)
-> - Support for Git (1)
-> + newbee (8)
-- [1-20] [21-40] [41-60] Next
+ XQuery Help and Discussion (2017)
+ Stylus Studio FAQs (159)
+ Stylus Studio Code Samples & Utilities (364)
+ Stylus Studio Announcements (113)
Topic  
Postnext
(Deleted User) Subject: Removing whitespace
Author: (Deleted User)
Date: 25 Jun 2007 02:23 PM
Originally Posted: 25 Jun 2007 02:15 PM
First, I am new user to Stylus Studio and somewhat new to XSLT.
I am using the Saxon 8.9.0.3 XSLT processor.

I am trying to convert this XML:
<Report xmlns="bwreport.es.service" delimiter="#">
<ColumnHeaders>
<Column>Period/Fiscal Year</Column>
<Column>Commitment</Column>
<Column>Obligation</Column>
</ColumnHeaders>
<Data>
<R>Period 00 2004# #</R>
<R>OCT 2004#$ 60,676,740.88#$ 60,658,920.88</R>
<R>NOV 2004#$ 52,446,486.16#$ 52,444,236.16</R>
<R>DEC 2004#$ 65,762,952.83#$ 65,762,952.83</R>
</Data>
</Report>

to this text output:
Period 00 2004# #
OCT 2004#$ 60,676,740.88#$ 60,658,920.88
NOV 2004#$ 52,446,486.16#$ 52,444,236.16
DEC 2004#$ 65,762,952.83#$ 65,762,952.83

I keep ending up with this as a result in the text file (also, the tabs don't seem to appear as presented but are there):
Period 00 2004# #
OCT 2004#$ 60,676,740.88#$ 60,658,920.88
NOV 2004#$ 52,446,486.16#$ 52,444,236.16
DEC 2004#$ 65,762,952.83#$ 65,762,952.83

I don't want the tabs in the output document.

My XSLT is:
<?xml version="1.0"?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:bwreport="bwreport.es.service">
<xsl:output method="text" indent="no"/>
<xsl:strip-space elements="*"/>
<xsl:template match="/bwreport:Report/bwreport:Data/bwreport:R">
<xsl:apply-templates/>
</xsl:template>
<xsl:template match="text()">
<xsl:value-of select="."/>
<xsl:text>
</xsl:text>
</xsl:template>
<xsl:template match="bwreport:ColumnHeaders"/>
</xsl:stylesheet>

I have read several XSLT documents on-line to no avail.

TIA

MTH

Postnext
(Deleted User) Subject: Removing whitespace
Author: (Deleted User)
Date: 26 Jun 2007 09:01 AM
Hi Michael,
as the tabs are not displayed in your message, it's hard to understand what is not working; could you attach the files instead of copying them?

Thanks,
Alberto

Postnext
(Deleted User) Subject: Removing whitespace
Author: (Deleted User)
Date: 26 Jun 2007 09:22 AM
The files are attached.

The file with the original xml is called report.xml. The output file is called bw_report_output.txt.

Thanks.

Postnext
(Deleted User) Subject: Removing whitespace
Author: (Deleted User)
Date: 26 Jun 2007 09:23 AM
The files are attached.

The file with the original xml is called report.xml. The output file is called bw_report_output.txt.

Thanks.


Unknownbw_report_output.txt
Output file

Postnext
(Deleted User) Subject: Removing whitespace
Author: (Deleted User)
Date: 26 Jun 2007 09:24 AM
Sorry, first time uploading files. Here is the other one.


Documentbw_report_output.xsl
XSLT

Unknownreport(3).xml
input xml document

Posttop
(Deleted User) Subject: Removing whitespace
Author: (Deleted User)
Date: 26 Jun 2007 09:39 AM
Hi Michael,
the tab that is generated before each row is defined inside the xsl:text you wrote in the stylesheet.
You have

(TAB)<xsl:text>(CR)(LF)
(TAB)</xsl:text>

and this will write a new line followed by a tab after each row. If oyu change it to be

(TAB)<xsl:text>(CR)(LF)
</xsl:text>

you should get what you are expecting.

Hope this helps,
Alberto

   
Download A Free Trial of Stylus Studio 6 XML Professional Edition Today! Powered by Stylus Studio, the world's leading XML IDE for XML, XSLT, XQuery, XML Schema, DTD, XPath, WSDL, XHTML, SQL/XML, and XML Mapping!  
go

Log In Options

Site Map | Privacy Policy | Terms of Use | Trademarks
Stylus Scoop XML Newsletter:
W3C Member
Stylus Studio® and DataDirect XQuery ™are from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2016 All Rights Reserved.