The Altair Community is migrating to a new platform to provide a better experience for you. In preparation for the migration, the Altair Community is on read-only mode from October 28 - November 6, 2024. Technical support via cases will continue to work as is. For any urgent requests from Students/Faculty members, please submit the form linked here
Read and modify XML file with execute script operator
I'm trying to read an xml file without using the ReadXml operator. I want to treat is as a text file and then extract some values from it. I was wondering if this can be done using the execute script operator. This is part of the java code I'm using with the execute script operator. I don't get any error but it's like it doesn't even start the execution.
Thanks a lot.
Would you suggest a better way to do this?
String path="/home/myFolder/file.xml";
String content = new Scanner(new File(path)).useDelimiter("\\Z").next();
//some operations on content
return content;
Thanks a lot.
Tagged:
0
Answers
this will read a file line by line and create a document. To use the output, you need to create an instance of an IOObject and return that. Regards,
Marco