Re: XML VB DOM

Discussion in 'XML' started by mike67440@yahoo.co.uk, Aug 1, 2012.

  1. Guest

    On Monday, August 19, 2002 7:29:31 PM UTC+1, rdclk23 wrote:
    > I have created an XML file using the Microsoft DOM, and all of the
    > nodes / elements are strung together as one very long line when viewed
    > in an editor. When the XML file is parsed, the line / column error
    > messages all say line 2, column # (very large).... How can I put in
    > carriage returns when I create the XML file so that each element is on
    > a new line?
    >
    > Rich


    Hi Rich,

    That doesnt sound right to me, try your file in this xml editor / parser, http://www.liquid-technologies.com/xml-editor.aspx
     
    , Aug 1, 2012
    #1
    1. Advertising

  2. On 8/1/2012 9:17 AM, wrote:
    > On Monday, August 19, 2002 7:29:31 PM UTC+1, rdclk23 wrote:
    >> I have created an XML file using the Microsoft DOM, and all of the
    >> nodes / elements are strung together as one very long line when viewed
    >> in an editor. When the XML file is parsed, the line / column error
    >> messages all say line 2, column # (very large)....


    Remember, whitespace in an XML document is part of the document's
    content, and adding whitespace changes that content -- potentially
    changing the results of processing that document. As a result, XML tools
    tend not to indent/pretty-print the XML unless you explicitly instruct
    them to do so.

    I haven't worked with the Microsoft implementation in an age and a half,
    so I can't advise you on whether there's an easy switch you can turn on
    to force pretty-printing. But before doing so, you do have to look at
    the application which will be consuming this document and make sure it
    can tolerate that whitespace.

    If you want to do this in a more controlled manner, your DOM application
    needs to insert explicit text nodes to represent the whitespace. (That's
    essentially what the pretty-printer does.)



    --
    Joe Kesselman,
    http://www.love-song-productions.com/people/keshlam/index.html

    {} ASCII Ribbon Campaign | "may'ron DaroQbe'chugh vaj bIrIQbej" --
    /\ Stamp out HTML mail! | "Put down the squeezebox & nobody gets hurt."
     
    Joe Kesselman, Aug 1, 2012
    #2
    1. Advertising

  3. Peter Flynn Guest

    On 01/08/12 14:59, Joe Kesselman wrote:
    > On 8/1/2012 9:17 AM, wrote:
    >> On Monday, August 19, 2002 7:29:31 PM UTC+1, rdclk23 wrote:
    >>> I have created an XML file using the Microsoft DOM, and all of the
    >>> nodes / elements are strung together as one very long line when viewed
    >>> in an editor. When the XML file is parsed, the line / column error
    >>> messages all say line 2, column # (very large)....

    >
    > Remember, whitespace in an XML document is part of the document's
    > content, and adding whitespace changes that content -- potentially
    > changing the results of processing that document. As a result, XML tools
    > tend not to indent/pretty-print the XML unless you explicitly instruct
    > them to do so.
    >
    > I haven't worked with the Microsoft implementation in an age and a half,
    > so I can't advise you on whether there's an easy switch you can turn on
    > to force pretty-printing. But before doing so, you do have to look at
    > the application which will be consuming this document and make sure it
    > can tolerate that whitespace.
    >
    > If you want to do this in a more controlled manner, your DOM application
    > needs to insert explicit text nodes to represent the whitespace. (That's
    > essentially what the pretty-printer does.)


    Unzip the file and locate document.xml.
    Open this in a web browser: it will display it pretty-printed.

    ///Peter
     
    Peter Flynn, Aug 4, 2012
    #3
    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. Thorsten Meininger
    Replies:
    0
    Views:
    444
    Thorsten Meininger
    Jul 28, 2004
  2. Thorsten Meininger
    Replies:
    0
    Views:
    515
    Thorsten Meininger
    Jul 28, 2004
  3. Replies:
    0
    Views:
    562
  4. Replies:
    3
    Views:
    541
    Stefan Behnel
    Aug 3, 2007
  5. Alan
    Replies:
    6
    Views:
    1,611
Loading...

Share This Page