Re: [xsl] Adding line breaks in Title attribute

Subject: Re: [xsl] Adding line breaks in Title attribute
From: David Carlisle <davidc@xxxxxxxxx>
Date: Fri, 29 Apr 2005 14:55:56 +0100
>   This html is an example of what I am looking for, I took this from the
>   mock up I developed and works on IE6.0. The xml I am using Is below
>   also. The problem is that I can not seem to get the xsl to put the
>   line break between the last name and the order disposition as it works
>   in the mockup.
>
>   <button id="shoppingCart" title="Jenny Peterocceli &#10; Validated"
>   class="tabText">Customer Account<br/>Jenny Peteroccelli</button>
>
>
>   <ORDERS>
>   <ORDER num="3">
>	    <order_detail_id>265985</order_detail_id>
>	    <external_order_number>FND341076</external_order_number>
>	    <first_name>Meaghan</first_name>
>	    <last_name>Bouchoux</last_name>
>	    <order_disp_code>Validated</order_disp_code>
>   </ORDER>
>   </ORDERS>

I assume that you don't want that output from that input (name change?)

I'm not sure what difficulty you are having but getting a newline is
just like getting any other character:

button.xml
<ORDERS>
<ORDER num="3">
         <order_detail_id>265985</order_detail_id>
         <external_order_number>FND341076</external_order_number>
         <first_name>Meaghan</first_name>
         <last_name>Bouchoux</last_name>
         <order_disp_code>Validated</order_disp_code>
</ORDER>
</ORDERS>


button.xsl
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform";
                version="1.0">


<xsl:template match="ORDER">
<button id="shoppingCart" title="{first_name} {last_name} &#10; {order_disp_code}"
class="tabText">Customer Account<br/>
<xsl:value-of select="first_name"/>
<xsl:text> </xsl:text>
<xsl:value-of select="last_name"/>
</button>

</xsl:template>


</xsl:stylesheet>


$ saxon button.xml button.xsl
<?xml version="1.0" encoding="utf-8"?>
<button id="shoppingCart" title="Meaghan Bouchoux &#xA; Validated" class="tabText">Customer Account<br/>Meaghan Bouchoux</button>

David

________________________________________________________________________
This e-mail has been scanned for all viruses by Star. The
service is powered by MessageLabs. For more information on a proactive
anti-virus service working around the clock, around the globe, visit:
http://www.star.net.uk
________________________________________________________________________

Current Thread