Subject: XSL+XML -> Non-HTML From: John Dunn <johnd@xxxxxxxxxxxxx> Date: Thu, 20 May 1999 17:18:54 -0600 |
Hello- I am looking for examples of XSL for non-HTML output. I am trying to generate HTML documentation and an asm header file from the same XML file, and am having problems with plain text output. Say I have XML like <ErrorList> <Error identifier="ERROR_NO_ERROR" numeric="00"> <Description>no error</Description> </Error> <Error identifier="ERROR_FOO" numeric="01"> <Description>foo happens</Description> </Error> <ErrorList> and would like to generate: ; no error ; ErrDef $00,ERROR_NO_ERROR ; foo happens ErrDef $01,ERROR_FOO from the XML. I can generate plain text output ( using the IBM LotusXSL parser ), but am having problems with generating Tabs/Whitespace and Carriage Returns. When I apply this style sheet- <xsl:template match="CobraNet/ErrorList/Error"> ; <xsl:value-of select="Description"/> ; ErrDef $<xsl:value-of select="@numeric"/>,<xsl:value-of select="@identifier"/> </xsl:template> I get ; no error ; ErrDef $00,ERROR_NO_ERROR ; foo happens ; ErrDef $01,ERROR_FOO which is missing the returns after each error. More importantly, I would like my style sheet to not depend on whitespace, but specify that whitespace be generated. Perhaps more like ( note that xsl:generate is a hopeful fabrication on my part ): <xsl:template match="CobraNet/ErrorList/Error"> <xsl:generate "; "> <xsl:value-of select="Description"/> <xsl:generate "\r">; <xsl:generate ";\r">; <xsl:generate " ErrDef %"><xsl:value-of select="@numeric"/> <xsl:generate ","> <xsl:value-of select="@identifier"/> <xsl:generate "\r">; </xsl:template> Any ideas/suggestions? -John -- John Dunn Peak Audio, Inc. johnd@xxxxxxxxxxxxx http://www.peakaudio.com 303.449.9337x103 XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list
Current Thread |
---|
|
<- Previous | Index | Next -> |
---|---|---|
Newbie questions on "current" vs "c, Larry Fitzpatrick | Thread | RE: XSL+XML -> Non-HTML, Kay Michael |
Newbie questions on "current" vs "c, Larry Fitzpatrick | Date | RE: How to put a value-of select in, John Dunn |
Month |