Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

firstChildWithTag: does not work with 'text' #21

Closed
rhodgkins opened this issue Aug 30, 2014 · 1 comment
Closed

firstChildWithTag: does not work with 'text' #21

rhodgkins opened this issue Aug 30, 2014 · 1 comment

Comments

@rhodgkins
Copy link
Contributor

Hi,

When trying to parse the following:

<elementType>
    <multiCheckBox>
        <checkBoxes>
            <checkBox>
                <text>Text 0</text>
                <answerCode>Code 0</answerCode>
            </checkBox>
        </checkBoxes>
    </multiCheckBox>
</elementType>

Using:

    NSString *XPath = @"/elementType/multiCheckBox/checkBoxes/checkBox";
    ONOXMLElement *checkBoxElement = [self.document firstChildWithXPath:XPath];
    ONOXMLElement *textElement = [checkBoxElement firstChildWithTag:@"text"];
    ONOXMLElement *answerCodeElement = [checkBoxElement firstChildWithTag:@"answerCode"];

textElement is nil, but answerCodeElement is not nil!

However using firstChildWithXPath: instead of firstChildWithTag: works!

Bit of a weird issue! I've created a few failing test cases the in the associated pull request...

Any ideas? I've gotten around it for now using firstChildWithXPath:, but I can't see anything going wrong :(

Cheers,

Rich

rhodgkins added a commit to rhodgkins/Ono that referenced this issue Aug 30, 2014
…inding 'text' elements with 'firstChildWithTag'
@rhodgkins rhodgkins changed the title firstChildWithTag does not work with 'text' firstChildWithTag: does not work with 'text' Aug 30, 2014
@mattt
Copy link
Owner

mattt commented Aug 30, 2014

Moving discussion over to #22.

@mattt mattt closed this as completed Aug 30, 2014
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants