msxml issue

Discussion in 'XML' started by thanghuynh@gmail.com, Feb 14, 2008.

  1. Guest

    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>
     
    , Feb 14, 2008
    #1
    1. Advertising

  2. Guest

    On Feb 14, 2:02 pm, wrote:
    > 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
     
    , Feb 14, 2008
    #2
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. KathyB
    Replies:
    0
    Views:
    1,055
    KathyB
    Jun 25, 2003
  2. William F. Robertson, Jr.
    Replies:
    1
    Views:
    1,000
    Kathy Burke
    Jun 25, 2003
  3. steve_h
    Replies:
    3
    Views:
    1,491
    Kirk Allen Evans [MVP]
    Nov 5, 2003
  4. Pat Friedl

    Using MSXML asynchronously?

    Pat Friedl, Nov 6, 2003, in forum: ASP .Net
    Replies:
    1
    Views:
    361
    Pat Friedl
    Nov 11, 2003
  5. Andy Norman
    Replies:
    1
    Views:
    648
    Oleg Tkachenko
    Nov 23, 2003
Loading...

Share This Page