[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

RE: inserting tabs

Subject: RE: inserting tabs
From: "Michael Kay" <mike@xxxxxxxxxxxx>
Date: Thu, 13 Mar 2008 10:32:11 -0000
RE:  inserting tabs
You can output a tab anywhere you like using

<xsl:text>&_#x09;</xsl:text>

The stylesheet can't refer to an entity declared in the source document, but
you could if you wanted declare an entity in the stylesheet document, in
which case you would be able to write &_tab; instead of &_#x09;

Ignore all the underscores in this message, they are to defend against mail
systems trying to be clever and failing. 

Michael Kay
http://www.saxonica.com/

> -----Original Message-----
> From: oryann9 [mailto:oryann9@xxxxxxxxx] 
> Sent: 13 March 2008 00:30
> To: xsl-list@xxxxxxxxxxxxxxxxxxxxxx
> Subject:  inserting tabs
> 
> Hello all, 
> 
> I searched through the archives and found some relevant data 
> however I am still "missing the boat."
> I am having xml do the inserting of tab in my xml output but 
> rather should have xsl insert tabs into my xml output.
> I am a newbie and this is a question for my online class. How 
> do I insert tabs after each entry in my xsl code? 
> For example, Jeff 	Peng    
> 
> thank you
> 
> 
> 
> In my xml DTD doc I declare an entity like so:
> <!DOCTYPE CONTACTS [
> <!ENTITY tab "&#x09;">
> 
> <snip>
>  
>  <!-- Begin XML data -->
>   <pre>
>   <CONTACTS>
>       <PERSON>
>          <FIRSTNAME>Jeff</FIRSTNAME>
>           <LASTNAME>Peng</LASTNAME>
>  <snip>
> 
> <!-- Begin XSL code -->
> 
> <?xml version="1.0" encoding="utf-8"?>
> <xsl:stylesheet version="1.0" 
> xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
> <xsl:output method="text"/>
> 
> <xsl:template match="/">
>                
> <!-- This for-each outputs the links to below -->
> 
> <xsl:for-each select="//PERSON">   
> 
>     <xsl:value-of select="LASTNAME"/>
>     <xsl:value-of select="FIRSTNAME"/>
>         <xsl:choose>
>        
>                 <xsl:when test="string-length(PHONE) &lt; 1">
>                      <xsl:text>No Data present</xsl:text>
>                 </xsl:when>
>                 <xsl:otherwise>
>                     <xsl:attribute name="fname">Arial</xsl:attribute>
>                      <xsl:attribute name="size">5px</xsl:attribute>
>                     <xsl:value-of 
> select="PHONE"/><space/><xsl:value-of select="PHONE/@TYPE"/>
>                 </xsl:otherwise>
>         
>         </xsl:choose>
>         <xsl:value-of select="WORKADDR"/>
>         <xsl:value-of select="EMAIL"/>
>         <xsl:value-of select="TIMEZONE"/>
>         <xsl:value-of select="OTHERINFO"/>       
>    
> </xsl:for-each>    
> </xsl:template>
> </xsl:stylesheet>
> 
> 
> 
> __________________________________________________
> Do You Yahoo!?
> Tired of spam?  Yahoo! Mail has the best spam protection 
> around http://mail.yahoo.com 

Current Thread

PURCHASE STYLUS STUDIO ONLINE TODAY!

Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
Email
First Name
Last Name
Company
Subscribe in XML format
RSS 2.0
Atom 0.3
Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery ™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2013 All Rights Reserved.