Hello Micheal
Indeed, it is a pity that this idea was not accepted. it would have been very usefull !
thank you
Philippe



De :        Michael Kay <mike@saxonica.com>
A :        Mailing list for the SAXON XSLT and XQuery processor <saxon-help@lists.sourceforge.net>
Date :        01/08/2013 18:10
Objet :        Re: [saxon] "is it possible to programmatically set the        xpath_default_namespace and as well have more that one xpath        default namespaces ?"





The XPath default namespace is part of the static context, so it cannot be changed during execution (it's used by the compiler while generating code).

You'll have to do this by explicit predicates testing the value of namespace-uri().

I've always thought it would be quite nice to define a namespace as the union of several other namespaces so that the nametest u:name matches names in three different namespaces - and of course that union namespace could then be made the default - but there's nothing like that in the current specs, and when I've floated the idea there's been strong opposition.

Michael Kay
Saxonica


On 1 Aug 2013, at 16:20, philippe.favrais@continental-corporation.com wrote:

Hello,

is it possible to programmatically set the xpath_default_namespace and as well have more that one xpath default namespaces ?


in fact i would like to pass as a parameter to my xsl what xpath_default_namespaces to work with and filter all others.
My use case is that with the same XSL i would like to be able to process some elements having various namespace.


In the below example i would like to get all DIO elements of the namespace n1 and n2 and in another time get all DIO of namespace n1 and n3

my input xml file

                       
<PIN_1>
                               
<n0:DIO name="a"/>
                               
<n1:DIO name="b"/>                                
                               
<n2:DIO name="c"/>
                               
<n3:DIO name="d"/>/>
                       
</PIN_1>


Ideally , i would like to programmatically set the default namespace and also be able to have more than one xpath default namespace

xpath_default_namespace = n1 and n2
<xsl:for-each select="//DIO">   --->  and get as a result <n1:DIO name="b"/> <n2:DIO name="c"/>



Unfortunalty i can't set several xpath_default_namespace but maybe some of you have an idea.


Thank you

Philippe


------------------------------------------------------------------------------
Get your SQL database under version control now!
Version control is standard for application code, but databases havent
caught up. So what steps can you take to put your SQL databases under
version control? Why should you start doing it? Read more to find out.

http://pubads.g.doubleclick.net/gampad/clk?id=49501711&iu=/4140/ostg.clktrk_______________________________________________
saxon-help mailing list archived at
http://saxon.markmail.org/
saxon-help@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/saxon-help
------------------------------------------------------------------------------
Get your SQL database under version control now!
Version control is standard for application code, but databases havent
caught up. So what steps can you take to put your SQL databases under
version control? Why should you start doing it? Read more to find out.
http://pubads.g.doubleclick.net/gampad/clk?id=49501711&iu=/4140/ostg.clktrk_______________________________________________
saxon-help mailing list archived at
http://saxon.markmail.org/
saxon-help@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/saxon-help