Skip to content
This repository has been archived by the owner on Nov 9, 2022. It is now read-only.

Sample Insert Transformer #88

Open
bobstarbird opened this issue Sep 6, 2012 · 4 comments
Open

Sample Insert Transformer #88

bobstarbird opened this issue Sep 6, 2012 · 4 comments

Comments

@bobstarbird
Copy link

import module namespace imu = "http://xqdev.com/in-mem-update"
at "/MarkLogic/appservices/utils/in-mem-update.xqy";

(: xdmp:eval(string($transformer), (xs:QName("content"), $content, xs:QName("requestParameters"), $requestParameters, xs:QName("testMode"), false()), same-statement) :)

declare variable $content as node() external ;
declare variable $requestParameters as map:map external;
declare variable $testMode as xs:boolean external;

if ($testMode) then ()
else
let $uuid := map:get($requestParameters, "uuid")
let $content := imu:node-replace($content/question/@qid, attribute qid {$uuid})
return $content

@eedeebee
Copy link
Contributor

eedeebee commented Sep 7, 2012

Bob,

Can you say a little bit more here?

-Eric

@bobstarbird
Copy link
Author

Yes, Eric, but I am lame with GITHUB.
I will try to provide a sample that shows what I have learned. Maybe I can
learn something, but I could not simple comment.
Bob

On Thu, Sep 6, 2012 at 11:20 PM, Eric Bloch notifications@github.comwrote:

Bob,

Can you say a little bit more here?

-Eric


Reply to this email directly or view it on GitHubhttps://github.com//issues/88#issuecomment-8354897.

Robert Starbird
Software Professional Services
Leader and Engineer
Cell: (781) 548-9427
robert.starbird@gmail.com
http://www.linkedin.com/in/robertstarbird

@eedeebee
Copy link
Contributor

eedeebee commented Sep 7, 2012

Ah, there is corona@developer.marklogic.com if you're looking to open a conversation. The issues thing is really just for bugs and rfes - neither of which does this appear to be (as far as i can tell).

@bobstarbird
Copy link
Author

Agreed. It was a sample that I thought I could share for a baseline xquery
transform. It was not immediately obvious that the eval during transform
insert would fail with the sample data so I thought it would be good
to illustrate a working transform using the testMode parameter
(in-mem-update fails if the node being replaced does not exist)

Bob

On Thu, Sep 6, 2012 at 11:47 PM, Eric Bloch notifications@github.comwrote:

Ah, there is corona@developer.marklogic.com if you're looking to open a
conversation. The issues thing is really just for bugs and rfes - neither
of which does this appear to be (as far as i can tell).


Reply to this email directly or view it on GitHubhttps://github.com//issues/88#issuecomment-8355262.

Robert Starbird
Software Professional Services
Leader and Engineer
Cell: (781) 548-9427
robert.starbird@gmail.com
http://www.linkedin.com/in/robertstarbird

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants