msxml issue

T

thanghuynh

hi,

Anyone else having this issue with msxml3.0 (or any other version)?

1. run this ASP code (notice the space in <myElement> </myElement>):
<%@ LANGUAGE="VBSCRIPT" %>
<%
set o = Server.createObject("MSXML2.DOMDocument.3.0")
s = "<root><myElement> </myElement></root>"
o.loadXML(s)
o.save("D:\test.xml")
%>

2. open the xml file

3. does the content of the xml file look like the following (notice
the ending tag of myElement goes to the next line)?
<root><myElement>
</myElement></root>

4. how do i get the content to look like the following (i just want
<myElement> and </myElement> to be on the same line with the space
preserved):
<root><myElement> </myElement></root>
or
<root>
<myElement> </myElement>
</root>
 
T

thanghuynh

hi,

Anyone else having this issue with msxml3.0 (or any other version)?

1. run this ASP code (notice the space in <myElement> </myElement>):
<%@ LANGUAGE="VBSCRIPT" %>
<%
        set o = Server.createObject("MSXML2.DOMDocument.3.0")
        s = "<root><myElement> </myElement></root>"
        o.loadXML(s)
        o.save("D:\test.xml")
%>

2. open the xml file

3. does the content of the xml file look like the following (notice
the ending tag of myElement goes to the next line)?
<root><myElement>
        </myElement></root>

4. how do i get the content to look like the following (i just want
<myElement> and </myElement> to be on the same line with the space
preserved):
<root><myElement> </myElement></root>
or
<root>
        <myElement> </myElement>
</root>

set preserveWhiteSpace = true before loading the xml
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,754
Messages
2,569,527
Members
44,998
Latest member
MarissaEub

Latest Threads

Top