Altova Mailing List Archives>Archive Index >microsoft.public.xml Archive Home >Recent entries >Thread Prev - Re: XML to TXT [Thread Next] Re: XML to TXTTo: NULL Date: 11/11/2009 9:48:00 AM Agreed.
This seems to be calling for a tranform.
Here is my "to text file" hint.
<?xml version="1.0" encoding="utf-8"?>
<xsl:stylesheet version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:output method="text" />
The last line is the one of importance.
See my other post for a transform example.
"Pete Delgado" <Peter.Delgado@N...> wrote in message
news:OMTIMWAWKHA.4688@T......
>
> "Martin Honnen" <mahotrash@y...> wrote in message
> news:emzQ7MkTKHA.4408@T......
>> Tom Woods wrote:
>>> Sorry for being so vague. What I would like to do is to read the
>>> XmlDocument line by line and add each line into a memo field.
>>>
>>> When I use the InnerXml, it's just one long string with no CR/LF.
>>>
>>> Can this be done?
>>
>> The XML APIs don't expose XML line by line, rather they expose nodes.
>> But you can of course use the normal file IO APIs to read line by line.
>>
>> And if InnerXml does not give you what you want then you might simply
>> want to set PreserveWhitespace to true before you load your XML document:
>>
>> XmlDocument doc = new XmlDocument();
>> doc.PreserveWhitespace = true;
>> doc.Load("file.xml");
>> // now doc.OuterXml/InnerXml has any white space the original document
>> contains
>>
>
> Wouldn't it be far better and simpler to use XSLT to transform the XML
> into the appropriate format?
>
> -Pete
>
>
| ||||||
| Company | Legal | Press | Partners | Careers | Sitemap | Contact Us | Altova Blog | Mobile | Full Site | |||
|
