FYI, again better on the ML list but functx comes with ML you don't have to 
reimplement it

Sent from my iPad (excuse the terseness)
David A Lee
[email protected]<mailto:[email protected]>


On Sep 7, 2012, at 8:46 AM, "Mailing Lists Mail" 
<[email protected]<mailto:[email protected]>> wrote:

Dear All,
I have the following requirement:

There are 40 documents in my Mark Logic DB.

I am trying to create one big XML that contains the dump of all the 40 
documents.. ( small ones each is 32 kb)

so it will look like:

<container >
 <document id = "filename1.xml">
   contents of this fi
</documen
<document id = "filename2.xml">
   contents of this filement it

</document>

<document id = "filename3.xml">
   contents of this file
</document>
</container>

 and so on and so forth...

The thing I also want to do is while making this tree, I must delete all the 
@flag attributes from <request> elements in all the documents.. SO the 
Container element that I am making should not contain @flag for the <request> 
...


My Attempt:

declare namespace functx = "http://www.functx.com";;
declare function functx:remove-attributes
 ($element as element(), $names as xs:string*) as element() {
   element { node-name($element)}
           { $element/@*[not(name() = $names)],
             for $child in $element/node()
             return if ($child instance of element())
                    then functx:remove-attributes-deep($child, $names)
                    else $child }
};


<container>
{
for $doc in doc()

  let $filename:= document-uri($doc)



return (
<document id = "{$NAME}">
{

(: Will the below work?? :)
 functx:remove-attributes($doc//*,'flag') ,

 (:
 i now need to dump the contents ... How do I do this??
:)

 }
</document>
)
}
</container>

Any help will be highly appreciated...
Thanks..
Dak.

_______________________________________________
[email protected]<mailto:[email protected]>
http://x-query.com/mailman/listinfo/talk
_______________________________________________
[email protected]
http://x-query.com/mailman/listinfo/talk

Reply via email to