This is the mail archive of the xsl-list@mulberrytech.com mailing list .


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: Re: Namespace questions


Hi Ayelet,


>  Can you give me an example. I am not sure where is each of the
commands
> that you mention.
> For example the line
> xmlns:m="B" exclude-result-prefixes="m" . Where should it appear ?

I can only repeat what I already said in my last message:

> > You can get rid of the namespace declaration on the child nodes by
> > adding the following to your xsl:stylesheet element:
                            ^^^^^^^^^^^^^^^^^^^^^^^^^^^

To summarise: you can add the namespace declaration and the
"exclude-result-prefixes" attribute (note these are not "commands") to
your ***xsl:stylesheet*** element.

Then the xsl:stylesheet element may look like this:

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


Dimitre.
 

Ayelet Kotzer wrote:
--------------------------------------------------------------------------------

Hi Dimitri,

  Can you give me an example. I am not sure where is each of the
commands
that you mention.
For example the line
xmlns:m="B" exclude-result-prefixes="m" . Where should it appear ?

Thanks,
Ayelet

Dimitre Novatchev wrote:

> Ayelet,
>
> You can get rid of the namespace declaration on the child nodes by
> adding the following to your xsl:stylesheet element:
>
> xmlns:m="B" exclude-result-prefixes="m"
>
> Then you'll get in your output:
>
> <A1>something </A1><A2 att="att1">something </A2>
>
> However, the top element(s) that declare the namespace will still be
> copied with the namespace declaration. So, the result of processing
> your fragment will look like this:
>
> <m:A xmlns:m="B"><A1>something </A1><A2 att="att1">something
> </A2></m:A>
>
> Obviously, you must have a separate template that matches all
> m:yourNames elements you'd like to copy without the namespace
> declaration on them. Then in this template use xsl:element and
> xsl:attribute and specify the local-name().
>
> Dimitre.
>
> 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>
>



__________________________________________________
Do You Yahoo!?
Yahoo! Photos - Share your holiday photos online!
http://photos.yahoo.com/

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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]