Re: [xsl] Wildcards in namespaces ?

Subject: Re: [xsl] Wildcards in namespaces ?
From: George Cristian Bina <george@xxxxxxx>
Date: Thu, 01 Jul 2004 11:45:16 +0300
You can use the local-name [1] function to ignore the namespace:
  UML:targetElement changes to

Alternativelly if you have only a couple of possible namespaces you can declare them all and use or constructs to cover all the cases:
UML:targetElement changes to
*[self::UML1:targetElement or self::UML2:targetElement]
where UML1 and UML2 are mapped to the corresponding namespaces.


Hope that helps,
George Cristian Bina
<oXygen/> XML Editor & XSLT Editor/Debugger

Mick Baggen wrote:

I would appreciate some help with the following problem:

I'm writing a XSLT stylesheet for processing of UML XMI files. Alas,
depending on the UML tool, the elements in the XMI file are placed in a
different namespace. E.g. Poseidon ( uses the
namespace-URI xmlns:UML = "org.omg.xmi.namespace.UML", and Rational Rose
uses xmlns:UML = "href://org.omg/UML/1.3". However, all of them generate a
prefix UML: for their XMI elements.

Now my problem is: how can I define a namespace in my XSLT stylesheet so
that I can process all XMI files with the SAME stylesheet ? I came across a
remark on the XSLT FAQ suggesting that it is possible to use wildcards in
the namespace, eg <xsl:stylesheet xmlns:UML="*UML*">. And indeed, it seems
that Xalan 2.6.0 recognizes this notation. However, libxslt 1.1.6
( does not.

I tried to look it up in the XSLT and XML Namespace specifications, but I
couldn't find whether this is valid. Could someone help me out on this one ?
If it is NOT valid XSLT, is there another way to achieve the same result ?


Mick Baggen
Principal Consultant
Technolution B.V.
E-mail: 	 mick.baggen@xxxxxxxxxxxxxxx

--+------------------------------------------------------------------ XSL-List info and archive: To unsubscribe, go to: or e-mail: <mailto:xsl-list-unsubscribe@xxxxxxxxxxxxxxxxxxxxxx> --+--

Current Thread