xpath select referenced xml node -


I have to select a node whose "name" attribute is equal to the "reference" attribute of the current node.

  & lt; Node name = "foo" /> & Lt; Node name = "bar" reference = "afu" />  

I could not find any way to express it in XPATH. any idea. Ive tried the following:

  ./node [@ name = @references] ./node=@name={@references}]  

Obviously not working up. I think the real problem is in brackets; What type of node do I represent? Unfortunately, what you are trying to do is not possible with pure XPath whenever you have a If you start the new ingenious (bracket-worn part), then the context turns into a node that starts intriguing. This means that you can compare one in a variable directly with two different elements without any special behavior.

What language are you using? You have to store the value of the "Name" attribute in a variable from the first node.

For example, XSLT:

  & lt; Xsl: variable name = "name" = "/ node [1] / @ name" /> & Lt; Xsl: Select value = "/ node [[reference = $ name]" />  

In XQuery,

  let $ name: = / node [1] / @ name return / node [@references = $ name]  

Comments

Popular posts from this blog

MySql variables and php -

url rewriting - How to implement the returnurl like SO in PHP? -

Which Python client library should I use for CouchdB? -