XML Programming
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me
Go Back   Dev Shed ForumsProgramming Languages - MoreXML Programming

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Dev Shed Forums Sponsor:
Be the architects of evolution and help create the mobile internet future. It’s your move---enter to win here!
  #1  
Old January 23rd, 2002, 07:22 AM
ccrawford ccrawford is offline
Junior Member
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jan 2002
Location: Liverpool
Posts: 2 ccrawford User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Transforming xml doc

Hi
I need to transform this xml doc:

<Recordset>
<row>
<CustomerID>ALFKI</CustomerID>
<CustomerName>Alfreds</CustomerName>
</row>
</Recordset>


To the following:

<rs:data>
<z:row> CustomerID="ALFKI" CustomerName="Alfreds"/>
</rs:data>

Any ideas

Reply With Quote
  #2  
Old January 23rd, 2002, 08:08 AM
Taradino Taradino is offline
Python Prophet
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jun 2001
Location: Amersfoort, The Netherlands
Posts: 45 Taradino User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 8
I guess something like this would work(left out all the usual XSL definitions):
Code:
<xsl:template match="Recordset/row">

<xsl:element name="data" namespace="rs">
    <xsl:element name="row" namespace="z">
        <xsl:attribute name="CustomerID">
                <xsl:value-of-select="CustomerID">
        </xsl:attribute>
        <xsl:attribute name="CustomerName">
                <xsl:value-of-select="CustomerName">
        </xsl:attribute>
    </xsl:element>
</xsl:element>

</xsl:template>


Note: this is completely untested, but I hope you get the point.

Also: take a look at the XSLT reference at zvon.org.
All the info you need about XSLT can be found there.

Edit: noted an error in the namespace definition.
__________________
Some people, when confronted with a problem, think “I know, I'll use regular expressions.” Now they have two problems. - Jamie Zawinski, in comp.lang.emacs

Reply With Quote
  #3  
Old January 23rd, 2002, 08:19 AM
ccrawford ccrawford is offline
Junior Member
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jan 2002
Location: Liverpool
Posts: 2 ccrawford User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Transform XML

my only problem now is how to create this or implement it using VB6. Any ideas?

Reply With Quote
Reply

Viewing: Dev Shed ForumsProgramming Languages - MoreXML Programming > Transforming xml doc


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 2 hosted by Hostway