SHARE
TWEET

Untitled

a guest Jun 26th, 2019 58 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. <?xml version="1.0" encoding="UTF-8"?>
  2. <abs>We are disconnected [Abs. <uidlink saiss="1917-02">1917A00171</uidlink> The extraordinarily
  3.     insightful Nature of Americans study illuminates both .[Abs. <uidlink saiss="1917-08"
  4.         >1917A00726</uidlink>]. or example, the insight that nature experiences are so often
  5.     intensely social activities, a reminder of a sometimes forgotten key to connecting.</abs>
  6.      
  7. declare function utils:ConvertXmlToJson($HighLightResponse as item()*) as item()*
  8. {
  9.      let $config := json:config("custom")
  10.                     let $_ := map:put( $config, "whitespace", "ignore" )
  11.                     let $_ := map:put( $config, "array-element-names", (xs:QName("results"),xs:QName("personName"),xs:QName("affiliationGroup"),xs:QName("Highlight")
  12.                             ,xs:QName("match"),xs:QName("indexTerms"),xs:QName("classification"),xs:QName("foreNames"),xs:QName("treatmentCodes")) )
  13.  
  14.  
  15.                     let $_ := map:put( $config, "camel-case", fn:true())
  16.     let $JsonOutput := json:transform-to-json($HighLightResponse, $config)  
  17.     let $InputJson  := xdmp:quote($JsonOutput)
  18.     let $Result     := fn:replace($InputJson, 'zzz@start', '<highlight>')
  19.     let $JsonResult := fn:replace($Result, 'zzz@end', '</highlight>')
  20.     return
  21.             $JsonResult
  22. };
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top