Note that there are some explanatory texts on larger screens.

plurals
  1. POXpath return node relative to another node
    primarykey
    data
    text
    <p>I have done a search for all nodes that have an attribute containing (substring) a String. These nodes can be found at different levels of the tree, sometimes 5 or 6 levels deep. I'd like to know what parent/ancestor node they correspond to at a specified level, 2 levels deep. The result for the search only should be much greater than the results for the corresponding parents.</p> <p>EDIT to include code: <code>/xs:schema/xs:element/descendant::node()/@*[starts-with(., 'my-search-string-here')]</code></p> <p>EDIT to clarify my intent:</p> <p>When I execute the Xpath above sometimes the results are</p> <p><code>/xs:schema/xs:element/xs:complexType/xs:attribute</code> or <code>/xs:schema/xs:element/xs:complexType/xs:sequence/xs:element</code> or <code>/xs:schema/xs:element/xs:complexType/xs:complexContent/xs:extension/xs:sequence/xs:element</code></p> <p>These results indicate a place in the Schema where I have added application specific code. However, I need to remove this code now. I'm building an "adapter" schema that will <code>redefine</code> the original Schema (untouched) and <code>import</code> <em>my</em> schema. The String I am searching for is my prefix. What I need is the @name of the /xs:schema/node() in which the prefix is found, so I can create a new schema defining these elements. They will be imported into the adapter and redefine another schema (that I'm not supposed to modify).</p> <p>To reiterate, I need to search all the attributes (descendants of /xs:schema/xs:element) for a prefix, and then get the corresponding /xs:schema/xs:element/@name for each of the matches to the search.</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload