hi, while playing with the SAML specs I found that one must insert a node like this if the call succeded
<status xmlns:z=mynamspace" ...
<z:statuscode result="z:Sucess"/>
...
How do I set up an XPATH filter that veriffies if the call succeed ? .. I mean i cannot hardcode z:Success since another one could pass me out a doc like this
<x xmlns:k=mynamspace" ...
<k:statuscode result="k:Sucess"/>
...
The code I wrote is something like what you see below .. however I wonder if there is a way to make xpath aware of namepsace while evaluating elements and attributes text ..
I mean, what an XSd parser does when meets type="xsd:string" ?
string s = "<a xmlns:k='abcd' ><b k:aa='k:success'></b></a>";
System.Xml.XmlDocument doc = new System.Xml.XmlDocument ();
doc.LoadXml (s);
XmlNamespaceManager ns = new XmlNamespaceManager (doc.NameTable );
ns.AddNamespace ("xx","abcd");
string dd = "//@xx:aa[.='" + doc.DocumentElement.GetPrefixOfNamespace("abcd") + ":success']";
XmlNode x = doc.SelectSingleNode (dd,ns);
System.Diagnostics.Debug.WriteLine ( x.InnerText );
suggestions are welcome
--
Enrico Sabbadin
Mail: sa******@sabbasoft.com
Website: http://www.sabbasoft.com
********
MTS - COM+ - VBCOM - Enterprise Services - Security FAQ
..NET & COM+ books selected list
********
Blog: http://www.sabbasoft.com/myblog
Affiliated Sites
http://www.vb2themax.com
http://www.codearchitects.com