XQuery TutorialLesson 72Free preview
XQuery Add
This lesson is part of XML · All levels
Summary
XQuery can add data to XML documents through an element constructor and attribute, both direct constructor and computed constructor. In the FLWOR query, the return section is where you write the new structure you want to generate. To modify stored documents, additional standards of the XQuery Update Facility are available with the insert, delete, replace, and rename commands.
Key points
- Direct constructor: write XML elements as they are inside return
- Computed constructor: element name {expression} and attribute name {expression}
- New attributes are created with attribute price {"9.99"}
- XQuery Update Facility provides node insert / delete node / replace node / rename
- The update needs XQuery engine support, not all machines enable it
Full lesson
Code examples and quizzes
Full lessons, code examples, and quizzes are available to subscribers. 5 questions.