Search code examples
windows-installerwildfly-10setattributexmldominstallscript

xmldom breaking on writing value of attribute


I am trying to replace existing value of some attribute in .xml file. The line that is to be written is ${VAULT::ab::a-b::1} When I try to write it using xmldom or existing string replacement functions in InstallScript, I see that the file gets updated with above string but curly bracket at the end (}) goes to another line. This is happening at 2 instances in XML file. I have no idea why this happens. I think curly braces don't need an escape though.


Solution

  • Based on the additional information in your comments, I believe your variable szDB_Password contains a newline or a carriage return and linefeed.

    You could figure out how those charcters are getting into your variable and address that, or you could remove them later. To remove them, either resize the string; use StrSub to exclude the last character or two; or use StrReplace twice to replace "\r" and "\n" each with "".