Hi Sunil,

The functx:change-element-ns-deep should be able to help you out in the proper 
way.

http://www.xqueryfunctions.com/xq/functx_change-element-ns-deep.html

The functx functions are distributed with MarkLogic Server 4.1, you can import 
them with the following:

import module namespace functx = 
"http://www.functx.com<http://www.functx.com/>" at "/ 
MarkLogic/functx/functx-1.0-nodoc-2007-01.xqy";

Kind regards,
Geert




Drs. G.P.H. Josten
Consultant




<http://www.daidalos.nl/>
Daidalos BV
Source of Innovation
Hoekeindsehof 1-4
2665  JZ  Bleiswijk
Tel.: +31 (0) 10 850 1200
Fax: +31 (0) 10 850 1199
www.daidalos.nl<http://www.daidalos.nl/>
KvK 27164984


De informatie - verzonden in of met dit emailbericht - is afkomstig van 
Daidalos BV en is uitsluitend bestemd voor de geadresseerde. Indien u dit 
bericht onbedoeld hebt ontvangen, verzoeken wij u het te verwijderen. Aan dit 
bericht kunnen geen rechten worden ontleend.

From: [email protected] 
[mailto:[email protected]] On Behalf Of Sunil Reddy
Sent: donderdag 7 januari 2010 9:32
To: [email protected]
Subject: [MarkLogic Dev General] Eliminating xmlns attribute from an XML 
without using XSLT

Hi,

Following is the issue that I am facing with namespaces.

Let xml 1 be :

<P1 xmlns="namespace p1">
                <C1/>
</P1>

Let xml 2 be :

<C2 xmlns="namespace c2">content</C2>

Requriement is that, I want to add <C2> as another child node for <P1> to get 
the following output (observe that the namespace of <C2> should vanish).

<P1 xmlns="namespace p1">
                <C1/>
<C2 >content</C2>
</P1>

Temporarily, I have converted xml 2 to a string and removed xmlns attribute 
using string function and then converted that string to XML.
Is there any direct way for eliminating xmlns attribute from an XML without 
using XSLT?

Regards,
Sunil.


Disclaimer :-

"This communication contains information which is confidential and may also be
legally privileged.It is for the exclusive use of the intended recipient/s.

If you are not the intended recipient of this mail, please delete it 
immediately and notify the
sender on +91 22 6660 6600 or by return e-mail confirming such deletion. Any 
use, distribution,
disclosure or copying this electronic mail except by its intended recipient may 
be unlawful.

Rave has scanned this email for viruses but does not accept any responsibility 
once this email
has been transmitted."






_______________________________________________
General mailing list
[email protected]
http://xqzone.com/mailman/listinfo/general

Reply via email to