![]() | |
![]() |
| | Thread Tools | Search this Thread | Display Modes |
#1
| |||
| |||
|
#2
| |||
| |||
|
|
what is the best way to convert an XmlDocument object to a string of its XML content? it appears there are a few ways, and im curious what the best one would be. |
#3
| |||
| |||
|
|
what is the best way to convert an XmlDocument object to a string of its XML content? it appears there are a few ways, and im curious what the best one would be. |
#4
| |||
| |||
|
|
You would need to define criteria on what you regard as a good way and what as a bad way. The shortest in terms of code is certainly xmlDocumentInstance.OuterXml |
#5
| |||
| |||
|
|
On Nov 29, 6:51 am, Martin Honnen <mahotr... (AT) yahoo (DOT) de> wrote: You would need to define criteria on what you regard as a good way and what as a bad way. The shortest in terms of code is certainly xmlDocumentInstance.OuterXml i was under the impression that doesnt preserve the original text entirely -- something about the encoding character-set...ring any bells? what are other pros & cons that come to mind? my desire is to preserve any possible character in its original form. |
#6
| |||
| |||
|
|
i was under the impression that doesnt preserve the original text entirely -- something about the encoding character-set...ring any bells? what are other pros & cons that come to mind? my desire is to preserve any possible character in its original form. I am not sure I understand. A string in the .NET framework is a sequence of Unicode characters while the original document might be a file on the disk which is a sequence of bytes. So a string being a sequence of characters is always different from a file being a sequence of bytes. |
#7
| |||
| |||
|
|
i was under the impression that doesnt preserve the original text entirely -- something about the encoding character-set...ring any bells? I am not sure I understand. A string in the .NET framework is a sequence of Unicode characters while the original document might be a file on the disk which is a sequence of bytes. So a string being a sequence of characters is always different from a file being a sequence of bytes. |
#8
| |||
| |||
|
|
SpaceMarine wrote: On Nov 29, 6:51 am, Martin Honnen <mahotr... (AT) yahoo (DOT) de> wrote: You would need to define criteria on what you regard as a good way and what as a bad way. The shortest in terms of code is certainly xmlDocumentInstance.OuterXml i was under the impression that doesnt preserve the original text entirely -- something about the encoding character-set...ring any bells? what are other pros & cons that come to mind? my desire is to preserve any possible character in its original form. I am not sure I understand. A string in the .NET framework is a sequence of Unicode characters while the original document might be a file on the disk which is a sequence of bytes. So a string being a sequence of characters is always different from a file being a sequence of bytes. |
![]() |
| Thread Tools | Search this Thread |
| Display Modes | |
| |