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

Re: Problem with XSL and Namespace

Subject: Re: Problem with XSL and Namespace
From: Jeni Tennison <jeni@xxxxxxxxxxxxxxxx>
Date: Tue, 15 Oct 2002 18:13:04 +0100
ref xlink href
Hi Giovani,

> But, if I define in the "mother" stylesheet this
> 
> <xsl:stylesheet version="1.0"
> xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
> xmlns:axsl="http://www.w3.org/1999/XSL/TransformAlias">
>         <xsl:namespace-alias stylesheet-prefix="axsl"
> result-prefix="xsl"/>
>         <axsl:template match="/">
>                 <root xmlns:xlink="http://www.w3.org/1999/xlink">
>                         ...
>                       <node>
>                         <ref xlink:href="#products"/>
>                       </node>
>                         ...
>                 </root>
>         </axsl:template>

I wouldn't expect you to get anything out of that stylesheet. The
'template' is in the alias namespace, not the XSLT namespace, so the
template should be treated like any other data element at the top
level of the stylesheet. Are you sure that's the 'mother' stylesheet
that you're using?

> the result XSL in "son" stylesheet is:
>
> <axsl:stylesheet xmlns:axsl="http://www.w3.org/1999/XSL/Transform"
> xmlns:xlink="http://www.w3.org/1999/xlink"
> xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">
>
>    <axsl:template match="/">
>       <root>
>                 ...
>               <node>
>                         <ref xlink:href="#products"/>
>               </node>
>                 ...
>         </root>
>    </axsl:template>
>
> The namespace xmlns:xlink="http://www.w3.org/1999/xlink" was retired of
> "root" element and put in "stylesheet" element.
> Why? 

Maybe because it doesn't matter where the namespace is declared --
there's still a namespace node for the XLink namespace on the <root>
element. My guess is that your *actual* 'mother' stylesheet has the
XLink namespace declared on the <xsl:stylesheet> element as well as on
the <root> element and that Saxon is just omitting the duplicated
namespace declaration.

> So, the final XML document generated is:
>
> <root>
>         ...
>       <node>
>                 <ref xlink:href="#products"/>
>       </node>
>         ...
> </root>

Really? That's very strange, because when I try your 'son' stylesheet
above with Saxon 6.5.2 I get:

<root xmlns:xlink="http://www.w3.org/1999/xlink">
  ...
  <node><ref xlink:href="#products"/></node>
  ...
</root>

as expected. Can you check your results again?

Cheers,

Jeni

---
Jeni Tennison
http://www.jenitennison.com/


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


Current Thread

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.