I'm using VBScript to read & write xml files. I expect xml output files, where special characters are replaced with unicode hex entities.
Input xml:
<root> <nodes> <node name="first">München
Nürnberg
Kölln</node> <node name="second">München
Nürnberg
Kölln</node> </nodes> VBScript:
Dim xmlDoc : Set xmlDoc = CreateObject("Microsoft.XMLDOM") xmlDoc.load "in.xml" Dim nNode : Set nNode = xmlDoc.selectsinglenode ("//root/nodes/node[@name='first']") if not nNode is nothing then nNode.text = "München" & vbNewLine & "Nürnberg" & vbNewLine & "Kölln" wscript.echo xmldoc.xml xmldoc.save("out.xml") else WScript.Echo "not found..." end if Output xml:
<root> <nodes> <node name="first">München Nürnberg Kölln</node> <node name="second">München Nürnberg Kölln</node> </nodes> The output file should be encoded like the input file. Certainly, it is quite easy to solve, but i didn't found the solution :/ Would be great if anybody could help me.
No comments:
Post a Comment