XQueryUpdateOperation document update in for loop
Post here questions and problems related to oXygen frameworks/document types.
-
- Posts: 72
- Joined: Thu Mar 26, 2015 4:57 pm
XQueryUpdateOperation document update in for loop
Post by steve.cuzner »
I've got a custom action that implements XQueryUpdateOperation. The associated script is something like:
The problem is that the function mwclib:augment() depends on evaluating the entire document so after the first iteration the section element is modified to have the new attribute and on the second iteration the function needs to know about the data inserted in iteration one, but that doesn't seem to be happening. Is there a way to signal a document update between iterations?
Code: Select all
for $node in ( //*:section )
let $new_att_node := mwclib:augment($node)
return
insert node $new_att_node into $node
Re: XQueryUpdateOperation document update in for loop
Hi Steve,
I would suggest you ask this question on an XSLT users list or on the Saxon users list.
From what I suspect both XQuery and XSLT are side-effect free, not sure about XQuery update but it should also be side effect free, the original model on which the iteration is done is not the same with the changed nodes model which will be eventually be saved.
Regards,
Radu
I would suggest you ask this question on an XSLT users list or on the Saxon users list.
From what I suspect both XQuery and XSLT are side-effect free, not sure about XQuery update but it should also be side effect free, the original model on which the iteration is done is not the same with the changed nodes model which will be eventually be saved.
Regards,
Radu
Radu Coravu
<oXygen/> XML Editor
http://www.oxygenxml.com
<oXygen/> XML Editor
http://www.oxygenxml.com
-
- Posts: 72
- Joined: Thu Mar 26, 2015 4:57 pm
Re: XQueryUpdateOperation document update in for loop
Post by steve.cuzner »
Radu,
You are correct about the side effect free implementation. You might want to consider this proposed extension for use in XQueryUpdateOperation as a possible enhancement:
http://www.cs.stanford.edu/people/chris ... ryBang.pdf
Steve
You are correct about the side effect free implementation. You might want to consider this proposed extension for use in XQueryUpdateOperation as a possible enhancement:
http://www.cs.stanford.edu/people/chris ... ryBang.pdf
Steve
Re: XQueryUpdateOperation document update in for loop
Hi Steve,
The XQueryUpdate operation uses the Saxon 9 XSLT processor engine so we do not control its implementation. Se if you want you can request this on the Saxon mailing list. In the meantime you can probably also use a Javascript operation which iterates directly over the AuthorNode implementations and uses the AuthorDocumentController to directly change the nodes.
Regards,
Radu
The XQueryUpdate operation uses the Saxon 9 XSLT processor engine so we do not control its implementation. Se if you want you can request this on the Saxon mailing list. In the meantime you can probably also use a Javascript operation which iterates directly over the AuthorNode implementations and uses the AuthorDocumentController to directly change the nodes.
Regards,
Radu
Radu Coravu
<oXygen/> XML Editor
http://www.oxygenxml.com
<oXygen/> XML Editor
http://www.oxygenxml.com
Return to “SDK-API, Frameworks - Document Types”
Jump to
- Oxygen XML Editor/Author/Developer
- ↳ Feature Request
- ↳ Common Problems
- ↳ DITA (Editing and Publishing DITA Content)
- ↳ SDK-API, Frameworks - Document Types
- ↳ DocBook
- ↳ TEI
- ↳ XHTML
- ↳ Other Issues
- Oxygen XML Web Author
- ↳ Feature Request
- ↳ Common Problems
- Oxygen Content Fusion
- ↳ Feature Request
- ↳ Common Problems
- Oxygen JSON Editor
- ↳ Feature Request
- ↳ Common Problems
- Oxygen PDF Chemistry
- ↳ Feature Request
- ↳ Common Problems
- Oxygen Feedback
- ↳ Feature Request
- ↳ Common Problems
- Oxygen XML WebHelp
- ↳ Feature Request
- ↳ Common Problems
- XML
- ↳ General XML Questions
- ↳ XSLT and FOP
- ↳ XML Schemas
- ↳ XQuery
- NVDL
- ↳ General NVDL Issues
- ↳ oNVDL Related Issues
- XML Services Market
- ↳ Offer a Service