Re: [xslt] Problem with creating namespace in the stylesheet



Petr Novak wrote:

I can create it by (I have defined XML namespace alias as a "xslo"):
<xsl:template match="/">
	<xslo:stylesheet xmlns:netopeer="http://www.liberouter.org";>

In that case xmlns:netopeer is namespace declaration.

		<xsl:attribute name="xmlns:netopeer">
			<xsl:text>http://www.liberouter.org</xsl:text>
		</xsl:attribute>

In that case you want to create attribute named xmlns:netopeer. This is forbidden as xmlns is reserved for namespace declaration. The point is that namespace declaration is not the same thing as attribute even if it uses same syntax.


Is it possible to create as a output the XSLT stylesheet with some
namespace? (Not if namespace is defined in the processed XSLO stylesheet)

You probably want to create some elements or attributes in a given namespace. So go ahead and create such element and attributes. XSLT processor will add all necessary namespace declarations for you.


				Jirka

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

Attachment: smime.p7s
Description: S/MIME Cryptographic Signature



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