|
[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] RE: xsl-list@lists.mulberrytech.com
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>	</xsl:text> <xsl:value-of select="age"/><xsl:text>	</xsl:text> <xsl:value-of select="college"/> <xsl:text>
</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>	</xsl:text> for tab and <xsl:text>
</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?
XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list
|
PURCHASE STYLUS STUDIO ONLINE TODAY!Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced! Download The World's Best XML IDE!Accelerate XML development with our award-winning XML IDE - Download a free trial today! Subscribe in XML format
|

Cart








