Skip to content

Instantly share code, notes, and snippets.

@itod
Last active August 29, 2015 14:00
Show Gist options
  • Save itod/d6f6e73a1b0b8525f703 to your computer and use it in GitHub Desktop.
Save itod/d6f6e73a1b0b8525f703 to your computer and use it in GitHub Desktop.
NSXML XPath AttributeTest bug
/*/attribute(*)
Should match any attribute on the document (outermost) element. NSXML fails.
From XPath 2.0 Spec:
http://www.w3.org/TR/xpath20/#abbrev
If the axis name is omitted from an axis step, the default axis is child unless the axis step contains an AttributeTest or SchemaAttributeTest; in that case, the default axis is attribute. For example, the path expression section/para is an abbreviation for child::section/child::para, and the path expression section/@id is an abbreviation for child::section/attribute::id. Similarly, section/attribute(id) is an abbreviation for child::section/attribute::attribute(id). Note that the latter expression contains both an axis specification and a node test.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment