Wrox Programmer Forums
Go Back   Wrox Programmer Forums > Database > Oracle ASP
|
Oracle ASP Using ASP with Oracle databases. For Oracle discussions not specific to ASP, please see the Oracle forum. For more ASP discussions, please see the ASP forum category.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Oracle ASP section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old July 2nd, 2007, 02:33 AM
Registered User
 
Join Date: Jul 2007
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Default Please help - "\r\n Problem in OracleXmlType "

Dear All,
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
writer.WriteStartElement("order");
writer.WriteStartElement("book");
riter.WriteString("4\r\n6"); // here is the problem

line
writer.WriteEndElement();
writer.WriteEndElement();
writer.Flush();

Thus I successfully created xml. It will look like
<order>
   <book>4\r\n6</book>
</order>

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
<order>
    <book>4\n6</book> // where is "\r" ??????????
<order>

But when I tried to read that xml with XmlReader object

like;
  xmlReader.Read();
  xmlReader.ReadStartElement("order");
  xmlReader.ReadStartElement("book"); // "4\r\n\6"

can be viewed by debug point at this line
  xmlReader.ReadEndElement();
  xmlReader.ReadEndElement();
I noticed that there is no problem ie it shows "\r" ,

but when converting it with OracelXmlType, it ("\r")

disappears.

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 ?

Regards
Prasad A.K











Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.