You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm trying to find attribute values within a XML document but the returned data seems erroneous.
Description
When I query an XML to get a specific node attribute with namespace (for instance //@xlink:href), the returned xmlquery.Node is missing the prefix and namespace URI.
Well, why not but if I'm doing so, I must first parse the xpath "//node[@xlink:href]" to extract the namespace (xlink) and prefix (href), and then loop over all the attributes to find the ones that match. It's not really efficient.
Anyway, thanks for your help @zhengchun: much appreciated.
Hi,
I'm trying to find attribute values within a XML document but the returned data seems erroneous.
Description
When I query an XML to get a specific node attribute with namespace (for instance
//@xlink:href
), the returnedxmlquery.Node
is missing the prefix and namespace URI.Steps to reproduce
Expected result
Actual result
Solution proposal
In
github.com/antchfx/xmlquery/query.go#getCurrentNode
:Additional information
If it appears that I just misused the library, what is the correct way to do please ?
My main use case is as follows:
@xlink:href
attributes in the document;The text was updated successfully, but these errors were encountered: