This is the mail archive of the xsl-list@mulberrytech.com mailing list .


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

RE: Newbie: XML to fixed columns


> > I can't work out how to stop the XSLT processor from normalising the
> > whitespace in the output.
> 
> If you show a small sample input, and your stylesheet and
> the output you want, no doubt someone could say what you're 
> doing wrong.

You're a magician, David and/or Mike! 
Blow me down, I just tried it again and it worked!
I must have had a typo first time around.
Here's the stuff, just in case you have any comments:

XML Source
----------
<?xml version="1.0" encoding="UTF-8"?>
<!-- edited with XML Spy v4.0.1 U (http://www.xmlspy.com) by Heather Kwan
(Energex) -->
<!--Sample XML file generated by XML Spy v4.3 U (http://www.xmlspy.com)-->
<?xml-stylesheet type="text/xsl"
href="D:\Home\nh007\Download\MSXML4\BPAYView.xsl"?>
<activation_requests xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance";
xsi:noNamespaceSchemaLocation="ActivationRequests.xsd"
date_created="2002-05-14" record_count="1">
	<account>
		<biller_id>1552</biller_id>
		<account_id>740558447</account_id>
		<account_name>MR A J SOUTHWELL</account_name>
		<form_a_dob>1980-04-30</form_a_dob>
		<form_a_name>MR A J SOUTHWELL</form_a_name>
		<biller_type>V</biller_type>
	</account>
</activation_requests>

XSL StyleSheet
--------------
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform";
version="1.0">
<!-- Neil Higgins, 29 May 2002, for demonstration purposes only -->
<xsl:output method="text" encoding="UTF-8"/>
<xsl:template match="/">
<xsl:for-each select="//account"><xsl:value-of
select="substring(concat(account_name, '                    '), 1,
20)"/>,<!-- etc --></xsl:for-each>
</xsl:template>
</xsl:stylesheet>

Output (20 characers wide)
--------------------------
MR A J SOUTHWELL    ,


*************************************************************************
This email message (including any file attachments transmitted with it)
is for the sole use of the intended recipient(s) and may contain
confidential and legally privileged information. Any unauthorised
review, use, alteration, disclosure or distribution of this email
(including any attachments) by an unintended recipient is prohibited.
If you have received this email in error, please notify the sender by
return email and destroy all copies of the original message.

Any confidential or legal professional privilege is not waived
or lost by any mistaken delivery of the email.

ENERGEX accepts no responsibility for the content of any email
which is sent by an employee which is of a personal nature.

*************************************************************************


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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]