W3C home > Mailing lists > Public > xmlschema-dev@w3.org > April 2002

Re: Renaming elements???

From: Francis Norton <francis@redrice.com>
Date: Sun, 21 Apr 2002 19:36:23 +0100
Message-ID: <3CC306A7.4060103@redrice.com>
CC: xmlschema-dev@w3.org
Hi Kath,

KPRESCOTT@NSPCC.org.uk wrote:

>I've tried select Field1 ans Somethingelse1 but it doesn't like it
A SQL solution is a good idea, you could also create a view in SQL with 
field renaming, then query that.

>Is there a quick way to do this or do I have to treat the generated xml as a
>string and replace etc etc etc 
If you can't fix it in SQL then a fairly simple solution would be to use 
XSLT on the output - it should be supported by anything that's capable 
of supporting XML Schema.

Here's an example -

<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" 
    <!-- -->
    <!-- do a "pass-through" type transform  -->
    <xsl:template match="@* | node()">
            <xsl:apply-templates select="@* | node()"/>
    <!-- -->
    <!--  -->
    <xsl:template match="Field1">
        <xsl:element name="SomethingElse1">
            <xsl:apply-templates select="@* | node()"/>
    <!-- -->

Hope this helps -

Received on Sunday, 21 April 2002 14:36:43 UTC

This archive was generated by hypermail 2.3.1 : Wednesday, 7 January 2015 14:55:56 UTC