Wrox Programmer Forums
Go Back   Wrox Programmer Forums > XML > XML
|
XML General XML discussions.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the XML section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old December 15th, 2009, 05:47 PM
Registered User
 
Join Date: Dec 2009
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Default Renaming tags

I know there have been many postings on this subject but this one is a little differant.

I have an XML structure as follows:

<Record>
<TD>BARR</TD>
<TD>CYRUS WILLIAM</TD>
<TD/>
<TD>47</TD>
<TD>Bellingen</TD>
<TD/>
<TD>Anglican</TD>
<TD>B1</TD>
<TD>17</TD>
<TD>1</TD>
<TD>10835</TD>
</Record>

I would like to have code to change the structure to:

<Record>
<FamilyName>BARR</FamilyName>
<GivenNames>CYRUS WILLIAM</GivenNames>
<DOB></DOB>
<Age>47</Age>
<Cemetery>Bellingen</Cemetery>
<Section></Section>
<Denomination>Anglican</Denomination>
<Row>B1</Row>
<Lot>17</Lot>
<OccNo>1</OccNo>
<RegisterId>10835</RegisterId>
</Record>

There a few thousand records so doing it by hand is out of the question.

Regards Baudwalker
 
Old December 15th, 2009, 05:56 PM
samjudson's Avatar
Friend of Wrox
 
Join Date: Aug 2007
Posts: 2,128
Thanks: 1
Thanked 189 Times in 188 Posts
Default

Not really that difference:

<xsl:template match="Record">
<Record>
<FamilyName><xsl:value-of select="TD[1]"/></FamilyName>
...
__________________
/- Sam Judson : Wrox Technical Editor -/

Think before you post: What have you tried?





Similar Threads
Thread Thread Starter Forum Replies Last Post
Renaming File ayazhoda Access VBA 3 April 24th, 2007 05:43 AM
Renaming App_Code jacob .NET Web Services 5 July 4th, 2006 12:20 AM
Renaming filename simone_s Java Basics 2 May 18th, 2006 12:17 PM
Renaming with XML tags? johrik XSLT 1 February 12th, 2004 03:49 PM
Renaming a dB ioates SQL Server 2000 3 July 2nd, 2003 02:48 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.