Skip to content
This repository has been archived by the owner on Aug 22, 2020. It is now read-only.

Help With Name function #33

Closed
CodyKarch opened this issue Oct 13, 2015 · 3 comments
Closed

Help With Name function #33

CodyKarch opened this issue Oct 13, 2015 · 3 comments

Comments

@CodyKarch
Copy link
Collaborator

Hey, I'm trying to use this: //body//name(attribute::*) but it won't work. Help?

@brookestewart
Copy link
Collaborator

Try //body//@*/../name() I believe this works correctly...
Is it for question 2d.? I'm not sure if we need the names of them or not.

@KariWomack
Copy link
Collaborator

This just pulled up errors for me...:(

@RJP43
Copy link
Collaborator

RJP43 commented Oct 14, 2015

trying simplifying even what @brookestewart suggests.... you want to tell XPath to go down throughout your entire document // and find all the attributes @.

Brooke and @CodyKarch you both are on the right track with the asterisk. You just don't need to over complicate it especially since you will want to build off this first expression of finding all of the attributes in order to get the names of those attributes.

After you get the first part you very simply can get the second by telling XPath to now step further / and get the names name()

Well Done Brooke jumping on these issues with your useful tips!

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants