{"id":"xpath10-select","version":"1.0.0","description":"Select an XPath 1.0 node-set from location paths, axes, predicates, namespaces and union, in document order.","supported_operations":["select xml nodes with xpath 1.0","xpath 1.0 node set from location path","evaluate xpath axes predicates and union","match elements attributes and namespaces by xpath","xpath absolute and relative location path","filter xml nodes with xpath predicates"],"unsupported_operations":["XPath 2.0 eq, except, intersect and wildcard *:local tests","arithmetic, variables, and functions other than position() and last()","DOCTYPE, DTD and XML versions other than 1.0","returning a count or a canonical path (use xpath10-count and xpath10-paths)"],"semantics":["Context node is the document root. Relative paths start there, so doc/para equals /doc/para when doc is the document element.","The expression is a union of location paths and parenthesized filters, using all 13 axes, abbreviations, name tests, and predicates. The path / is the root node-set.","Predicates run per context node in proximity order. //para[1] is the first para child of each parent. (//para)[1] is the first para in document order.","Comparisons follow XPath 1.0 section 3.4, including existential node-set tests. != is not the negation of =.","Unprefixed names match the null namespace only. The xml prefix is always http://www.w3.org/XML/1998/namespace and cannot be rebound.","Results are deduplicated and emitted in pinned document order: root, then each element, its namespace nodes sorted by prefix, its attributes in source order, then its children.","String-value of a root or element is descendant text only. A quoted ] or an attribute value containing > is data, not a closer.","Arithmetic, variables, functions other than position() and last(), XPath 2.0 syntax, DOCTYPE and non-1.0 XML are unsupported_input. Limits fail with limit_exceeded."],"limits":{"max_xml_bytes":4096,"max_expression_bytes":1024,"max_depth":32,"max_nodes":400,"max_steps":100000,"max_output_bytes":32768,"max_namespace_bindings":16,"max_namespace_uri_bytes":512,"max_name_chars":256,"max_union_operands":32,"max_xpath_depth":32},"pricing":{"status":"unpriced","charge_usd":null},"input_schema":{"type":"object","additionalProperties":false,"required":["xml","expression"],"properties":{"xml":{"type":"string","minLength":1,"maxLength":4096},"expression":{"type":"string","minLength":1,"maxLength":1024},"namespaces":{"type":"object","additionalProperties":{"type":"string","minLength":1,"maxLength":512},"maxProperties":16}}},"output_schema":{"type":"object","additionalProperties":false,"required":["count","nodes"],"properties":{"count":{"type":"integer","minimum":0,"maximum":400},"nodes":{"type":"array","maxItems":400,"items":{"type":"object","additionalProperties":false,"required":["kind","name","namespace_uri","string_value"],"properties":{"kind":{"type":"string","enum":["root","element","attribute","text","comment","processing-instruction","namespace"]},"name":{"type":"string","maxLength":256},"namespace_uri":{"type":"string","maxLength":512},"string_value":{"type":"string","maxLength":4096}}}}}},"examples":[{"input":{"xml":"<doc><para>Hi</para></doc>","expression":"/doc/para"},"output":{"count":1,"nodes":[{"kind":"element","name":"para","namespace_uri":"","string_value":"Hi"}]}},{"input":{"xml":"<doc/>","expression":"/ | /doc"},"output":{"count":2,"nodes":[{"kind":"root","name":"","namespace_uri":"","string_value":""},{"kind":"element","name":"doc","namespace_uri":"","string_value":""}]}},{"input":{"xml":"<doc><para>A</para><sec><para>B</para></sec></doc>","expression":"//para[1]"},"output":{"count":2,"nodes":[{"kind":"element","name":"para","namespace_uri":"","string_value":"A"},{"kind":"element","name":"para","namespace_uri":"","string_value":"B"}]}}],"execute_url":"/v1/tools/xpath10-select/versions/1.0.0/execute"}