Re: [xslt] Bug(?) in xmlns handling



Jonathan S. Shapiro wrote:

Then what is the proper way to emit a namespace declaration.

You do not have to emit namespace declarations, this is work of XSLT processor. You just output elements and attributes in particular namespace and rest is done automatically. E.g. you can write

<xsl:template ...>
  <svg xmlns="http://www.w3.org/2000/svg";>
  ...

to generate svg element in the SVG namespace.

In rare cases when you need to have better control on prefixes used you can use "hack" and copy nodes from namespace axis of some element which you temporarily create and store into variable.

--
------------------------------------------------------------------
  Jirka Kosek     e-mail: jirka kosek cz     http://www.kosek.cz
------------------------------------------------------------------
  Profesionální školení a poradenství v oblasti technologií XML.
     Podívejte se na náš nově spuštěný web http://DocBook.cz
       Podrobný přehled školení http://xmlguru.cz/skoleni/
------------------------------------------------------------------
                   Nejbližší termíny školení:
    ** XSLT 23.-26.10.2006 ** XML schémata 13.-15.11.2006 **
     ** DocBook 11.-13.12.2006 ** XSL-FO 11.-12.12.2006 **
------------------------------------------------------------------
  http://xmlguru.cz    Blog mostly about XML for English readers
------------------------------------------------------------------

Attachment: signature.asc
Description: OpenPGP digital signature



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