Click here to Skip to main content
15,899,754 members
Home / Discussions / XML / XSL
   

XML / XSL

 
Questionxsd:time XML - .NET Pin
Anonymous29-Aug-05 3:44
Anonymous29-Aug-05 3:44 
QuestionMSXML DOM help Pin
johnnyXP27-Aug-05 3:07
johnnyXP27-Aug-05 3:07 
QuestionProblem loading XML Pin
rscr26-Aug-05 3:55
rscr26-Aug-05 3:55 
NewsA very simple problem with XML Pin
benqazou26-Aug-05 2:34
benqazou26-Aug-05 2:34 
AnswerRe: A very simple problem with XML Pin
DavidNohejl26-Aug-05 3:07
DavidNohejl26-Aug-05 3:07 
GeneralRe: A very simple problem with XML Pin
benqazou26-Aug-05 5:11
benqazou26-Aug-05 5:11 
GeneralRe: A very simple problem with XML Pin
DavidNohejl26-Aug-05 6:11
DavidNohejl26-Aug-05 6:11 
GeneralRe: A very simple problem with XML Pin
softty30-Aug-05 1:43
softty30-Aug-05 1:43 
Hi, since it is a simple requirement, I have placed a simple solution
Try this..
//////////////////////////////////////////
using System;
using System.Xml;

namespace ConsoleApplication1
{
/* c:\pk.xml

<people>
<person>
<lname> Washington
<fname> George


<person>
<lname> Lincoln
<fname> Abraham


*/


class XmlTest
{

XmlDocument doc;//

public XmlTest()
{
doc = new XmlDocument();
doc.Load("c:\\pk.xml"); // put your file path
}
public void Run()
{
while(true)
{
Console.Write("\nEnter a Name: ");
string input = Console.ReadLine();
if(input == "" || input==null)
break;
Console.WriteLine("Your FName is " + GetFName(input));
}
}
public string GetFName(string lname)
{
string ret = "Unknown" ;
XmlNodeList lnode = doc.GetElementsByTagName("Lname");
for(int i=0; i< lnode.Count; i++)
{
if(lnode.Item(i).InnerText.Trim() == lname.Trim())
{
ret = lnode.Item(i).ParentNode.LastChild.InnerText;
break;
}
}
return ret;
}

public static void Main()
{
XmlTest xmlDoc = new XmlTest();
xmlDoc.Run();
}
}
}


love2code
QuestionParse XML to memory from a string Pin
25-Aug-05 1:25
suss25-Aug-05 1:25 
AnswerRe: Parse XML to memory from a string Pin
DavidNohejl25-Aug-05 3:55
DavidNohejl25-Aug-05 3:55 
QuestionWSE 2.0 Encryption Problem Pin
AmandeepSBhatia25-Aug-05 0:49
AmandeepSBhatia25-Aug-05 0:49 
JokeAreas generated by formatting objects Pin
wasife24-Aug-05 23:58
wasife24-Aug-05 23:58 
GeneralXML Serialization private field problem Pin
scchan198422-Aug-05 15:51
scchan198422-Aug-05 15:51 
Generalregarding webservices Pin
satishrg22-Aug-05 7:21
satishrg22-Aug-05 7:21 
GeneralRe: regarding webservices [edited] Pin
DavidNohejl22-Aug-05 9:11
DavidNohejl22-Aug-05 9:11 
Generalsample xml from xsd Pin
gustavo.sierra18-Aug-05 20:13
gustavo.sierra18-Aug-05 20:13 
GeneralRe: sample xml from xsd Pin
Christian Graus22-Aug-05 11:06
protectorChristian Graus22-Aug-05 11:06 
GeneralRe: sample xml from xsd Pin
Thanh Dao29-Aug-05 18:55
Thanh Dao29-Aug-05 18:55 
GeneralRe: sample xml from xsd Pin
gustavo.sierra29-Aug-05 20:26
gustavo.sierra29-Aug-05 20:26 
Generalhelp with xslt Pin
sonya987917-Aug-05 16:47
sonya987917-Aug-05 16:47 
GeneralRe: help with xslt Pin
Anonymous25-Aug-05 4:55
Anonymous25-Aug-05 4:55 
Generalhelp rendering with xslt Pin
sonya987917-Aug-05 16:40
sonya987917-Aug-05 16:40 
GeneralPagination using XSL Pin
ramdhage16-Aug-05 0:43
ramdhage16-Aug-05 0:43 
QuestionHow to write xml tag in attribute value? Pin
Sachin Gedam15-Aug-05 20:56
Sachin Gedam15-Aug-05 20:56 
AnswerRe: How to write xml tag in attribute value? Pin
DavidNohejl16-Aug-05 0:41
DavidNohejl16-Aug-05 0:41 

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.