NSXMLElement elementsForName: bug
| Originator: | robbiehanson | ||
| Number: | rdar://5242500 | Date Originated: | 01-Jun-2007 05:28 AM |
| Status: | Open | Resolved: | |
| Product: | Mac OS X | Product Version: | |
| Classification: | Serious Bug | Reproducible: | YES |
Summary:
The NSXMLElement method "elementsForName:" fails to return the correct results in certain situations.
Steps to Reproduce:
1. Create (or otherwise obtain) an NSXMLElement similar in form to the following element:
<a xmlns="ns1">
<b xmlns="ns2">
</b>
</a>
2. Attempt to get "b" from "a" using the NSXMLElement method elementsForName:
Expected Results:
Once would expect to get an array containing "b".
Actual Results:
An array that does NOT contain "b".
Regression:
This problem occurs every time.
However, it will work properly if:
1. "a" does not contain an xmlns.
2. "b" does not contain an xmlns.
3. "a" and "b" contain the same xmlns.
Notes:
Note that using the method elementsForLocalName:URI: method works properly.
However, this is certainly not a proper workaround. There are situations where the xmlns is not known in advance. This is the situation I have run into while working with some Jabber code. I know the name of the element, but it's the xmlns information I'm trying to get!
Comments
Please note: Reports posted here will not necessarily be seen by Apple. All problems should be submitted at bugreport.apple.com before they are posted here. Please only post information for Radars that you have filed yourself, and please do not include Apple confidential information in your posts. Thank you!