is there proceed collect elements controlling wholly internal names linq-to-xml query?
lets assume have xml:
<?xml version="1.0" encoding="utf-8"?>
<tns:registryresponse status="urn:oasis:names:tc:ebxml-regrep:responsestatustype:failure"
xmlns:tns="urn:oasis:names:tc:ebxml-regrep:xsd:rs:3.0"
xmlns:rim="urn:oasis:names:tc:ebxml-regrep:xsd:rim:3.0">
<tns:registryerrorlist highestseverity="">
<tns:registryerror codecontext="xdsinvalidrequest - dcoumentid unique."
errorcode="xdsinvalidrequest"
severity="urn:oasis:names:tc:ebxml-regrep:errorseveritytype:error"/>
</tns:registryerrorlist>
</tns:registryresponse>
to collect registryerrorlist element,
xdocument doc = xdocument.load(<path xml file>);
xnamespace ns = "urn:oasis:names:tc:ebxml-regrep:xsd:rs:3.0";
xelement errorlist = doc.root.elements( ns + "registryerrorlist").singleordefault();
but this
xelement errorlist = doc.root.elements("registryerrorlist").singleordefault();
is there proceed query but namespace element. basicly there something conceptially
similiar controlling local-name() xpath (i.e. //*[local-name()='registryerrorlist'])
Comments
Post a Comment