Re: OT: [xslt] namespace bug ?



On Wed, Nov 05, 2003 at 07:38:52PM +0100, Bernhard Zwischenbrugger wrote:
> Hi Daniel, hi all
> 
> Thanks a lot for the xpath lesson.
> --------
> Now I understand how it works.
> But I have an off topic question:
> 
> If there is a namespace without prefix in the stylesheet, how
> can I make the xpath?
> 
> I have lots of stylewheets where input and output namespace is
> the same. If I don't want a prefixes in the result, the stylesheets
> are a little bit ugly. I have to migrate some stylesheets and I'm
> looking for an easy way to do it.
> 
> At the moment I see only the way to declare the namespace twice -
> with prefix und without prefix. 
> 
> Isn't there something like:
> <xsl:value-of select="'':a"/> od
> <xsl:value-of select="<default>:a"/>

  No there is no way around this, well maybe except
using the function local-name() and namespace-uri()
  http://www.w3.org/TR/xpath#function-local-name

  select="*[local-name() = 'a' and namespace-uri()() == '...']"
but I don't suggest using this.
 
 There is nothing special about having the prefix declared being ugly,
I really don't see you point there. I understand you have to fix your
stylesheets, and it's not fun, but it's true for any kind of bug fix.

Daniel

-- 
Daniel Veillard      | Red Hat Network https://rhn.redhat.com/
veillard@redhat.com  | libxml GNOME XML XSLT toolkit  http://xmlsoft.org/
http://veillard.com/ | Rpmfind RPM search engine http://rpmfind.net/



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]