Public.Parser.XML2
Namespaces in XML2Public.Parser.XML2 handles namespaces a bit differently than Parser.XML. This brief overview of the process should help explain things a little better.get_attributes() will return all attributes without their namespace attached. In cases where there are two attributes with the same "local" name, the first defined attribute will be returned.For example, in this contrived xml snippet: <soap:Envelope xmlns:soap="http://www.w3.org/2001/12/soap-envelope" nonsatt="foo" soap:encodingStyle="http://www.w3.org/2001/12/soap-encoding" soap:collision="1" collision="2"> </soap:Envelope> > n->get_attributes(); (1) Result: ([ /* 3 elements */ "collision": "1", "encodingStyle": "http://www.w3.org/2001/12/soap-encoding", "nonsatt": "foo" ]) n->get_ns_attributes("http://www.w3.org/2001/12/soap-envelope");(2) Result: ([ /* 2 elements */ "collision": "1", "encodingStyle": "http://www.w3.org/2001/12/soap-encoding" ]) Powered by PikeWiki2 |
|||
gotpike.org | Copyright © 2004 - 2009 | Pike is a trademark of Department of Computer and Information Science, Linköping University |