How to use XPath to find a node using just an attribute value [duplicate]XPath selecting a node with some attribute value equals to some other node's attribute valuexpath: find a node that has a given attribute whose value contains a stringSelectSingleNode returning null for known good xml node path using XPathUsing XPath, How do I select a node based on its text content and value of an attribute?XPath contains(text(),'some string') doesn't work when used with node with more than one Text subnodeGetting attribute using XPathExtract value of attribute node via XPathExtract nodes based on attribute and node valuesXSLT to update an attribute given just the new value and XPath to the attributeI need to select the attribute given of a node that have an attribute named TypeCode with a value of REF, i can't find the right XPath queryXPath select nodes with attribute names

Would there be balance issues if I allowed opportunity attacks against any creature, not just hostile ones?

Why does this regexpatch command only work once, not twice?

Playing boules... IN SPACE!

Ways you can end up paying interest on a credit card if you pay the full amount back in due time

How to fit Schwalbe Marathon Plus 28-622 on 622-16 rim

Why KVM VPS is slower then OPENVZ

If the UK government illegally doesn't ask for article 50 extension, can parliament do it instead?

Mathematica not simplifying rational powers in complex expressions

Function of the separated, individual solar cells on Telstar 1 and 2? Why were they "special"?

Why are my split equations aligned to right by default?

Punishment in pacifist society

Is torque as fundamental a concept as force?

Why do we need explainable AI?

What is a "fat pointer" in Rust?

When do we use "no women" instead of "no woman"?

Why do modes sound so different, although they are basically the same as a mode of another scale?

Received email from ISP saying one of my devices has malware

Babies - are we talking about their birth, arrival or delivery?

How does the search space affect the speed of an ILP solver?

To which country did MiGs in Top Gun belong?

In mathematics is there a substitution that is "different" from Vieta's substitution to solve the cubic equation?

Calculate Landau's function

Can a Centaur utilize a mount?

Why doesn’t this recursive CTE with a parameter use an index when it does with a literal?



How to use XPath to find a node using just an attribute value [duplicate]


XPath selecting a node with some attribute value equals to some other node's attribute valuexpath: find a node that has a given attribute whose value contains a stringSelectSingleNode returning null for known good xml node path using XPathUsing XPath, How do I select a node based on its text content and value of an attribute?XPath contains(text(),'some string') doesn't work when used with node with more than one Text subnodeGetting attribute using XPathExtract value of attribute node via XPathExtract nodes based on attribute and node valuesXSLT to update an attribute given just the new value and XPath to the attributeI need to select the attribute given of a node that have an attribute named TypeCode with a value of REF, i can't find the right XPath queryXPath select nodes with attribute names






.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty margin-bottom:0;








0
















This question already has an answer here:



  • XPath selecting a node with some attribute value equals to some other node's attribute value [closed]

    2 answers



If I have a (fragment of) xml like this:



<flowreferences>
<ref>123</ref>
<ref>563</ref>
<ref>902</ref>
<ref>674</ref>
<ref>295</ref>
<ref>887</ref>
<ref>371</ref>
</flowreferences>
<object1 id="123">
......
</object1>
<object1 id="563">
......
</object2>
<object2 id="887">
......
</object2>
<object3 id="674">
......
</object3>
<object4 id="295">
......
</object4>
<object5 id="907">
......
</object5>
<object6 id="371">
......
</object6>


Is there a Xpath query to return the object node given JUST the attribute value? In other words, if I know the id value (907), how do I find the object5 node?










share|improve this question














marked as duplicate by Kirill Polishchuk xml
Users with the  xml badge can single-handedly close xml questions as duplicates and reopen them as needed.

StackExchange.ready(function()
if (StackExchange.options.isMobile) return;

$('.dupe-hammer-message-hover:not(.hover-bound)').each(function()
var $hover = $(this).addClass('hover-bound'),
$msg = $hover.siblings('.dupe-hammer-message');

$hover.hover(
function()
$hover.showInfoMessage('',
messageElement: $msg.clone().show(),
transient: false,
position: my: 'bottom left', at: 'top center', offsetTop: -7 ,
dismissable: false,
relativeToBody: true
);
,
function()
StackExchange.helpers.removeMessages();

);
);
);
Mar 28 at 2:23


This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.





migrated from superuser.com Mar 28 at 1:44


This question came from our site for computer enthusiasts and power users.

























    0
















    This question already has an answer here:



    • XPath selecting a node with some attribute value equals to some other node's attribute value [closed]

      2 answers



    If I have a (fragment of) xml like this:



    <flowreferences>
    <ref>123</ref>
    <ref>563</ref>
    <ref>902</ref>
    <ref>674</ref>
    <ref>295</ref>
    <ref>887</ref>
    <ref>371</ref>
    </flowreferences>
    <object1 id="123">
    ......
    </object1>
    <object1 id="563">
    ......
    </object2>
    <object2 id="887">
    ......
    </object2>
    <object3 id="674">
    ......
    </object3>
    <object4 id="295">
    ......
    </object4>
    <object5 id="907">
    ......
    </object5>
    <object6 id="371">
    ......
    </object6>


    Is there a Xpath query to return the object node given JUST the attribute value? In other words, if I know the id value (907), how do I find the object5 node?










    share|improve this question














    marked as duplicate by Kirill Polishchuk xml
    Users with the  xml badge can single-handedly close xml questions as duplicates and reopen them as needed.

    StackExchange.ready(function()
    if (StackExchange.options.isMobile) return;

    $('.dupe-hammer-message-hover:not(.hover-bound)').each(function()
    var $hover = $(this).addClass('hover-bound'),
    $msg = $hover.siblings('.dupe-hammer-message');

    $hover.hover(
    function()
    $hover.showInfoMessage('',
    messageElement: $msg.clone().show(),
    transient: false,
    position: my: 'bottom left', at: 'top center', offsetTop: -7 ,
    dismissable: false,
    relativeToBody: true
    );
    ,
    function()
    StackExchange.helpers.removeMessages();

    );
    );
    );
    Mar 28 at 2:23


    This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.





    migrated from superuser.com Mar 28 at 1:44


    This question came from our site for computer enthusiasts and power users.





















      0












      0








      0









      This question already has an answer here:



      • XPath selecting a node with some attribute value equals to some other node's attribute value [closed]

        2 answers



      If I have a (fragment of) xml like this:



      <flowreferences>
      <ref>123</ref>
      <ref>563</ref>
      <ref>902</ref>
      <ref>674</ref>
      <ref>295</ref>
      <ref>887</ref>
      <ref>371</ref>
      </flowreferences>
      <object1 id="123">
      ......
      </object1>
      <object1 id="563">
      ......
      </object2>
      <object2 id="887">
      ......
      </object2>
      <object3 id="674">
      ......
      </object3>
      <object4 id="295">
      ......
      </object4>
      <object5 id="907">
      ......
      </object5>
      <object6 id="371">
      ......
      </object6>


      Is there a Xpath query to return the object node given JUST the attribute value? In other words, if I know the id value (907), how do I find the object5 node?










      share|improve this question















      This question already has an answer here:



      • XPath selecting a node with some attribute value equals to some other node's attribute value [closed]

        2 answers



      If I have a (fragment of) xml like this:



      <flowreferences>
      <ref>123</ref>
      <ref>563</ref>
      <ref>902</ref>
      <ref>674</ref>
      <ref>295</ref>
      <ref>887</ref>
      <ref>371</ref>
      </flowreferences>
      <object1 id="123">
      ......
      </object1>
      <object1 id="563">
      ......
      </object2>
      <object2 id="887">
      ......
      </object2>
      <object3 id="674">
      ......
      </object3>
      <object4 id="295">
      ......
      </object4>
      <object5 id="907">
      ......
      </object5>
      <object6 id="371">
      ......
      </object6>


      Is there a Xpath query to return the object node given JUST the attribute value? In other words, if I know the id value (907), how do I find the object5 node?





      This question already has an answer here:



      • XPath selecting a node with some attribute value equals to some other node's attribute value [closed]

        2 answers







      xml xpath






      share|improve this question













      share|improve this question











      share|improve this question




      share|improve this question










      asked Mar 28 at 1:42









      stoneyowlstoneyowl

      114 bronze badges




      114 bronze badges





      marked as duplicate by Kirill Polishchuk xml
      Users with the  xml badge can single-handedly close xml questions as duplicates and reopen them as needed.

      StackExchange.ready(function()
      if (StackExchange.options.isMobile) return;

      $('.dupe-hammer-message-hover:not(.hover-bound)').each(function()
      var $hover = $(this).addClass('hover-bound'),
      $msg = $hover.siblings('.dupe-hammer-message');

      $hover.hover(
      function()
      $hover.showInfoMessage('',
      messageElement: $msg.clone().show(),
      transient: false,
      position: my: 'bottom left', at: 'top center', offsetTop: -7 ,
      dismissable: false,
      relativeToBody: true
      );
      ,
      function()
      StackExchange.helpers.removeMessages();

      );
      );
      );
      Mar 28 at 2:23


      This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.





      migrated from superuser.com Mar 28 at 1:44


      This question came from our site for computer enthusiasts and power users.











      marked as duplicate by Kirill Polishchuk xml
      Users with the  xml badge can single-handedly close xml questions as duplicates and reopen them as needed.

      StackExchange.ready(function()
      if (StackExchange.options.isMobile) return;

      $('.dupe-hammer-message-hover:not(.hover-bound)').each(function()
      var $hover = $(this).addClass('hover-bound'),
      $msg = $hover.siblings('.dupe-hammer-message');

      $hover.hover(
      function()
      $hover.showInfoMessage('',
      messageElement: $msg.clone().show(),
      transient: false,
      position: my: 'bottom left', at: 'top center', offsetTop: -7 ,
      dismissable: false,
      relativeToBody: true
      );
      ,
      function()
      StackExchange.helpers.removeMessages();

      );
      );
      );
      Mar 28 at 2:23


      This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.





      migrated from superuser.com Mar 28 at 1:44


      This question came from our site for computer enthusiasts and power users.









      marked as duplicate by Kirill Polishchuk xml
      Users with the  xml badge can single-handedly close xml questions as duplicates and reopen them as needed.

      StackExchange.ready(function()
      if (StackExchange.options.isMobile) return;

      $('.dupe-hammer-message-hover:not(.hover-bound)').each(function()
      var $hover = $(this).addClass('hover-bound'),
      $msg = $hover.siblings('.dupe-hammer-message');

      $hover.hover(
      function()
      $hover.showInfoMessage('',
      messageElement: $msg.clone().show(),
      transient: false,
      position: my: 'bottom left', at: 'top center', offsetTop: -7 ,
      dismissable: false,
      relativeToBody: true
      );
      ,
      function()
      StackExchange.helpers.removeMessages();

      );
      );
      );
      Mar 28 at 2:23


      This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.





      migrated from superuser.com Mar 28 at 1:44


      This question came from our site for computer enthusiasts and power users.
























          1 Answer
          1






          active

          oldest

          votes


















          1















          This XPath will select all object5 elements with id attributes values of "907":



          //object5[@id="907"]


          This XPath will select all elements with id attributes values of "907":



          //*[@id="907"]





          share|improve this answer

























          • And //*[contains(local-name(), 'object') and @id='907'] should select all elements containing object and @id='907' in case that id number is used somewhere else in the code.

            – Jack Fleeting
            Mar 28 at 12:14







          • 1





            @JackFleeting: Thanks, note, though that testing local-name() alone bypasses namespaces and using contains() means that elements such as not_this_object with such an id value will also be selected. But, yes, that's one way to ignore the numeric suffix tacked onto the object element names.

            – kjhughes
            Mar 28 at 12:24














          1 Answer
          1






          active

          oldest

          votes








          1 Answer
          1






          active

          oldest

          votes









          active

          oldest

          votes






          active

          oldest

          votes









          1















          This XPath will select all object5 elements with id attributes values of "907":



          //object5[@id="907"]


          This XPath will select all elements with id attributes values of "907":



          //*[@id="907"]





          share|improve this answer

























          • And //*[contains(local-name(), 'object') and @id='907'] should select all elements containing object and @id='907' in case that id number is used somewhere else in the code.

            – Jack Fleeting
            Mar 28 at 12:14







          • 1





            @JackFleeting: Thanks, note, though that testing local-name() alone bypasses namespaces and using contains() means that elements such as not_this_object with such an id value will also be selected. But, yes, that's one way to ignore the numeric suffix tacked onto the object element names.

            – kjhughes
            Mar 28 at 12:24















          1















          This XPath will select all object5 elements with id attributes values of "907":



          //object5[@id="907"]


          This XPath will select all elements with id attributes values of "907":



          //*[@id="907"]





          share|improve this answer

























          • And //*[contains(local-name(), 'object') and @id='907'] should select all elements containing object and @id='907' in case that id number is used somewhere else in the code.

            – Jack Fleeting
            Mar 28 at 12:14







          • 1





            @JackFleeting: Thanks, note, though that testing local-name() alone bypasses namespaces and using contains() means that elements such as not_this_object with such an id value will also be selected. But, yes, that's one way to ignore the numeric suffix tacked onto the object element names.

            – kjhughes
            Mar 28 at 12:24













          1














          1










          1









          This XPath will select all object5 elements with id attributes values of "907":



          //object5[@id="907"]


          This XPath will select all elements with id attributes values of "907":



          //*[@id="907"]





          share|improve this answer













          This XPath will select all object5 elements with id attributes values of "907":



          //object5[@id="907"]


          This XPath will select all elements with id attributes values of "907":



          //*[@id="907"]






          share|improve this answer












          share|improve this answer



          share|improve this answer










          answered Mar 28 at 1:51









          kjhugheskjhughes

          71.3k14 gold badges103 silver badges147 bronze badges




          71.3k14 gold badges103 silver badges147 bronze badges















          • And //*[contains(local-name(), 'object') and @id='907'] should select all elements containing object and @id='907' in case that id number is used somewhere else in the code.

            – Jack Fleeting
            Mar 28 at 12:14







          • 1





            @JackFleeting: Thanks, note, though that testing local-name() alone bypasses namespaces and using contains() means that elements such as not_this_object with such an id value will also be selected. But, yes, that's one way to ignore the numeric suffix tacked onto the object element names.

            – kjhughes
            Mar 28 at 12:24

















          • And //*[contains(local-name(), 'object') and @id='907'] should select all elements containing object and @id='907' in case that id number is used somewhere else in the code.

            – Jack Fleeting
            Mar 28 at 12:14







          • 1





            @JackFleeting: Thanks, note, though that testing local-name() alone bypasses namespaces and using contains() means that elements such as not_this_object with such an id value will also be selected. But, yes, that's one way to ignore the numeric suffix tacked onto the object element names.

            – kjhughes
            Mar 28 at 12:24
















          And //*[contains(local-name(), 'object') and @id='907'] should select all elements containing object and @id='907' in case that id number is used somewhere else in the code.

          – Jack Fleeting
          Mar 28 at 12:14






          And //*[contains(local-name(), 'object') and @id='907'] should select all elements containing object and @id='907' in case that id number is used somewhere else in the code.

          – Jack Fleeting
          Mar 28 at 12:14





          1




          1





          @JackFleeting: Thanks, note, though that testing local-name() alone bypasses namespaces and using contains() means that elements such as not_this_object with such an id value will also be selected. But, yes, that's one way to ignore the numeric suffix tacked onto the object element names.

          – kjhughes
          Mar 28 at 12:24





          @JackFleeting: Thanks, note, though that testing local-name() alone bypasses namespaces and using contains() means that elements such as not_this_object with such an id value will also be selected. But, yes, that's one way to ignore the numeric suffix tacked onto the object element names.

          – kjhughes
          Mar 28 at 12:24








          Got a question that you can’t ask on public Stack Overflow? Learn more about sharing private information with Stack Overflow for Teams.







          Got a question that you can’t ask on public Stack Overflow? Learn more about sharing private information with Stack Overflow for Teams.





          Popular posts from this blog

          How to preserve electronics (computers, tablets and phones) for hundreds of years Announcing the arrival of Valued Associate #679: Cesar Manara Planned maintenance scheduled April 23, 2019 at 23:30 UTC (7:30pm US/Eastern) The network's official Twitter account is up and running again. What content…How might modern humans leave a message for 50,000 years?How would an aquatic race develop computers?How do we make computers care for human life?Keeping supplies for 1000 yearsWhat will cell phones become in 100 years?What body armor protects against a laser?Could a society attain 1800s technology if limited to using copper and bronze?Electricity power (magic) and electronicsScavenging metal resources in post-apocalypse after 100 yearsWhy would precursors create devices that can survive and still work after hundreds of years?

          155 수학 과학 기타 둘러보기 메뉴eh추가해eh문서를 완성해

          Convert JSON to MapSimplest way to convert a string representing JSON array into Java array List of key value pairsHow to take String JSON values into HashMapConvert a JSON String to a HashMapCreating BSON object from JSON stringJSONObject - How to get a value ?Better Map ConstructorReading JSON from Url javaUpdate columns if input values are not null otherwise ignore and keep the existing values of column in databaseHow to store object represented as Json string into Couchbase Lite?Go JSON into MapHow do I efficiently iterate over each entry in a Java Map?Sort a Map<Key, Value> by valuesHow to round a number to n decimal places in JavaCan comments be used in JSON?How do I read / convert an InputStream into a String in Java?How can I pretty-print JSON in a shell script?What is the correct JSON content type?How can I deserialize JSON to a simple Dictionary<string,string> in ASP.NET?Why does Google prepend while(1); to their JSON responses?Parse JSON in JavaScript?