redundant namespaces

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

redundant namespaces

Immanuel Normann
Hi,

though redundant namespaces don't have any semantic consequences I'd like to minimize them for the sake of readability. How can I do this in exist (I am using 2.2)?

To give an sxample: In exist a query like this:

<a:x xmlns:a="a" xmlns:b="b">
    <b:y/>
    <b:z/>
</a:x>

returns this:

<a:x xmlns:a="a">
    <b:y xmlns:b="b"/>
    <b:z xmlns:b="b"/>
</a:x>

But I would like to remain the same - i.e. xmlns:b="b" declared only once in the root element.

Putting in the prolog:

declare copy-namespaces no-preserve, inherit;

doesn't help. (Has it any effect in exist, at all?)

Any ideas?

Regards,
Immanuel

------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, SlashDot.org! http://sdm.link/slashdot
_______________________________________________
Exist-open mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/exist-open
Reply | Threaded
Open this post in threaded view
|

Re: redundant namespaces

Matthias Guth
Hi Immanuel,

this should work (untested):

<a xmlns="a" xmlns:b="b">
    <b xmlns="b"/>
        <ba />
        <bb />
    <b xmlns="b"/>
</a>

<ba/> and <bb/> should have "b" as namespace. Maybe it's not the only (and not the best) solution, but the result looks more tidy.

Best,
Matthias

Am 14.10.2016 um 11:24 schrieb Immanuel Normann:
Hi,

though redundant namespaces don't have any semantic consequences I'd like to minimize them for the sake of readability. How can I do this in exist (I am using 2.2)?

To give an sxample: In exist a query like this:

<a:x xmlns:a="a" xmlns:b="b">
    <b:y/>
    <b:z/>
</a:x>

returns this:

<a:x xmlns:a="a">
    <b:y xmlns:b="b"/>
    <b:z xmlns:b="b"/>
</a:x>

But I would like to remain the same - i.e. xmlns:b="b" declared only once in the root element.

Putting in the prolog:

declare copy-namespaces no-preserve, inherit;

doesn't help. (Has it any effect in exist, at all?)

Any ideas?

Regards,
Immanuel


------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most 
engaging tech sites, SlashDot.org! http://sdm.link/slashdot


_______________________________________________
Exist-open mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/exist-open


------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, SlashDot.org! http://sdm.link/slashdot
_______________________________________________
Exist-open mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/exist-open
Reply | Threaded
Open this post in threaded view
|

Re: redundant namespaces

Matthias Guth
Ah made a mistake in the xml:

<a xmlns="a" xmlns:b="b">
    <b xmlns="b">
        <ba />
        <bb />
    </b>
    <b xmlns="b"/>
</a>


Am 14.10.2016 um 11:33 schrieb Matthias Guth:
Hi Immanuel,

this should work (untested):

<a xmlns="a" xmlns:b="b">
    <b xmlns="b"/>
        <ba />
        <bb />
    <b xmlns="b"/>
</a>

<ba/> and <bb/> should have "b" as namespace. Maybe it's not the only (and not the best) solution, but the result looks more tidy.

Best,
Matthias

Am 14.10.2016 um 11:24 schrieb Immanuel Normann:
Hi,

though redundant namespaces don't have any semantic consequences I'd like to minimize them for the sake of readability. How can I do this in exist (I am using 2.2)?

To give an sxample: In exist a query like this:

<a:x xmlns:a="a" xmlns:b="b">
    <b:y/>
    <b:z/>
</a:x>

returns this:

<a:x xmlns:a="a">
    <b:y xmlns:b="b"/>
    <b:z xmlns:b="b"/>
</a:x>

But I would like to remain the same - i.e. xmlns:b="b" declared only once in the root element.

Putting in the prolog:

declare copy-namespaces no-preserve, inherit;

doesn't help. (Has it any effect in exist, at all?)

Any ideas?

Regards,
Immanuel


------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most 
engaging tech sites, SlashDot.org! http://sdm.link/slashdot


_______________________________________________
Exist-open mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/exist-open



------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most 
engaging tech sites, SlashDot.org! http://sdm.link/slashdot


_______________________________________________
Exist-open mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/exist-open


------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, SlashDot.org! http://sdm.link/slashdot
_______________________________________________
Exist-open mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/exist-open