Thanks Chris – ok, so the node existed, but I had to call reference them with
the namespace.. not ‘calendar’ but ec:calendar
xdmp:node-replace(doc("/data-sources/editorial-calendar/TheDrivetoThrive:CRECinderellaStories6321741.xml")/ec:calendar/ec:approval_status,
<approval_status>true</approval_status>);
From: [email protected]
[mailto:[email protected]] On Behalf Of Christopher Hamlin
Sent: Monday, February 08, 2016 5:40 PM
To: MarkLogic Developer Discussion <[email protected]>
Subject: Re: [MarkLogic Dev General] xdmp:node-replace
I'd check that such a node exists:
fn:doc(...)/calendar/approval_status
It looks like you are missing the namespace on the element steps.
On Mon, Feb 8, 2016 at 8:37 PM, Kari Cowan
<[email protected]<mailto:[email protected]>> wrote:
I have used this node-replace statement on other types of records and it works
fine, but it doesn’t work for these, and it doesn’t return an error. Any idea
what silly error have I made?
xquery version "1.0-ml";
declare namespace ec = "http://www.alm.com/event-calendar";
xdmp:node-replace(doc("/data-sources/editorial-calendar/TheDrivetoThrive:CRECinderellaStories6321741.xml")/calendar/approval_status,
<approval_status>true</approval_status>);
>> your query returned an empty sequence
record node example:
<calendar source="local" xmlns="http://www.alm.com/event-calendar">
<ContentTitle>The Drive to Thrive: CRE Cinderella Stories</ContentTitle>
<doc-uri>/data-sources/editorial-calendar/TheDrivetoThrive:CRECinderellaStories6321741.xml</doc-uri>
<approval_status>false</approval_status>
… et cetera…
________________________________
Learn more about ALM, visit http://www.alm.com . – ALM, an Integrated Media
Company, is a leading provider of news and information for the legal and
commercial real estate markets. ALM’s market-leading brands include The
American Lawyer, Corporate Counsel, GlobeSt.com, Insight Conferences, Law.com,
Law Journal Press, LegalTech, The National Law Journal and Real Estate Forum.
_______________________________________________
General mailing list
[email protected]<mailto:[email protected]>
Manage your subscription at:
http://developer.marklogic.com/mailman/listinfo/general
_______________________________________________
General mailing list
[email protected]
Manage your subscription at:
http://developer.marklogic.com/mailman/listinfo/general