This is the second question related to MarkLogic content pump utility. 
Question: I am ingesting a single aggregated xml document with multiple records 
into MarkLogic Content pump. I expect the the aggregate XML document to be 
transformed to a different format and also the content pump utility to generate 
multiple xml documents from a single input large xml document.?

Example: Aggregated input xml document: 
<root>
        <data>Bob</data>
        <data>Vishal></data>
</root>

Expected Output from content pump : Two documents with a different format:

Document 1 :
        <data1>Bob</data1>
Document 2
        <data1>Vishal</data1>
:

I am using following Xslt to split the above document into two nodes:
        <?xml version="1.0" encoding="UTF-8"?>
        <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform";
        xmlns:xs="http://www.w3.org/2001/XMLSchema";
        exclude-result-prefixes="xs"
        version="2.0">
        <xsl:template match="root">
                <xsl:apply-templates select="data"></xsl:apply-templates>
        </xsl:template>
        <xsl:template match="data">
        <data1>
                <xsl:value-of select=".”/>
        </data1>
        </xsl:template>

XSLT output:
        <?xml version="1.0" encoding="UTF-8"?>
                <data1>Bob</data1>
                <data1>Vishal</data1>

Following is the xquery transform, which calls the above the "xslt file" to 
generate two nodes:


        xquery version "1.0-ml";
        module namespace example = "http://marklogic.com/example";;

        declare function example:transform(
        $content as map:map,
        $context as map:map
        ) as map:map*
        {
                let $attr-value := 
                (map:get($context, "transform_param"), "UNDEFINED")[1]
                let $the-doc := map:get($content, "value")

                let $let-output:=  
xdmp:xslt-invoke("/marklogic.rest.transform/simple-xsl/assets/transform.xsl", 
$the-doc )
                return (map:put(
                        $content, "value",
                                $let-output
                        ),$content)
        };

The above Xquery transforms fails and returns a error.So how to modify above 
xquery program so that it generates and indexes multiple            transformed 
xml document from a single document?







>
_______________________________________________
General mailing list
[email protected]
Manage your subscription at: 
http://developer.marklogic.com/mailman/listinfo/general

Reply via email to