Re: [xsl] xml to xml transformation

Subject: Re: [xsl] xml to xml transformation
From: Wendell Piez <wapiez@xxxxxxxxxxxxxxxx>
Date: Mon, 28 Apr 2003 19:11:36 -0400
Steven,

Look up "identity transformation" (or just "identity transform") in the spec, the XSL FAQ, or the archives of this list. You want an extended version of it (the basic version just copies source to result).

To turn your attributes to elements, for example, you'll match the attributes with templates which instead of copying them (what the identity transform will generally do), creates elements with the same names as the attributes instead.

As for performance, sure, generally it'll be fine, unless you have very large batches or tiny pipes.

Write again if you get stuck.

Cheers,
Wendell

At 05:19 PM 4/28/2003, you wrote:
I need to do a minor transformation of large documents scheduled daily where the result will be the same as the original except one repeating element is transformed. What is the best way to transform just these elements while leaving the rest of the document the same? (I'm an xslt newbie by the way)
Is xslt appropriate performance wise?


Also, I haven't been able to get the transformation right. I need to take the value of an attribute and make it the element name as follows:

Transform:
<customFieldValue name="cust_1">Custom Field Value 1</customFieldValue>
<customFieldValue name="cust_2">Custom Field Value 2</customFieldValue>

To:
<cust_1>Custom Field Value 1</cust_1>
<cust_2>Custom Field Value 2</cust_2>


======================================================================
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