[MarkLogic Dev General] xdmp and update type problem

Geert Josten Geert.Josten at daidalos.nl
Sun Oct 12 23:07:27 PDT 2008


Hi Erin,

Can you us the code snippet containing the node selection and the call to the node-replace function?

Kind regards,
Geert

>


Drs. G.P.H. Josten
Consultant


http://www.daidalos.nl/
Daidalos BV
Source of Innovation
Hoekeindsehof 1-4
2665 JZ Bleiswijk
Tel.: +31 (0) 10 850 1200
Fax: +31 (0) 10 850 1199
http://www.daidalos.nl/
KvK 27164984
De informatie - verzonden in of met dit emailbericht - is afkomstig van Daidalos BV en is uitsluitend bestemd voor de geadresseerde. Indien u dit bericht onbedoeld hebt ontvangen, verzoeken wij u het te verwijderen. Aan dit bericht kunnen geen rechten worden ontleend.


> From: general-bounces at developer.marklogic.com
> [mailto:general-bounces at developer.marklogic.com] On Behalf Of
> erinemiller at comcast.net
> Sent: maandag 13 oktober 2008 6:30
> To: general at developer.marklogic.com
> Subject: [MarkLogic Dev General] xdmp and update type problem
>
> Hello All,
> I'm new to MarkLogic and I have a question about updating a
> document node.  Here's my problem:
> I'm going through the nodes in my document to find a specific
> node.  Here's what my XPath looks like:
>
>    //dict/dict[preceding-sibling::key[1] =
> "Tracks"]/dict/string[preceding-sibling::key[1]]
> My XML is like:
>
> ...
>
> <dict>
>
> ...
>
>    <key>Tracks</key>
>
>        <dict>
>
>       < key>Track ID</key>
>
>       <integer>867</integer>
>       <key>Name</key>
>       <string>Air</string>
>
> ...
>
>    </dict>
>
> That should return a node that looks like:
> <string>Air</String>
> So it's technically returning an element node--I've also
> tried xdmp:node-kind and that gives me "element."
>
> But when I try to update, I get this error:
>
> [1.0-ml] XDMP-ARGTYPE: (err:XPTY0004)
> xdmp:node-replace(xs:untypedAtomic("Air"),
> <string>Air2</string>) -- arg1 is not of type node()
>
> It seems like instead of getting back:
>
> <string>Air</string>
>
> I'm actually just getting:
>
> Air
>
> Which I can't use to update the node since it isn't a node.
>
> Can anyone point me in the right direction?
>
> Thanks!
>
> Erin
>
>
>
>
>



More information about the General mailing list