xquery version "1.0" encoding "utf-8";
(:: OracleAnnotationVersion "1.0" ::)
declare namespace www="http://www.inc.teamshare.gems.com";
(:: import schema at "../Schemas/GemsTeamshareData.xsd" ::)
declare namespace pul="http://xmlns.oracle.com/pcbpel/adapter/db/top/Pull_GEMS_INCREMENTAL_DATA";
(:: import schema at "../Schemas/Pull_GEMS_INCREMENTAL_DATA_table.xsd" ::)
declare variable $inputVariable.GemsIncrementalDataCollection as element() (:: schema-element(pul:GemsIncrementalDataCollection) ::) external;
declare variable $TempListExtractData as element() (:: schema-element(www:TeamShareData) ::) external;
declare function local:funcJsonteamshare($inputVariable.GemsIncrementalDataCollection as element() (:: schema-element(pul:GemsIncrementalDataCollection) ::),
$TempListExtractData as element() (:: schema-element(www:TeamShareData) ::))
as element() (:: schema-element(www:JsonStringList) ::) {
<www:JsonStringList>
{
for $i in $TempListExtractData/www:TeamShareDataMain
let $mainJsonOuter :=fn:concat("{"__metadata": { "type": "",$inputVariable.GemsIncrementalDataCollection/pul:GemsIncrementalData/pul:tsListFullname/text(),""}")
let $mainJsonOuterEnd :="}"
let $mainJson :=""
let $doubleQts :="'"
return
<www:JsonString>
<www:id>{fn:data($i/www:DataSeq)}</www:id>
<www:jsonString>{$mainJsonOuter}
{
for $inner in $i/www:TeamShareDataList where fn:not($inner/www:Value = '') and fn:not($inner/www:Key = '')
return fn:concat(", "",$inner/www:Key,"":"",fn:translate(fn:replace(fn:replace(fn:replace($inner/www:Value,'”','\\"'),'“','\\"'),'"','\\"'),'áàâäéèêëíìîïóòôöúùûü°','aaaaeeeeiiiioooouuuu.'),""")
}{$mainJsonOuterEnd}</www:jsonString>
</www:JsonString>
}
</www:JsonStringList>
};
local:funcJsonteamshare($inputVariable.GemsIncrementalDataCollection, $TempListExtractData)
(:: OracleAnnotationVersion "1.0" ::)
declare namespace www="http://www.inc.teamshare.gems.com";
(:: import schema at "../Schemas/GemsTeamshareData.xsd" ::)
declare namespace pul="http://xmlns.oracle.com/pcbpel/adapter/db/top/Pull_GEMS_INCREMENTAL_DATA";
(:: import schema at "../Schemas/Pull_GEMS_INCREMENTAL_DATA_table.xsd" ::)
declare variable $inputVariable.GemsIncrementalDataCollection as element() (:: schema-element(pul:GemsIncrementalDataCollection) ::) external;
declare variable $TempListExtractData as element() (:: schema-element(www:TeamShareData) ::) external;
declare function local:funcJsonteamshare($inputVariable.GemsIncrementalDataCollection as element() (:: schema-element(pul:GemsIncrementalDataCollection) ::),
$TempListExtractData as element() (:: schema-element(www:TeamShareData) ::))
as element() (:: schema-element(www:JsonStringList) ::) {
<www:JsonStringList>
{
for $i in $TempListExtractData/www:TeamShareDataMain
let $mainJsonOuter :=fn:concat("{"__metadata": { "type": "",$inputVariable.GemsIncrementalDataCollection/pul:GemsIncrementalData/pul:tsListFullname/text(),""}")
let $mainJsonOuterEnd :="}"
let $mainJson :=""
let $doubleQts :="'"
return
<www:JsonString>
<www:id>{fn:data($i/www:DataSeq)}</www:id>
<www:jsonString>{$mainJsonOuter}
{
for $inner in $i/www:TeamShareDataList where fn:not($inner/www:Value = '') and fn:not($inner/www:Key = '')
return fn:concat(", "",$inner/www:Key,"":"",fn:translate(fn:replace(fn:replace(fn:replace($inner/www:Value,'”','\\"'),'“','\\"'),'"','\\"'),'áàâäéèêëíìîïóòôöúùûü°','aaaaeeeeiiiioooouuuu.'),""")
}{$mainJsonOuterEnd}</www:jsonString>
</www:JsonString>
}
</www:JsonStringList>
};
local:funcJsonteamshare($inputVariable.GemsIncrementalDataCollection, $TempListExtractData)
Comments
Post a Comment