XMLDocument LoadXML ReadOnly?

[Windows][Desktop][XMLDocument]

Does the XMLDocument class, when giving the LoadXML method a FolderItem, open the file in ReadOnly mode?

I mean I’m sure it does but I can’t find anything in the documentation. Any one know for sure?

This might be super obvious but I want to ensure any file I touch with this does not get altered in any way.

I think its read only. To be sure, check the documentation about to save or write

and… make a copy of an xml file and open it, do whatever you have to do with it and quit. Then check if it have been modified.

Screenshot from the documentation:

Yes, I believe it is too, but it doesn’t state it explicitly anywhere in the documents… and I had Xojo Developer chatgpt search through the latest documentation and it also can’t find anywhere that it explicitly states it is readonly.

I mean it makes sense that it would be but…

Thomas,

there is a command to read,
there is a comman to write

What more information do you want ?

Verify if you do not believe.

Load the examples…

For safety’s sake, why not copy the file to a temporary file and open the copy instead?

Ya, this might be the best option for now… thanks Christian.

Suggestion already made.

Jonathon joined the Forum in 2009. So he knows how things usually works / how the documentation is.

You could also load the XML into a string using a file opened in read-only mode, and use the string as the source for the XML object.