CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 2 of 2
  1. #1
    Join Date
    Dec 2001
    Location
    UK
    Posts
    308

    XmlDocument - End tag moved to next line

    I use XmlDocument to load and save the XML document...

    While i save the document end tag of elements with blank value is moved to next line..

    i.e.
    Code:
    <root>
       <element1>some text</element1> 
       <element2>123566</element2>
       <element3></element3>
       <element4></element4>
    </root>
    when above document is loaded and saved back, it looks like below
    Code:
    <root>
       <element1>some text</element1> 
       <element2>123566</element2>
       <element3> 
       </element3>
       <element4> 
       </element4>
    </root>
    (End tags of element3 and elemtn4 are moved to next line)

    This causes error in my schema as element3 and element4 has invalid character(in schema we have defined, it must have valid value, blank space is invalid)

    XML file is generated via code so - i can’t change <element4></element4> to <element4/> to avoid above problem...

    Please can help me how to handle this..

    Cheers
    Venu
    Venu Bharadwaj
    "Dream it. U can do it!"

  2. #2
    Join Date
    Jan 2005
    Location
    City of Smiles!
    Posts
    125

    Re: XmlDocument - End tag moved to next line

    hi,

    would it be possible to post the code that generates the xml file? i'll have a peek to see if i can help...


    cheers!
    ...we get by with a little help from our friends...

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured