xsl-list
[Top] [All Lists]

Re: [xsl] xml->xsl using xslt

2008-02-11 10:04:19
Ignore the stuff under my name,, copy and paste error ;)

On Feb 11, 2008 9:02 AM, Spencer Tickner <spencertickner(_at_)gmail(_dot_)com> 
wrote:
Possible,, and exactly what XSLT does.

<?xml version='1.0'?>
<xsl:stylesheet version="1.0" 
xmlns:xsl="http://www.w3.org/1999/XSL/Transform";>

<xsl:template match="text1">
        <text2>
                <xsl:apply-templates/>
        </text2>
</xsl:template>

<xsl:template match="sample">
        <sample1>
                <xsl:apply-templates/>
        </sample1>
</xsl:template>

<xsl:template match="text()"><xsl:value-of select="."/></xsl:template>

</xsl:stylesheet>

Should do it

Spencer

<xsl:template match="text1">
  <text2>
     <xsl:applty-templates


On Feb 11, 2008 8:58 AM, Rose Rose <rose2577(_at_)yahoo(_dot_)com> wrote:
Hi all:

Is it possible to write an xslt to convert one xml
document to another by renaming the elements?
eg: if i have soemthing like this:

<text1>
<sample>data</sample>
</text1>

and I want to transform it to:

<text2>

<sample1>data</sample1>
</text2>

Can I do something like this in xslt?

Any suggestions/help appreciated.


      
____________________________________________________________________________________
Never miss a thing.  Make Yahoo your home page.
http://www.yahoo.com/r/hs


--~------------------------------------------------------------------
XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
or e-mail: 
<mailto:xsl-list-unsubscribe(_at_)lists(_dot_)mulberrytech(_dot_)com>
--~--




--~------------------------------------------------------------------
XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
or e-mail: <mailto:xsl-list-unsubscribe(_at_)lists(_dot_)mulberrytech(_dot_)com>
--~--

<Prev in Thread] Current Thread [Next in Thread>