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

RE: Fix for correct handling of prefixed attribute nam

Subject: RE: Fix for correct handling of prefixed attribute names in the XPath Visualizer for Mozilla (Was: Re: pretty-printing XML into HTML)
From: "Lars Huttar" <lars_huttar@xxxxxxx>
Date: Thu, 18 Dec 2003 18:35:47 -0600
prefixed attribute in xpath
Dimitre wrote:
> Lars,
> 
> "Dimitre Novatchev" <dnovatchev@xxxxxxxxx> wrote in message
> news:brt26o$qlg$1@xxxxxxxxxxxxxxxx
> > Lars,
> 
> Fortunately, the fix is possible and is just 3 lines:
> 
> In mozDss4.xsl
> 
> change:
>     <xsl:template match="@*">
>       <xsl:variable name="belongs"
> select="count($selectedNodes|.)-count($selectedNodes)"/>
> 
> To:
> 
>   <xsl:template match="@*">
>     <xsl:variable name="belongs"
> select="count($selectedNodes|.)-count($selectedNodes)"/>
> 
>     <xsl:if test="contains(name(), ':')">
>       <xsl:call-template name="findNamespace"/>
>     </xsl:if>
> 
> 
> Could you, please,  try to test the mozXPV again?

Thanks for being quick with a fix.

This works, correcting the "attribute's namespace prefix
may not get declared" bug.

However it can result in duplicate namespace declarations on a given
element; e.g.
  <foo:test xmlns:foo="bigrabbit" foo:gg="3" foo:hh="4">
will be displayed as
  <foo:test xmlns:foo="bigrabbit" xmlns:foo="bigrabbit"
            xmlns:foo="bigrabbit" foo:gg="3" foo:hh="4">

I don't happen to know whether duplicate namespace declarations on a
single element would be considered an error. (I would think it would
be OK.) You probably can tell me.
Looking at http://www.w3.org/TR/REC-xml-names, I can't see anything that
forbids this (even if it's not pretty).

Regards,
Lars

> Even if there will not be a new release soon, people who are 
> interested may
> find the fix here and apply it easily.
> 
> 
> Thank you once again for pointing out the problem.
> 
> 
> Dimitre Novatchev.
> FXSL developer
> 
> http://fxsl.sourceforge.net/ -- the home of FXSL
> Resume: http://fxsl.sf.net/DNovatchev/Resume/Res.html
> 
> 
> 
> 
> 
> 
> 
>  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

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.