[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] Re: Problem with XSL and Namespace
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
|
PURCHASE STYLUS STUDIO ONLINE TODAY!Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced! Download The World's Best XML IDE!Accelerate XML development with our award-winning XML IDE - Download a free trial today! Subscribe in XML format
|