|
|
|||||||||
|
|||||||||
| |||||||||
|
|
|
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
|
|
Be the architects of evolution and help create the mobile internet future. It’s your move---enter to win here! |
|
#1
|
|||
|
|||
|
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 |
|
#2
|
|||
|
|||
|
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 |
|
#3
|
|||
|
|||
|
Transform XML
my only problem now is how to create this or implement it using VB6. Any ideas?
|
![]() |
| Viewing: Dev Shed Forums > Programming Languages - More > XML Programming > Transforming xml doc |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|