RE: xml in, xml out

Subject: RE: xml in, xml out
From: Wendell Piez <wapiez@xxxxxxxxxxxxxxxx>
Date: Thu, 01 Jun 2000 12:34:14 +0100
Toby--

Also, in the XSLT spec 7.5, there's a template-driven identity transform
you could borrow (if you need something less straightforward than Mike's
elegant solution below). It's what you would adapt if you needed to provide
for some exception to your mimicking ("mimic all but the x elements...").

I'm not copying it in since I'm assuming all the list readers have a copy
of the XSLT Recommendation on their desks -- it's not such a huge document,
nor so difficult as all that. (Get XPath while you're at it. :-)

Looking at 7.5 also illuminates a point we came across last week -- that
attributes are disinherited, not being the children of their parents.
Notice that the identity transform must specify

<xsl:apply-templates select="@*|node()"/>

to get the attributes into the result tree. Otherwise, they would not be
processed (the default is, only recognized child elements -- select="*" --
get invited to the wedding).

Just in case:
http://www.w3.org/TR/xslt
http://www.w3.org/TR/xpath

Enjoy,
Wendell

At 12:48 PM 6/1/00 +0100, Mike wrote:
>> wanted:
>> an xsl stylesheet that mimics/recreates the xml it receives as input.\
>
><xsl:template match="/">
>   <xsl:copy-of select="."/>
></xsl:template>
>
>Mike Kay
>
>
> XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
>
>

======================================================================
Wendell Piez                            mailto:wapiez@xxxxxxxxxxxxxxxx
Mulberry Technologies, Inc.                http://www.mulberrytech.com
17 West Jefferson Street                    Direct Phone: 301/315-9635
Suite 207                                          Phone: 301/315-9631
Rockville, MD  20850                                 Fax: 301/315-8285
----------------------------------------------------------------------
  Mulberry Technologies: A Consultancy Specializing in SGML and XML
======================================================================


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


Current Thread