Home. 
.

transparent

transparent

transparent

Altova Mailing List Archives


Re: XML / XSLT map field names

From: Martin Honnen <mahotrash@-----.-->
To: NULL
Date: 12/4/2007 1:58:00 PM
rbrowning1958 wrote:

> New to XML and wonder whether I need to learn it to implement
> following - can it do this?
> 
> I need to accept data exported from relational databases and stored in
> XML. Problem I have is the field names exported will not be the field
> names I need for the import so I need to map these field names
> somehow. Is this something XSLT can handle easily, and if so can
> someone reccommend a good resource to learn this?

It is easy, start with the identity transformation template
   <xsl:template match="@* | node()">
     <xsl:copy>
       <xsl:apply-templates select="@* | node()"/>
     </xsl:copy>
   </xsl:template>
then add templates that transform your elements as needed e.g. if you 
want to map 'record' elements to 'item' elements you add
   <xsl:temlate match="record">
     <item>
       <xsl:apply-templates select="@* | node()"/>
     </item>
   </xsl:template>


-- 

	Martin Honnen --- MVP XML
	http://JavaScript.FAQTs.com/


transparent
Print
Mail
Like It
Disclaimer
.

These Archives are provided for informational purposes only and have been generated directly from the Altova mailing list archive system and are comprised of the lists set forth on www.altova.com/list/index.html. Therefore, Altova does not warrant or guarantee the accuracy, reliability, completeness, usefulness, non-infringement of intellectual property rights, or quality of any content on the Altova Mailing List Archive(s), regardless of who originates that content. You expressly understand and agree that you bear all risks associated with using or relying on that content. Altova will not be liable or responsible in any way for any content posted including, but not limited to, any errors or omissions in content, or for any losses or damage of any kind incurred as a result of the use of or reliance on any content. This disclaimer and limitation on liability is in addition to the disclaimers and limitations contained in the Website Terms of Use and elsewhere on the site.

.
.

transparent

transparent