Thank you.
I checked that class. This is what i am trying to do:
Array<File> presetList; // a file array to load all xml files into it.
// this will go to Users/Shared/MyPlugin/Presets and keep this file path
File file = File::getSpecialLocation(File::commonDocumentsDirectory).getChildFile("MyPlugin/Presets/.a").getParentDirectory().getFullPathName();
file.findChildFiles(presetList, File::findFiles, false, "*.Preset"); //fill presetList array with xml files
for(int i=0; i<presetList.size();i++)
{
XmlDocument xmlDocument(presetList[i]); //for every single xml file, create a xml document/
//Find the element that includes "presetindex" tagname
auto xmlElement = xmlDocument.getDocumentElementIfTagMatches("presetindex"); //i don't know what this stores. Is it in MyPluginPreset element ?
// after finding the element that has "presetindex" tagname, I want to find the attribute that has the same name and i want to change its value but I couldn't do this part.
}
Here is my xml file
VC2!√<?xml version="1.0" encoding="UTF-8"?>
<MyPluginPreset>
<PARAM id="bpm" value="0.0"/>
<PARAM id="presetindex" value="6.0"/>
</MyPluginPreset>
I want to locate the presetindex and change its value.Let’s say with 10.0. So after the changing its value it should look like this
VC2!√<?xml version="1.0" encoding="UTF-8"?>
<MyPluginPreset>
<PARAM id="bpm" value="0.0"/>
<PARAM id="presetindex" value="10.0"/>
</MyPluginPreset>
I am not good at parsing xml files. I haven’t done it before(even with other languages)This is my first attemp. Could you please guide me to add the remaining part ?
