Re: [xsl] Adding prefix to elements that belong to certain namespace (correction)

Subject: Re: [xsl] Adding prefix to elements that belong to certain namespace (correction)
From: Venkat Gyambavantha <vgyambav@xxxxxxxxx>
Date: Tue, 23 Sep 2003 16:13:26 -0700
Corrected so that my result is well-formed

<envelope xmlns="http://somenamespace.com";> <!-- prefix this element with
some prefix -->
   <Header xmlns=""> <!-- remove xmlns attribute for this element -->
      <from>me</from>
      <to>you</to>
 </Header>
 <body xmlns="">
    <command xmlns="http://somenamespace.com";> <!-- prefix this element with
the prefix used for envelope -->
      <type xmlns="">ADD</type>
  </command>
</body>
</envelope>

to

<pfx:envelope xmlns:pfx="http://somenamespace.com";>
   <Header>
      <from>me</from>
      <to>you</to>
 </Header>
 <body>
    <pfx:command>
      <type>ADD</type>
  </pfx:command>
</body>
</pfx:envelope>

----- Original Message -----
From: "G. Ken Holman" <gkholman@xxxxxxxxxxxxxxxxxxxx>
To: <xsl-list@xxxxxxxxxxxxxxxxxxxxxx>
Sent: Tuesday, September 23, 2003 3:39 PM
Subject: Re: [xsl] Adding prefix to elements that belong to certain
namespace


> At 2003-09-23 15:08 -0700, Venkat Gyambavantha wrote:
> >Is there a way to transform the following xml
> >
> ><envelope xmlns="http://somenamespace.com";>
> >    <Header>
> >       <from>me</from>
> >       <to>you</to>
> >  </Header>
> >  <body>
> >     <command xmlns="http://somenamespace.com";>
> >       <type>ADD</type>
> >   </command>
> ></body>
> ></envelope>
> >
> >to
> >
> ><pfx:envelope xmlns:pfx="http://somenamespace.com";>
> >    <Header>
> >       <from>me</from>
> >       <to>you</to>
> >  </Header>
> >  <body>
> >     <pfx:command>
> >       <type>ADD</type>
> >   </command>
> ></body>
> ></envelope>
>
> Your proposed result isn't well-formed ... which element types do you want
> to have a prefix, and which element types did you want to remove from the
> "somenamespace" namespace?
>
> In your input, *every* element type is in the somenamespace namespace ...
> you seem to imply in your output that you want only some of them.
>
> .............. Ken
>
> --
> Next public US delivery:        3-day XSLT/2-day XSL-FO 2003-10-13
> Next public European delivery:  3-day XSLT/2-day XSL-FO 2003-11-??
> Instructor-led on-site corporate, government & user group training
> for XSLT and XSL-FO world-wide:  please contact us for the details
>
> G. Ken Holman                 mailto:gkholman@xxxxxxxxxxxxxxxxxxxx
> Crane Softwrights Ltd.          http://www.CraneSoftwrights.com/s/
> Box 266, Kars, Ontario CANADA K0A-2E0    +1(613)489-0999 (F:-0995)
> ISBN 0-13-065196-6                       Definitive XSLT and XPath
> ISBN 0-13-140374-5                               Definitive XSL-FO
> ISBN 1-894049-08-X   Practical Transformation Using XSLT and XPath
> ISBN 1-894049-11-X               Practical Formatting Using XSL-FO
> Member of the XML Guild of Practitioners:     http://XMLGuild.info
> Male Breast Cancer Awareness  http://www.CraneSoftwrights.com/s/bc
>
>
>  XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
>
>


 XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list


Current Thread