[MarkLogic Dev General] How to add namespace to an element

Lee, David dlee at epocrates.com
Wed Sep 1 08:05:05 PDT 2010


Sorry, typo:

 

element { QName("http://aaa.com/prod","x") } { "s" }

 

Produces:

 

<x xmlns="http://aaa.com/prod">s</x>

 

 

From: general-bounces at developer.marklogic.com
[mailto:general-bounces at developer.marklogic.com] On Behalf Of Lee, David
Sent: Wednesday, September 01, 2010 11:03 AM
To: General Mark Logic Developer Discussion
Subject: Re: [MarkLogic Dev General] How to add namespace to an element

 

try:

 

element { QName("http://aaa.com/prod","x" } { "s" }

 

 

From: general-bounces at developer.marklogic.com
[mailto:general-bounces at developer.marklogic.com] On Behalf Of Jonna
Marry
Sent: Wednesday, September 01, 2010 9:56 AM
To: General Mark Logic Developer Discussion
Subject: [MarkLogic Dev General] How to add namespace to an element

 

Hi ,

How to add namespace to an element using xquery with out prefix?

I tried with the following sample

xquery version "1.0-ml";
element x{
QName('http://aaa.com/prod',  's')
 }

It give output :
  <x xmlns:_1="http://aaa.com/prod">_1:s</x>

Unwanted text like :_1 and _1:s is added as prefix. But I want the
namespace should be added in the format below: 

<x xmlns:="http://aaa.com/prod">---Some data------</x>

Regards,
Jonna M

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://developer.marklogic.com/pipermail/general/attachments/20100901/bfbfc0b1/attachment.html 


More information about the General mailing list