Home. 
.

transparent

transparent

transparent

Altova Mailing List Archives


RE: xslt hard CR

From: mikew@-----------.---------.---
To: NULL
Date: 1/4/2005 6:53:00 AM
no, i nedd to insert a hard CR not preserve an existing one

"MAHESH MANDHARE" wrote:

> hi mike 
> 
> i don't get your question completely
> but what i understood from your post is that you want to interprete newline  
> in xml 
> if you r not talking about html
> then when you transform the file in xml the newline &spaces are preserved in 
> resulting xml
> only you have to use <xml:output method="xml"/> at top level
> 
> what i have tried it on my own files see only  <descr> element
> 
> 
> ////////xml file
> 
> 
> 
> <?xml version="1.0"?>
> <?xml-stylesheet type="text/xsl" href="E:\Users\MaheshM\msdn 
> newsgroup\work.xsl"?>
> <statement>
> 	<detail>
> 		<number>4</number>
> 		<entryDate>2004-12-07</entryDate>
> 		<type>charge</type>
> 		<descr>Business DSL 768/128</descr>
> 		<chargeType>Misc</chargeType>
> 		<charge>43.11</charge>
> 		<tax>0.00</tax>
> 		<total>43.11</total>
> 		<quantity>1.00</quantity>
> 		<unitPrice>43.11</unitPrice>
> 		<startDate>2004-12-07</startDate>
> 		<endDate>2005-01-02</endDate>
> 		<PONumber/>
> 	</detail>
> 	<detail>
> 		<number>6</number>
> 		<entryDate>2004-12-07</entryDate>
> 		<type>charge</type>
> 		<descr>E-mail:  
> 		mahjo                                            jfew</descr>
> 		<serviceName>bkeefer</serviceName>
> 		<charge>1.74</charge>
> 		<tax>0.00</tax>
> 		<total>1.74</total>
> 		<quantity>1.00</quantity>
> 		<unitPrice>1.74</unitPrice>
> 		<startDate>2004-12-07</startDate>
> 		<endDate>2005-01-02</endDate>
> 		<PONumber/>
> 	</detail>
> 	<detail>
> 		<number>7</number>
> 		<entryDate>2004-12-07</entryDate>
> 		<type>charge</type>
> 		<descr>E-mail</descr>
> 		<serviceName>csmith</serviceName>
> 		<charge>1.74</charge>
> 		<tax>0.00</tax>
> 		<total>2.74</total>
> 		<quantity>1.00</quantity>
> 		<unitPrice>1.74</unitPrice>
> 		<startDate>2004-12-07</startDate>
> 		<endDate>2005-01-02</endDate>
> 		<PONumber/>
> 	</detail>
> 	<detail>
> 		<number>2</number>
> 		<entryDate>2004-12-07</entryDate>
> 		<type>charge</type>
> 		<descr>E-mail</descr>
> 		<serviceName>bbarker</serviceName>
> 		<charge>1.74</charge>
> 		<tax>0.00</tax>
> 		<total>1.74</total>
> 		<quantity>1.00</quantity>
> 		<unitPrice>1.74</unitPrice>
> 		<startDate>2004-12-07</startDate>
> 		<endDate>2005-01-02</endDate>
> 		<PONumber/>
> 	</detail>
> </statement>
> 
> 
> ///////xslt file
> 
> <xsl:template match="statement" xml:space="preserve"  priority="3">  
>  
>  
>   <xsl:text disable-output-escaping="yes" >this is       



>               Áa table <></xsl:text>
> 
> <TABLE BORDER="1" CELLSPACING="0" CELLPADDING="5" WIDTH="100%">
>    <TR>
>    	<TD WIDTH="10"><B>num</B></TD>
>   	<TD WIDTH="10"><B>Qty</B></TD>
> 	<TD WIDTH="300"><B>Description</B></TD>
> 	<TD WIDTH="20"><B>Unit Price</B></TD>
> 	<TD WIDTH="20"><B>Ext. Price</B></TD>
> 	<TD WIDTH="20"><B>Tax</B></TD>
> 	<TD WIDTH="20"><B>Total</B></TD>
>    </TR>
>    <xsl:value-of select="descr" ></xsl:value-of>
>    
>    
>    <xsl:for-each select="detail" xml:space="default">
>    
> <TR>	
> 	<td><xsl:number format="=>.a"  	letter-value="traditional" 
> grouping-separator="," value="position()"></xsl:number></td>
> 	<TD width="10"><xsl:value-of select="quantity" /></TD>
> 		<TD width="550"><xsl:value-of select="descr" ></xsl:value-of></TD>
> 		<TD width="20"><xsl:value-of select="unitPrice"/></TD>	
> 		<TD width="20"><xsl:value-of select="tax"/></TD>
> 		<TD width="20"><xsl:value-of select="total"/></TD>
> 	
> 	</TR>
> 	
> 	
> 	
> 		</xsl:for-each>
> </TABLE>
> 
> </xsl:template>
> 
> 
> 
> 
> </xsl:stylesheet>
> 
> 
> 
> 
> 
> ////and the resulting xml
> 
> <?xml version="1.0" encoding="UTF-8"?>
> <?xml-stylesheet version="1.0"  href="work_practice.xsl"?><HTML>this is       
> 
> 
> 
>               a table <><TABLE BORDER="1" CELLSPACING="0" CELLPADDING="5" 
> WIDTH="100%"><TR><TD WIDTH="10"><B>num</B></TD><TD 
> WIDTH="10"><B>Qty</B></TD><TD WIDTH="300"><B>Description</B></TD><TD 
> WIDTH="20"><B>Unit Price</B></TD><TD WIDTH="20"><B>Ext. Price</B></TD><TD 
> WIDTH="20"><B>Tax</B></TD><TD 
> WIDTH="20"><B>Total</B></TD></TR><TR><td>=>.a</td><TD width="10">1.00</TD><TD 
> width="550">Business DSL 768/128</TD><TD width="20">43.11</TD><TD 
> width="20">0.00</TD><TD width="20">43.11</TD></TR><TR><td>=>.b</td><TD 
> width="10">1.00</TD><TD width="550">E-mail:  
> 		mahjo                                            jfew</TD><TD 
> width="20">1.74</TD><TD width="20">0.00</TD><TD 
> width="20">1.74</TD></TR><TR><td>=>.c</td><TD width="10">1.00</TD><TD 
> width="550">E-mail</TD><TD width="20">1.74</TD><TD width="20">0.00</TD><TD 
> width="20">2.74</TD></TR><TR><td>=>.d</td><TD width="10">1.00</TD><TD 
> width="550">E-mail</TD><TD width="20">1.74</TD><TD width="20">0.00</TD><TD 
> width="20">1.74</TD></TR></TABLE></HTML>


transparent
Print
Mail
Digg
delicious
Disclaimer
.

These Archives are provided for informational purposes only and have been generated directly from the Altova mailing list archive system and are comprised of the lists set forth on www.altova.com/list/index.html. Therefore, Altova does not warrant or guarantee the accuracy, reliability, completeness, usefulness, non-infringement of intellectual property rights, or quality of any content on the Altova Mailing List Archive(s), regardless of who originates that content. You expressly understand and agree that you bear all risks associated with using or relying on that content. Altova will not be liable or responsible in any way for any content posted including, but not limited to, any errors or omissions in content, or for any losses or damage of any kind incurred as a result of the use of or reliance on any content. This disclaimer and limitation on liability is in addition to the disclaimers and limitations contained in the Website Terms of Use and elsewhere on the site.

.
.

transparent

transparent