xml - extract value of attribute regardless of attribute's namespace -


How can I remove the value of an attribute regardless of the namespace of the attribute (and if the attribute is not in a namespace )?

What is XPath to remove the position value attribute from all below the example documents:

  & lt; A status = 'foo' & gt; & Lt; / A & gt; & Lt; A xmlns: x = "foo-x" x: position = 'foo' & gt; & Lt; / A & gt; & Lt; X: a xmlns: x = "foo-x" position = 'foo' & gt; & Lt; / X: a & gt; & Lt; A xmlns = "foo-y" position = 'foo' & gt; & Lt; / A & gt;  

Except / * / @ status brings the value 'foo' from the other value, except for those above all except the above Namespace remains in (default namespace properties are not applicable to attributes, so I think the value is successfully brought in the fourth case). What is an XPath I can use for all cases?

/ * / @ [Trying to local-name () = 'status'] with it fails:

  Net.sf.saxon.trans.XPathException: @ should be followed by a nodest  

@ icon, the attribute name is expected that you can use * for any:

  / * / @ * [Local-name () = 'status']  

Comments

Popular posts from this blog

apache - 504 Gateway Time-out The server didn't respond in time. How to fix it? -

c# - .net WebSocket: CloseOutputAsync vs CloseAsync -

c++ - How to properly scale qgroupbox title with stylesheet for high resolution display? -