Click here to Skip to main content
15,926,596 members
Home / Discussions / C#
   

C#

 
Questionfirst frame of video Pin
munmat16-Dec-05 11:13
munmat16-Dec-05 11:13 
QuestionEscape sequence in xml output? Pin
pankazmittal16-Dec-05 11:01
pankazmittal16-Dec-05 11:01 
AnswerRe: Escape sequence in xml output? Pin
Nish Nishant16-Dec-05 11:13
sitebuilderNish Nishant16-Dec-05 11:13 
GeneralRe: Escape sequence in xml output? Pin
pankazmittal16-Dec-05 11:18
pankazmittal16-Dec-05 11:18 
AnswerRe: Escape sequence in xml output? Pin
TheGreatAndPowerfulOz16-Dec-05 11:14
TheGreatAndPowerfulOz16-Dec-05 11:14 
AnswerRe: Escape sequence in xml output? Pin
Guffa16-Dec-05 11:22
Guffa16-Dec-05 11:22 
AnswerRe: Escape sequence in xml output? Pin
Curtis Schlak.16-Dec-05 11:29
Curtis Schlak.16-Dec-05 11:29 
QuestionRe: Escape sequence in xml output? Pin
pankazmittal16-Dec-05 11:45
pankazmittal16-Dec-05 11:45 
Thanks for understanding. I am simply pulling the data from table and access it using dataset "dsCC" in following code.

Here is the code I am using:

--------------------Code Starts here-------------------------------

if (dsCC.Tables.Count > 0)
{
dvCC = dsCC.Tables[0].DefaultView ;
if (dvCC.Count > 0)
{
xDoc = new XmlDocument();
XmlElement xElmntRoot;
XmlElement xElmntAccount;
xElmntRoot = xDoc.CreateElement("root");
xDoc.AppendChild(xElmntRoot);
InsertTextNode(xDoc, xElmntRoot, dvCC.Table.Columns[0].ColumnName, Convert.ToString(dvCC[0][0]));

xElmntAccount = xDoc.CreateElement("Accounts"); // xElmntRoot. //xElmntRoot.AppendChild("Accounts");
xElmntRoot.AppendChild(xElmntAccount);

for (int nRowCounter = 0; nRowCounter <= dvCC.Count - 1; nRowCounter++)
{
for (int nColCounter = 1; nColCounter <= dvCC.Table.Columns.Count - 1; nColCounter++)
{
InsertTextNode(xDoc, xElmntAccount, dvCC.Table.Columns[nColCounter].ColumnName, Convert.ToString(dvCC[nRowCounter][nColCounter]));
}
}
sDestinationFileWithPath = HttpContext.Current.Request.ServerVariables["APPL_PHYSICAL_PATH"] + @"ClientConfig.xml";
xDoc.Save(sDestinationFileWithPath);
}
}

private XmlElement InsertTextNode(XmlDocument xDoc,XmlNode xNode ,string strTag, string strText)
{
// Insert a text node a child of xNode.
// Set the tag to be strTag, and the text to be strText. return a pointer to the new node.
XmlNode xNodeTemp;
xNodeTemp = xDoc.CreateElement(strTag);
xNodeTemp.AppendChild(xDoc.CreateTextNode(strText));

xNode.AppendChild(xNodeTemp);

return (XmlElement) (xNodeTemp);
}


--------------------Code Ends-------------------------------

When I open the xml file, the data looks like

<EncryptionType>&amplt;![CDATA[etPublicKey]]&ampgt;</EncryptionType>
-----------------------------
What I want is

<EncryptionType>&lt;![CDATA[etPublicKey]]&gt;</EncryptionType>
-----------------------------



I hope I am clear now Wink | ;) Thanks

Pankaj
AnswerRe: Escape sequence in xml output? Pin
Curtis Schlak.16-Dec-05 12:01
Curtis Schlak.16-Dec-05 12:01 
QuestionListView Color Pin
dbetting16-Dec-05 10:17
dbetting16-Dec-05 10:17 
AnswerRe: ListView Color Pin
Jared Parsons16-Dec-05 11:16
Jared Parsons16-Dec-05 11:16 
GeneralRe: ListView Color Pin
dbetting16-Dec-05 17:57
dbetting16-Dec-05 17:57 
Questiondatagrid cell issue Pin
melanieab16-Dec-05 10:05
melanieab16-Dec-05 10:05 
QuestionWindows Service Stops as soon as it starts Pin
xsoftdev216-Dec-05 9:37
xsoftdev216-Dec-05 9:37 
AnswerRe: Windows Service Stops as soon as it starts Pin
mav.northwind16-Dec-05 20:42
mav.northwind16-Dec-05 20:42 
QuestionCustom URL Handler Pin
notacake16-Dec-05 8:43
notacake16-Dec-05 8:43 
AnswerRe: Custom URL Handler Pin
Curtis Schlak.16-Dec-05 11:33
Curtis Schlak.16-Dec-05 11:33 
GeneralRe: Custom URL Handler Pin
notacake16-Dec-05 12:42
notacake16-Dec-05 12:42 
GeneralRe: Custom URL Handler Pin
Curtis Schlak.17-Dec-05 4:19
Curtis Schlak.17-Dec-05 4:19 
GeneralRe: Custom URL Handler Pin
notacake17-Dec-05 4:28
notacake17-Dec-05 4:28 
GeneralRe: Custom URL Handler Pin
Curtis Schlak.17-Dec-05 11:11
Curtis Schlak.17-Dec-05 11:11 
GeneralRe: Custom URL Handler Pin
notacake20-Dec-05 3:59
notacake20-Dec-05 3:59 
QuestionMorphing widgets: Form to Gradient Form Pin
zopiro16-Dec-05 8:37
zopiro16-Dec-05 8:37 
AnswerRe: Morphing widgets: Form to Gradient Form Pin
g00fyman16-Dec-05 15:31
g00fyman16-Dec-05 15:31 
QuestionReduce the container zone of a panel. Pin
galinace16-Dec-05 8:36
galinace16-Dec-05 8:36 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.