Subject: RE: [xsl] Simple XML to XML transformation question From: "Nick Roberts" <nick_roberts5@xxxxxxxxxxx> Date: Wed, 17 Nov 2004 18:48:28 +0000 |
From: "Joe Heidenreich" <HeidenreichJ@xxxxxxxx> Reply-To: xsl-list@xxxxxxxxxxxxxxxxxxxxxx To: <xsl-list@xxxxxxxxxxxxxxxxxxxxxx> Subject: RE: [xsl] Simple XML to XML transformation question Date: Wed, 17 Nov 2004 13:35:06 -0500
What translation environment are you using?
I'm guessing you are using MSXML and your transformation occurs in your browser, view the source to get the proper xml file.
-Joe
-----Original Message----- From: Nick Roberts [mailto:nick_roberts5@xxxxxxxxxxx] Sent: Wednesday, November 17, 2004 1:29 PM To: xsl-list@xxxxxxxxxxxxxxxxxxxxxx Subject: RE: [xsl] Simple XML to XML transformation question
Appreciate the fast respone guys...
However, both those examples seem to just output the value of the attributes...
i.e.
ChevyDodgeFord ... that's all?
>From: "Joe Heidenreich" <HeidenreichJ@xxxxxxxx>
>Reply-To: xsl-list@xxxxxxxxxxxxxxxxxxxxxx
>To: <xsl-list@xxxxxxxxxxxxxxxxxxxxxx>
>Subject: RE: [xsl] Simple XML to XML transformation question
>Date: Wed, 17 Nov 2004 13:23:16 -0500
>
>You are calling a specific template "Car" but you never defined it. I'm
>also not sure what "cd" is, but since you don't have any "cd" elements you
>won't match them. It should be matching on "Car".
>
><?xml version="1.0" encoding="ISO-8859-1"?>
><xsl:stylesheet version="1.0"
>xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
><xsl:output method="xml" version="1.0" encoding="iso-8859-1" indent="yes"/>
><xsl:template match="/">
> <xsl:apply-templates/>
></xsl:template>
>
><xsl:template match="Data">
> <Car><xsl:apply-templates/></Car>
></xsl:template>
>
><xsl:template match="Car">
> <Model><xsl:apply-templates/></Model>
></xsl:template>
>
></xsl:stylesheet>
>
>I think that should do the trick.
>
>-Joe
>
>-----Original Message-----
>From: Nick Roberts [mailto:nick_roberts5@xxxxxxxxxxx]
>Sent: Wednesday, November 17, 2004 1:06 PM
>To: xsl-list@xxxxxxxxxxxxxxxxxxxxxx
>Subject: [xsl] Simple XML to XML transformation question
>
>
>Hi,
>
>I'm basically trying to modify the name of root node element...
>
>with the following XML file...
>
><?xml-stylesheet type="text/xsl" href="renewal.xsl"?>
><Data>
> <car>Chevy</car>
> <car>Dodge</car>
> <car>Ford</car>
></Data>
>
>How could I change the <Data> element to <Car>
>
>and the <Car> tags to <Model>
>
>My initial attempt at an XSL file was as follows...
>
><?xml version="1.0" encoding="ISO-8859-1"?>
><xsl:stylesheet version="1.0"
>xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
><xsl:output method="xml" version="1.0" encoding="iso-8859-1" indent="yes"/>
><xsl:template match="Data">
> <Car>
> <xsl:apply-templates select="Car"/>
> </Car>
></xsl:template>
> <xsl:template match="cd">
> <Model>
> </Model>
></template>
></xsl:stylesheet>
>
>Is seems to output a blank page??
>
>Any ideas guys?
>
>Cheers,
>
>Nick
Current Thread |
---|
|
<- Previous | Index | Next -> |
---|---|---|
RE: [xsl] Simple XML to XML transfo, Joe Heidenreich | Thread | Re: [xsl] Simple XML to XML transfo, David Carlisle |
[xsl] Importing external XML docume, Wong Chin Shin | Date | Re: [xsl] Importing external XML do, JBryant |
Month |