user851380
user851380

Reputation: 339

delete function in xquery

Is there a built-in delete function in XQuery that I can use to delete the actual file in the database in a certain directory say a/b/c/d.xml

How to implement one if there is no such function?

Upvotes: 0

Views: 1332

Answers (3)

dahln
dahln

Reputation: 11

I realize that this question was posted nearly a year and a half ago, but I thought this would be a helpful contribution.

If you just want to delete a node, you can use this:

xdmp:node-delete(/parentNode/childNode)

The childNode would be deleted.

See this link

Upvotes: 1

Dennis Münkle
Dennis Münkle

Reputation: 5071

In Zorba and BaseX you would do file:remove("a/b/c/d.xml") (there are also other processors supporting this module, please add)

Upvotes: 0

Dave Cassel
Dave Cassel

Reputation: 8422

Deleting a document is implementation dependent. In MarkLogic Server, you would do this:

xdmp:document-delete("a/b/c/d.xml")

Upvotes: 2

Related Questions