Hello Dimitre,
The solution Ken and Michael told me to use is to check in all my xpath query the namespaces i want to get.

<PIN_1>
        <DIO name="1"/>
        <n1:DIO name="2"/>
        <n2:DIO name="3"/>
        <ADC name="a"/>
        <n1:ADC name="b"/>
</PIN_1>

<xsl:variable name="ns" as="xs:string*" select="('http://www.renault','')"/>
<xsl:template match="*:DIO[namespace-uri(.)=$ns]">
        DIO <xsl:value-of select="@name"/>
        <xsl:apply-templates/>
</xsl:template>

Unfortunatly with this solution i have put the predicate (to filter the namespaces) in all my xpaths. Then the xpath become quite difficult ot read

To my opinion, the solution with a union of several xpath_default_namespace  would have been almost without impact on my xls code and the xpath query easier to read.

Thank you
Philippe




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




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

I voiced such opposition, because if we have a unprefixed  name that
can belong to N namespaces, then it becomes impossible to decide at a
glance, which name (of possibly N) we are dealing with.

To avoid this problem, we will have to use a namespace prefix --
exactly as we do now, not having a union of default namespaces.

For example, the current rule that all user-defined functions must be
in some namespace (and we need to prefix the function name in any
reference to it) is a good one, because this allows us to know
immediately:

1. That this isn't a standard XPath function.

2. To which exactly function library (module) this function belongs to.

In case we could have all function names unprefixed, this would make 1
and 2 above very difficult (and time-consuming, and error-prone) to
deduce.


Cheers,
Dimitre

On Thu, Aug 1, 2013 at 9:01 AM, Michael Kay <mike@saxonica.com> wrote:
>
>
> 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




--
Cheers,
Dimitre Novatchev
---------------------------------------
Truly great madness cannot be achieved without significant intelligence.
---------------------------------------
To invent, you need a good imagination and a pile of junk
-------------------------------------
Never fight an inanimate object
-------------------------------------
To avoid situations in which you might make mistakes may be the
biggest mistake of all
------------------------------------
Quality means doing it right when no one is looking.
-------------------------------------
You've achieved success in your field when you don't know whether what
you're doing is work or play
-------------------------------------
Facts do not cease to exist because they are ignored.
-------------------------------------
Typing monkeys will write all Shakespeare's works in 200yrs.Will they write
all patents, too? :)
-------------------------------------
I finally figured out the only reason to be alive is to enjoy it.

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