[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

Namespace question

Subject: Namespace question
From: Ayelet Kotzer <akotzer@xxxxxxxxxxx>
Date: Wed, 03 Jan 2001 16:21:59 -0800
 Namespace question
Ayelet Kotzer wrote:
>
> (Desired) Output:
>    <A >
>         <A1>something </A1>
>          <A2  att="att1>something </A2>
>     </A>
>
> What I got is something like this:
> <A1   xmlns:m="B">something </A1>
>   <A2  xmlns:m="B"  att="att1 >something </A2>
>



Dimitre Novatchev wrote:


  <xsl:stylesheet version="1.0"
          xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
          xmlns:m="B" exclude-result-prefixes="m" >




Thanks. But -
My problem is a little bit more complicate then what I described first.


The xml root out file can be different.

<xsl:template match="/">
  <xsl:if test=".//E1">
   <xsl:apply-templates select=".//E1"/>
  </xsl:if>
  <xsl:if test=".//E2">
   <xsl:apply-templates select=".//E2"/>
  </xsl:if>
 </xsl:template>


<xsl:template match="E1">
    <xsl:element name="D1">
            copy sourc elements
    </xsl:element>
 </xsl:template>

<xsl:template match="E2">
    <xsl:element name="D2">
            copy sourc elements
    </xsl:element>
 </xsl:template>



One output should be with the namespace and the other without :
<D1   xmlns:m="B">
         <A1>something </A1>
          <A2  att="att1>something </A2>
 </D1>



<D2  >
         <A1>something </A1>
          <A2  att="att1>something </A2>
 </D2>

Where I use  xsl:copy  the xmlns will be copy - which I am not
interested in.

If I write the exclude-result-prefixes="m" as part of the xsl:stylesheet
then none of them will have the namespace.

I tried to add the namespace to the root  as attribute and fail. I have
tried  as namespace name and I didn't got
what I expected wither.

Your help will be more then welcome.

Thanks,
Ayelet











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


Current Thread
  • Namespace question
    • Ayelet Kotzer - Wed, 3 Jan 2001 19:24:12 -0500 (EST) <=
      • <Possible follow-ups>
      • Kay Michael - Thu, 4 Jan 2001 05:28:31 -0500 (EST)

PURCHASE STYLUS STUDIO ONLINE TODAY!

Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
Email
First Name
Last Name
Company
Subscribe in XML format
RSS 2.0
Atom 0.3
Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery ™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2013 All Rights Reserved.