You must Sign In to post a response.
  • Category: Windows 10

    Need help!!! I have a problem

    i have one xml file that file by default getting some white space from page starting to xml tags.

    like from pagestarting to <xml version="">

    inside the parent to child tag white space i was handle but out side of the space is i cant any one tell me how can i do this....asap.
  • #769770
    There are different ways like

    If you're thinking in preserving white space i. e tabs, carriage returns and other formats then you can use the CDATA

    Or else

    Use an xslt transform. Doing it this way allows you to have control over the stripping or preservation of white spaces using xml:space Attribute.
    The xml:space attribute is another standard mechanism that exists for preserving white space in XML applications. he xml:space behavior cascades to all descendant elements but can be turned off locally by setting the xml:space attribute to default. In order to use xml:space in a validating context, the attribute must be declared in a DTD or Schema attribute list for the elements in which it is used

    So,Based on your comments, I think you may be able to use the XmlWriterSettings.NewLineHandling property to change how the text node handles the carriage returns. You'll have to experiment. I suspect the receiving application has some line parsing issue and is looking for a \r\n or something

    Hope these are helpful for your requirement

    B.Ramana Reddy

  • Sign In to post your comments