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

RE: xsl-list@lists.mulberrytech.com

Subject: RE: xsl-list@l...
From: "Vasu Chakkera" <vasucv@xxxxxxxxxxx>
Date: Wed, 07 Aug 2002 18:31:22 +0000
html carraige return

Hi Amanda..
The unicode symbol for tab is #x9;
so u have to use this for producing a tab in the output..
an example would be..
if your xml file is
<students>
<student>
<name>A.J.Nonameson</name>
<age>23</age>
<college>Best-college</college>
</student>
<student>
<name>P.J.Somenameson</name>
<age>23</age>
<college>Worst-college</college>
</student>
</students>
-----
and xsl would be
<?xml version="1.0"?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:output method="text" omit-xml-declaration="yes"/>
<xsl:template match="student">
<xsl:value-of select="name"/><xsl:text>&#x9;</xsl:text>
<xsl:value-of select="age"/><xsl:text>&#x9;</xsl:text>
<xsl:value-of select="college"/>
<xsl:text>&#xa;</xsl:text>
</xsl:template>
</xsl:stylesheet>
---
to produce a result..
A.J.Nonameson 23 Best-college
P.J.Somenameson 23 Worst-college
-----
The important things when dealing with text output is..
1. <xsl:output> declaration...
you should declare the method to be text and make sure you omit-xml- declaration
** <xsl:output method="text" omit-xml-declaration="yes"/> **
2. Unicode Symbols for characters like tab,newline,carraige return, space etc..


tab ---> #x9
space ---->#x20
newline --->#xa
carraige return-->#xD
check up the above code to see how these are used ( u should use them with <xsl:text></xsl:text> ..as in <xsl:text>&#x9;</xsl:text> for tab
and <xsl:text>&#xa;</xsl:text> for a newline..


Hope this helps
Vasu







>
> Hello, List,
> I have been asked to add a feature to our web application that will
> transform our XML into tab-delimited text data, displayed in a
> new window,
> so that the user can then save it for later use in that
> format.  Unfortunately, I am currently limited to what can be done with
> MSXML 2.5 (been told we have to support IE5 without any upgrades to the
> parser).
>
> Although I've done a lot of XML-to-XML and XML-to-HTML transformations,
> I've never done XML-to-text before.  Can anyone direct me on how I would
> (a) cause tabs to appear in the output, and (b) cause linebreaks
> to appear
> in the output?


_________________________________________________________________ Chat with friends online, try MSN Messenger: http://messenger.msn.com


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



Current Thread
  • xsl-list@l...
    • Amanda Birmingham - Wed, 7 Aug 2002 12:48:27 -0400 (EDT)
      • <Possible follow-ups>
      • Vasu Chakkera - Wed, 7 Aug 2002 14:31:30 -0400 (EDT) <=
        • sascha - Mon, 12 Aug 2002 10:00:12 -0400 (EDT)
          • Paul Tremblay - Mon, 12 Aug 2002 17:32:16 -0400 (EDT)
          • sascha - Tue, 13 Aug 2002 02:26:15 -0400 (EDT)
          • sascha - Tue, 13 Aug 2002 05:05:58 -0400 (EDT)

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.