xsl-list
[Top] [All Lists]

Re: [xsl] namespace problem

2014-09-04 02:15:36
Hi Wolfgang,

thanks for your reaction

On 09/03/14 17:37, Wolfgang Laun wolfgang(_dot_)laun(_at_)gmail(_dot_)com wrote:
You need to match a document that has elements <doc>, <p>, <Char> that are
in *no namespace*, where the name has no namespace name, just a locsl name.
Your output document is supposed to be in the namespace "
http://www.w3.org/1999/xhtml";, and you'd like to use the shortened notation
known as *default namespace*. In the 2nd version of your XSLT you introduce
a default namespace, and, sure enough, the matches written without a prefix
aren't in the no namespace ghetto any more.

That puzzles me a bit, because templates p and Char *do* match. The difference is the char template, the char elements are now part of the documentnode in the blip variable. I tried to change the namespace of that documentnode, but up till now, I have not succeeded.


You may, however, at any time cancel the definition for the default
namespace by writing

     xmlns=""

and everything below that has no prefix hasn't a namespace name either.


Assuming this has to be added to a template match, I tried this:

  <xsl:template xmlns='' match='char' mode='#all'>
    <c><xsl:apply-templates /></c>
  </xsl:template>

But that does not work either, nor when I change that to the xhtml namespace.

Maybe I misunderstood you. Thanks for the explanation; I realize more and more it is essential to have a good understanding of namespaces...

regards, Ruud
--~----------------------------------------------------------------
XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list
EasyUnsubscribe: http://lists.mulberrytech.com/unsub/xsl-list/1167547
or by email: xsl-list-unsub(_at_)lists(_dot_)mulberrytech(_dot_)com
--~--

<Prev in Thread] Current Thread [Next in Thread>