OT: [xslt] namespace bug ?



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"/>


Here the way I do it at the moment:
============================================================

xml:
----
<a xmlns="http://asdf";>
<c/>
</a>


xslt:
========
<?xml version="1.0"?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform";
xmlns:b="http://asdf";
xmlns="http://asdf";
 exclude-result-prefixes="b"
>
<xsl:output method="xml" encoding="utf-8" indent="yes"/>

<xsl:template match="/">
<all>
<xsl:copy-of select="b:a"/>
</all>
</xsl:template>


</xsl:stylesheet>
-------------------------

result:
<all xmlns="http://asdf";>
  <a>
<c/>
</a>
</all>
===========================================================

Isn't there an easier was to do that?

thanks

Bernhard




-------------------------------------------------
This mail sent through IMP: http://horde.org/imp/




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