Reputation: 221
Maybe someone can help, is it a way to combine an xPath expression to query node by it's property value?
I have a node with custom property "ItemId". I need something like this:
uQuery.GetNodesByXPath("//* [@itemId = '<someId>']")
Thanx in advance!
Upvotes: 0
Views: 2465
Reputation: 3219
"//*
" Will give you all nodes, so "//*[@itemId = '<someId>']
" is asking to give you all nodes with an attribute equal to exactly "<someId>
", which you can't have as a valid attribute.
So, if you have <myNode someId='my Id value'></myNode>
, then try //*[@itemId='someId']
But remember, this will give you ANY node with that particular attribute ID.
I'm not sure if this is what you're looking for, but please post your XML or a snippet of what you're grabbing, as that will clear up any grey areas.
Upvotes: 1