This is the mail archive of the
xsl-list@mulberrytech.com
mailing list .
Re: tutorial xml to xml using xslt
- To: xsl-list at lists dot mulberrytech dot com
- Subject: Re: [xsl] tutorial xml to xml using xslt
- From: Robert Koberg <rob at koberg dot com>
- Date: Tue, 20 Feb 2001 16:45:43 -0800
- References: <BNEMICIEADHDDOIKLHNCAEHODIAA.elenz@xyzfind.com>
- Reply-To: xsl-list at lists dot mulberrytech dot com
yes, you are right. That's what I get for not testing it first...
The example I sent would work if you change the output to xml or replace the
output tags so that the angle brackets are entities, for example:
<foo>
----- Original Message -----
From: "Evan Lenz" <elenz@xyzfind.com>
To: <xsl-list@lists.mulberrytech.com>
Sent: Tuesday, February 20, 2001 4:35 PM
Subject: RE: [xsl] tutorial xml to xml using xslt
> "The text output method outputs the result tree by outputting the
> string-value of every text node in the result tree in document order
without
> any escaping."
> http://www.w3.org/TR/xslt#section-Text-Output-Method
>
> I don't know which XSLT processor you are using, but literal result
elements
> (or any elements for that matter) are not supposed to show up in the
> serialization when the output method is set to "text", unless they are
just
> characters, such as <element>, which would result in the unescaped
> <element>.
>
> The correct output to your example should be something like this instead:
>
> the title
> a para para para para para
>
> For transforming XML into XML, you should stick to the "xml" output
method,
> which is the default when not specified.
>
> Evan Lenz
> XYZFind Corp.
>
> > -----Original Message-----
> > From: owner-xsl-list@lists.mulberrytech.com
> > [mailto:owner-xsl-list@lists.mulberrytech.com]On Behalf Of Robert Koberg
> > Sent: Tuesday, February 20, 2001 3:39 PM
> > To: xsl-list@lists.mulberrytech.com
> > Subject: Re: [xsl] tutorial xml to xml using xslt
> >
> >
> > There is an excellent book on XSLT by Michael Kay on Wrox press called
> > Professional XSLT or something like that. If you need to get up to
speed
> > fast, this book is the best way (THE best book out there on the
subject).
> > Michael Kay is also the writer of Saxon (a very popular XSL
> > processor). The
> > book will show you how to do pretty much anything with XSLT
> > (which is alot).
> > Also there is a very active XSL list at:
> > http://www.mulberrytech.com/xsl/xsl-list/index.html
> >
> > What you want is very similar to outputting HTML so the tutorials you
have
> > found will work. Just change the xsl:output to xml rather than
> > html. Or you
> > could just output text and put in all the necessary info that way. (I
have
> > made a simple example below that outputs to text)
> >
> > Alternatively you might be interested in a utility on alphaworks:
> > http://www.alphaworks.ibm.com/
> > that will convert one xml document to another using the two
> > documents DTDs.
> > I don't remember the name, sorry.
> >
> > The example
> > =================================
> > xml document:
> >
> > <article>
> > <title> the title</title>
> > <para> a para para para para para</para>
> > </article>
> > ---------------------
> > an xsl:
> >
> > <?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="article">
> > <foo>
> > <xsl:apply-templates/>
> > </foo>
> > </xsl:template>
> >
> > <xsl:template match="title">
> > <foo.title><xsl:apply-templates/></foo.title>
> > </xsl:template>
> >
> > <xsl:template match="para">
> > <foo.para><xsl:apply-templates/></foo.para>
> > </xsl:template>
> >
> > </xsl:stylesheet>
> > -----------------------------------
> > the output:
> >
> > <foo>
> > <foo.title>the title</foo.title>
> > <foo.para>a para para para para para</foo.para>
> > </foo>
> >
> >
> > ----- Original Message -----
> > From: "Tom Belich" <TBelich@skcc.org>
> > To: <xsl-list@lists.mulberrytech.com>
> > Sent: Tuesday, February 20, 2001 2:46 PM
> > Subject: [xsl] tutorial xml to xml using xslt
> >
> >
> > > Does anyone know of a good tutorial for transforming xml to another
xml
> > > document using xslt? All the ones I've seen describe xml to html
> > > transformations. I need to transform an experiment xml file into an
xml
> > > file that I can add to my database.
> > >
> > > XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list
> > >
> >
> >
> > XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list
> >
>
>
> XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list
>
XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list