Subject: RE: XSL+XML -> Non-HTML
From: "Yvon Sauvageau" <ys@xxxxxxxxxxxx>
Date: Mon, 24 May 1999 10:42:12 -0400

I've never tried <xsl:text>, but I think you should write something like:

<?xml version="1.0"?>
<xsl:stylesheet xmlns:xsl="";>

<xsl:template match="/">
  <xsl:apply-templates select="ErrorList/Error"/>

<xsl:template match="/ErrorList/Error">
  <xsl:text>; </xsl:text>
  ErrDef %</xsl:text>

Hope this helps,

-- Yvon


Date: Thu, 20 May 1999 17:18:54 -0600
From: John Dunn <johnd@xxxxxxxxxxxxx>
Subject: XSL+XML -> Non-HTML


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

  <Error identifier="ERROR_NO_ERROR" numeric="00">
    <Description>no error</Description>
  <Error identifier="ERROR_FOO" numeric="01">
    <Description>foo happens</Description>

and would like to generate:

; 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


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">;

Any ideas/suggestions?

- -John

- --
John Dunn
Peak Audio, Inc.

 XSL-List info and archive:

Current Thread