The question of whether or not updated documents are written back to disk depends on how you invoke the query, which you haven't described. There are various options on the command line, and if you use the Java API it is entirely under your control.
 

Regards,

Michael Kay
http://www.saxonica.com/
http://twitter.com/michaelhkay



From: Costello, Roger L. [mailto:costello@mitre.org]
Sent: 11 March 2010 12:46
To: saxon-help@lists.sourceforge.net
Subject: [saxon] Rename all the elements/attributes in all the XML files in a folder -- nothing happens

Hi Michael,

 

I am trying to rename all the elements and attributes in all the XML files in a folder. It seems like this should work:

 

for $i in collection('files?select=*.xml;recurse=yes;on-error=ignore')//(*|@*)

    return rename node $i as lower-case(name($i))

  

But I get no output and no change to the files.

 

I seem to be accessing all the files correctly because I get the expected output when I simply select all the elements in all the files:

 

for $i in collection('files?select=*.xml;recurse=yes;on-error=ignore')//*

    return $i

 

I am using the latest version of SAXON. Am I doing something wrong or is this a bug?

 

/Roger