Search code examples
xquerybasexxquery-3.0xquery-update

Why does BaseX not modify the file upon an insert node command?


I am executing the following XQuery code on BaseX 7.9 and am able to see the insertion on the results window. I even see the new node after closing and reopening the collection. However, when I go to the file directory I see it hasn't been modified. So, how can I make the insertion reflect as well on the file? And how does BaseX handle insertion commands so it is persistent in the context of the database but not in the context of the file?

let $up := <Employee Name="Joe">
    <Personal>
      <SSN>666-66-1234</SSN>
    </Personal>
    <StaffInfo>
      <Position>Doctor</Position>
      <AccountableTo>Jeff</AccountableTo>
    </StaffInfo>
  </Employee>
return insert node $up as last into doc('office')/Staff

Solution

  • By default, updates will not be reflected on XML documents outside a database. However, updates may be enforced via the command-line flag -U or the option WRITEBACK.