Sign In/My Account | View Cart  
advertisement

Article:
 What Is XQuery
Subject: operations on xml
Date: 2003-07-19 21:43:28
From: Johnny Wang

Hi, I'm new to XQaury, someone told me it is the right tool to solve my problem, still don't yet see how to do it. Any pointers are appreciated.


Given an xml document, I'd like to make some changes to the content (e.g., change an attribute, or switching the order of two child nodes, or add a new node). I can do all these using standard programming languages and DOM (e.g., java and JDOM), but I found these really repetative and intellecturally wanting. I'd like to just give an instruction in some language, and a general transformer should do the actual work. Is XQuery the tool for this type of task?


Thanks.


Previous Message Previous Message   Next Message Next Message


Titles Only Titles Only Newest First
  • operations on xml
    2003-07-27 10:48:25 Per Bothner

    > Given an xml document, I'd like to make some changes to the content ...


    You can certainly do that, as long as you realize "changes" means creating a modified version. XQuery does not have side-effects, and you cannot update (modify) existing nodes. (Though there are proposals to extend XQuery with update operations, they will not be considered for XQuery 1.0.) So you have to "write out" a new modified version of the document, rather than update it in place.


Sponsored By: