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 file
</document>

<document id = "filename2.xml">
   contents of this file
</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]
http://x-query.com/mailman/listinfo/talk

Reply via email to