Click here to Skip to main content
14,869,779 members
Home / Discussions / XML / XSL
   

XML / XSL

 
AnswerRe: How do I include PHP codes in an XML file? Pin
Yvan Rodrigues13-Dec-10 14:35
professionalYvan Rodrigues13-Dec-10 14:35 
Questioncreate multiple XML files Pin
hmise30-Nov-10 2:29
Memberhmise30-Nov-10 2:29 
AnswerRe: create multiple XML files Pin
Pete O'Hanlon30-Nov-10 2:57
mvePete O'Hanlon30-Nov-10 2:57 
GeneralRe: create multiple XML files Pin
hmise30-Nov-10 3:20
Memberhmise30-Nov-10 3:20 
GeneralRe: create multiple XML files Pin
Pete O'Hanlon30-Nov-10 4:00
mvePete O'Hanlon30-Nov-10 4:00 
GeneralRe: create multiple XML files Pin
hmise1-Dec-10 2:12
Memberhmise1-Dec-10 2:12 
GeneralRe: create multiple XML files Pin
Pete O'Hanlon1-Dec-10 4:21
mvePete O'Hanlon1-Dec-10 4:21 
QuestionC# XML Query Website address based on Website name Pin
Wheels01224-Nov-10 6:01
MemberWheels01224-Nov-10 6:01 
Good afternoon.

I have the following XML file structure:
<?xml version="1.0" ?> 
- <WEB_SITE>
- <RECORD>
  <Name>Homepage</Name> 
  <Address>http://www.google.com</Address> 
  </RECORD>
  </WEB_SITE>


I would like to derive the URL from the XML file if the name is Homepage.

I have this so far:
string strtmpName = string.Empty;
            string strtmpAddress = string.Empty;

            XmlTextReader reader = null;
            XDocument xmlDoc = new XDocument();
            reader = new XmlTextReader(cv.StrIndivPath1 + strLANID + cv.StrIndivPath2 + "Website.xml");
            xmlDoc = XDocument.Load(reader);
            reader.Close();
            XElement Results = XElement.Parse(xmlDoc.ToString());

            foreach (XElement xe in Results.Elements("RECORD").Descendants())
            {
                switch (xe.Name.ToString())
                {
                    case "Name":
                        if (xe.Value.ToLower() == "homepage")
                        {
                            strtmpAddress = Results.Elements("RECORD").Descendants("Address").ToString();
                            MessageBox.Show(strtmpAddress);
                        }                        
                        break;
                    //case "Address":
                    //    strtmpAddress = xe.Value;
                    //    if (txtAddress.Text == strtmpAddress)
                    //    {
                    //        AddressFlag = true;
                    //    }
                    //    break;
                    default:
                        break;
                }
            }


Any suggestions? Thank you, WHEELS
AnswerRe: C# XML Query Website address based on Website name Pin
Tarun.K.S24-Nov-10 7:30
MemberTarun.K.S24-Nov-10 7:30 
GeneralRe: C# XML Query Website address based on Website name Pin
Wheels01224-Nov-10 7:41
MemberWheels01224-Nov-10 7:41 
GeneralRe: C# XML Query Website address based on Website name Pin
Tarun.K.S24-Nov-10 7:50
MemberTarun.K.S24-Nov-10 7:50 
GeneralRe: C# XML Query Website address based on Website name Pin
Wheels01224-Nov-10 7:59
MemberWheels01224-Nov-10 7:59 
GeneralRe: C# XML Query Website address based on Website name Pin
Tarun.K.S24-Nov-10 18:18
MemberTarun.K.S24-Nov-10 18:18 
QuestionHow to populate an XmlNamespaceManager Pin
PIEBALDconsult13-Nov-10 5:17
professionalPIEBALDconsult13-Nov-10 5:17 
AnswerRe: How to populate an XmlNamespaceManager Pin
Ger Hayden13-Nov-10 7:11
MemberGer Hayden13-Nov-10 7:11 
AnswerRe: How to populate an XmlNamespaceManager -- update Pin
PIEBALDconsult15-Nov-10 2:38
professionalPIEBALDconsult15-Nov-10 2:38 
GeneralRe: How to populate an XmlNamespaceManager -- update Pin
lorenkins16-Nov-10 6:45
Memberlorenkins16-Nov-10 6:45 
GeneralRe: How to populate an XmlNamespaceManager -- update Pin
PIEBALDconsult16-Nov-10 18:22
professionalPIEBALDconsult16-Nov-10 18:22 
QuestionRead XML in C# Pin
ShafiqA3-Oct-10 19:02
MemberShafiqA3-Oct-10 19:02 
AnswerRe: Read XML in C# Pin
Ger Hayden16-Oct-10 3:06
MemberGer Hayden16-Oct-10 3:06 
AnswerRe: Read XML in C# Pin
PIEBALDconsult13-Nov-10 4:47
professionalPIEBALDconsult13-Nov-10 4:47 
AnswerRe: Read XML in C# Pin
Tarun.K.S19-Nov-10 23:16
MemberTarun.K.S19-Nov-10 23:16 
GeneralRe: Read XML in C# Pin
Tarun.K.S20-Nov-10 1:54
MemberTarun.K.S20-Nov-10 1:54 
AnswerRe: Read XML in C# Pin
Yvan Rodrigues13-Dec-10 14:42
professionalYvan Rodrigues13-Dec-10 14:42 
Questionxml Pin
vijiajai25-Sep-10 19:37
Membervijiajai25-Sep-10 19:37 

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.