Re: Cannot retrieve attribute value
From: AlBruAn (albruan_at_hotmail.com.(donotspam))
Date: 12/11/04
- Previous message: Doug Holton: "Re: don't serialize boolean property if false?"
- In reply to: Mujtaba Syed: "Re: Cannot retrieve attribute value"
- Messages sorted by: [ date ] [ thread ]
Date: Fri, 10 Dec 2004 16:01:03 -0800
Thanks, that's the answer...I'd tried nearly everything BUT that!
"Mujtaba Syed" wrote:
> One of the ways is -
>
> XmlDocument doc = new XmlDocument ();
>
> doc.LoadXml
>
> (
>
> @"
>
> <jdeResponse type='callmethod' user='JWRIGHT' pwd='JWRIGHT' environment='DEV' session=''>
>
> <returnCode code='12'>
>
> Environment 'DEV' could not be initialized for user, check user, pwd
>
> and environment attribute values
>
> </returnCode>
>
> </jdeResponse>"
>
> );
>
> Console.WriteLine (doc.DocumentElement.FirstChild.Attributes [0].Value);
>
>
>
> In case you are using XmlReader:
>
>
>
>
>
> XmlDocument doc
> "AlBruAn" <albruan@hotmail.com.(donotspam)> wrote in message news:8AC54A0A-8DA6-4729-A5A7-AEE39AF3D032@microsoft.com...
> > An application I'm helping develop transmits XML to an ERP and receives an
> > XML statement showing the result of the transmittal to the ERP. I've pasted
> > a copy of one of the response XML statements. I have no trouble retrieving
> > the statement "Environment 'DEV' could not be initialized for user; check
> > user, pwd and environment attribute values", which we're storing in our SQL
> > Server. However, I also need to retrieve the value for the code attribute,
> > which is 12 in this case, to pass back up to the user; retrieving that value
> > is the sticking point. How do I go about accomplishing that?
> >
> > <?xml version='1.0'?>
> > <jdeResponse type='callmethod' user='JWRIGHT' pwd='JWRIGHT'
> > environment='DEV' session=''>
> > <returnCode code='12'>Environment 'DEV' could not be initialized for user,
> > check user, pwd and environment attribute values</returnCode>
> > </jdeResponse>
- Previous message: Doug Holton: "Re: don't serialize boolean property if false?"
- In reply to: Mujtaba Syed: "Re: Cannot retrieve attribute value"
- Messages sorted by: [ date ] [ thread ]
Relevant Pages
|