| Please help - "\r\n Problem in OracleXmlType " [message #248814]
||Mon, 02 July 2007 02:34
Registered: July 2007
I have to fix the issue with the following code. I'm
going to create an xml in memory and writing some data in
to it. Here is the code
MemoryStream memStream = new MemoryStream();
XmlWriterSettings settings = new XmlWriterSettings();
settings.Indent = true;
settings.OmitXmlDeclaration = true;
settings.NewLineHandling = NewLineHandling.Entitize ; //
it will replace "\r\n" with "&#D;&#A;"
writer = XmlWriter.Create(memStream,settings);// it will
write xml in memory stream
riter.WriteString("4\r\n6"); // here is the problem
Thus I successfully created xml. It will look like
Now im going to read the xml with "XmlReader" class and
converting it to OracleXmlType class
Here is the code;
XmlReader xmlReader=XmlReader.Create(memStream); // Here
xmlReader object only used as arg to OracelXmlType class.
ie i have not used this object to read xml.
OracleXmlType objXmlType=new OracleXmlType
(orclConnection,xmlReader); // I have oracle connection
object named "orclConnection";
Now the issue comes. When I tried to watch the value of
"objXmlType" ( by QuickWatch) i found "\r" missing from
attribute value of "book". Xml look like
<book>4\n6</book> // where is "\r" ??????????
But when I tried to read that xml with XmlReader object
xmlReader.ReadStartElement("book"); // "4\r\n\6"
can be viewed by debug point at this line
I noticed that there is no problem ie it shows "\r" ,
but when converting it with OracelXmlType, it ("\r")
I think now you have clear idea of the issue. Can you
find any solution to this problem?
Or is this bug of "OracelXmlType" class ?