Click here to Skip to main content
15,915,172 members
Home / Discussions / XML / XSL
   

XML / XSL

 
AnswerRe: what is XML? Pin
HimaBindu Vejella14-Mar-06 0:17
HimaBindu Vejella14-Mar-06 0:17 
QuestionAdd Image in XML Pin
LovelyHelp9-Mar-06 0:31
LovelyHelp9-Mar-06 0:31 
AnswerRe: Add Image in XML Pin
LovelyHelp14-Mar-06 23:24
LovelyHelp14-Mar-06 23:24 
QuestionDataTable.WriteXML gives incorrect output Pin
magja7-Mar-06 4:01
magja7-Mar-06 4:01 
Questionxmldom Pin
Hamid_RT7-Mar-06 0:28
Hamid_RT7-Mar-06 0:28 
AnswerRe: xmldom Pin
imsathy7-Mar-06 19:34
imsathy7-Mar-06 19:34 
GeneralRe: xmldom Pin
Hamid_RT7-Mar-06 20:18
Hamid_RT7-Mar-06 20:18 
QuestionHow to get the datatype of an XML element using C# Pin
Enigma34404-Mar-06 2:50
Enigma34404-Mar-06 2:50 
Hi,
I am having an XML file which has two elments id & StartDate, Iam using Visual C# > XMLTextReader Object "reader" to read this file, if the nodetype is text and the elementname is startdate then write the startdate by converting it. If you see the below code hope every thing gets clear
Insted of getting the value I want to search if the XmlNodeType is text then I want to get the datatype (i.e. date or string or int32 etc.) of the element insted of the value

System.IO.Stream objStream = new System.IO.MemoryStream();
DataSet objDs = new DataSet();
objDs = getData();
XmlTextReader reader = new XmlTextReader(objDs.GetXml(), XmlNodeType.Element, null) ;
Response.ContentType = "text/xml";
XmlTextWriter writer = new XmlTextWriter(Response.OutputStream, System.Text.Encoding.UTF8);
writer.Indentation = 4;
writer.WriteStartDocument();
string elementName = "";
while(reader.Read())
{
switch(reader.NodeType)
{
case XmlNodeType.Element:
writer.WriteStartElement(reader.Name);
elementName = reader.Name;
break;
// In the below case I have a problem I want to get the datatype of the node insted of the data
case XmlNodeType.Text:
if(elementName == "StartDate")
writer.WriteString(XmlConvert.ToDateTime(reader.Value).ToString());
else
writer.WriteString(reader.Value);
break;
case XmlNodeType.EndElement:
writer.WriteEndElement();
break;
}
AnswerRe: How to get the datatype of an XML element using C# Pin
Denevers31-Mar-06 18:01
Denevers31-Mar-06 18:01 
Question"unable to establish connection to network" exception Pin
amresawy2-Mar-06 10:08
amresawy2-Mar-06 10:08 
QuestionBest way to feed xml Pin
krsouthern27-Feb-06 22:36
krsouthern27-Feb-06 22:36 
AnswerRe: Best way to feed xml Pin
imsathy2-Mar-06 19:26
imsathy2-Mar-06 19:26 
QuestionLooking for an XML Edit Control Pin
Nockawa27-Feb-06 10:00
Nockawa27-Feb-06 10:00 
Questionmatlab to xml coversion Pin
aksaqua26-Feb-06 22:13
aksaqua26-Feb-06 22:13 
QuestionXmlTextWriter C# invalid characters o;? Pin
rambo29826-Feb-06 8:37
rambo29826-Feb-06 8:37 
QuestionConvert xml dataset to string Pin
ironstrike125-Feb-06 12:47
ironstrike125-Feb-06 12:47 
AnswerRe: Convert xml dataset to string Pin
ironstrike125-Feb-06 12:49
ironstrike125-Feb-06 12:49 
QuestionXSD Validation Pin
Al Ortega25-Feb-06 5:21
Al Ortega25-Feb-06 5:21 
QuestionConversion of Excel Worksheet Data in to XML file Format Pin
winpoorni23-Feb-06 17:58
winpoorni23-Feb-06 17:58 
QuestionWatermark Pin
sreejith ss nair23-Feb-06 2:38
sreejith ss nair23-Feb-06 2:38 
AnswerRe: Watermark Pin
George L. Jackson24-Feb-06 1:07
George L. Jackson24-Feb-06 1:07 
QuestionXSD information in resx file Pin
sumit malik23-Feb-06 0:24
sumit malik23-Feb-06 0:24 
QuestionXmlDocument.NameTable vs namespaces Pin
chricla23-Feb-06 0:14
chricla23-Feb-06 0:14 
AnswerRe: XmlDocument.NameTable vs namespaces Pin
Douglas Troy3-Mar-06 6:47
Douglas Troy3-Mar-06 6:47 
QuestionPlease help - a question on XPath... Pin
Tigger9922-Feb-06 3:04
Tigger9922-Feb-06 3:04 

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.