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;
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?
xml xpath
marked as duplicate by Kirill Polishchuk
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.
add a comment |
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?
xml xpath
marked as duplicate by Kirill Polishchuk
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.
add a comment |
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?
xml xpath
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
xml xpath
asked Mar 28 at 1:42
stoneyowlstoneyowl
114 bronze badges
114 bronze badges
marked as duplicate by Kirill Polishchuk
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
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
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.
add a comment |
add a comment |
1 Answer
1
active
oldest
votes
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"]
And//*[contains(local-name(), 'object') and @id='907']should select all elements containingobjectand@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 testinglocal-name()alone bypasses namespaces and usingcontains()means that elements such asnot_this_objectwith such anidvalue will also be selected. But, yes, that's one way to ignore the numeric suffix tacked onto theobjectelement names.
– kjhughes
Mar 28 at 12:24
add a comment |
1 Answer
1
active
oldest
votes
1 Answer
1
active
oldest
votes
active
oldest
votes
active
oldest
votes
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"]
And//*[contains(local-name(), 'object') and @id='907']should select all elements containingobjectand@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 testinglocal-name()alone bypasses namespaces and usingcontains()means that elements such asnot_this_objectwith such anidvalue will also be selected. But, yes, that's one way to ignore the numeric suffix tacked onto theobjectelement names.
– kjhughes
Mar 28 at 12:24
add a comment |
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"]
And//*[contains(local-name(), 'object') and @id='907']should select all elements containingobjectand@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 testinglocal-name()alone bypasses namespaces and usingcontains()means that elements such asnot_this_objectwith such anidvalue will also be selected. But, yes, that's one way to ignore the numeric suffix tacked onto theobjectelement names.
– kjhughes
Mar 28 at 12:24
add a comment |
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"]
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"]
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 containingobjectand@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 testinglocal-name()alone bypasses namespaces and usingcontains()means that elements such asnot_this_objectwith such anidvalue will also be selected. But, yes, that's one way to ignore the numeric suffix tacked onto theobjectelement names.
– kjhughes
Mar 28 at 12:24
add a comment |
And//*[contains(local-name(), 'object') and @id='907']should select all elements containingobjectand@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 testinglocal-name()alone bypasses namespaces and usingcontains()means that elements such asnot_this_objectwith such anidvalue will also be selected. But, yes, that's one way to ignore the numeric suffix tacked onto theobjectelement 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
add a comment |
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.