Skip to content

XML formatting error

Kuber Kumar

Asked Dec 3, 2007, 6:54 PM EST1 answer
Share
LinkedInX

platform: vb.net 1.1 (its pretty much the same for c# that's why posting it here)

input: an xml document in one line...

output: need to insert a newline after each element..

problem: try to serialize it using xmldocument.serialize (although dont' even need to call it reading the document in to it and saving does it just as well)...but get this weird string "[]"

<!DOCTYPE BatchResponse004 SYSTEM 'BatchResponse004.dtd'> is changed to

<!DOCTYPE BatchResponse004 SYSTEM "BatchResponse004.dtd"[]>

can't figure out where did this [] came from?

would appreciate any help!!!

1 Answer

Know the answer? Post it. Somebody with the same question will find it here.

  • 0
    How are you reading and writing? Are you using xml readers/writers? It looks likes the reader is replacing characters or maybe some sort of byte array is being used and it is printing the array characters.

    Also in an xml file a newline needs to be in hex and not "\n" it looks like this:

        <xsl:text> </xsl:text>
        <xsl:text> </xsl:text>

    I might not be hitting what your asking, reply if you need more.
    0