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
In my testing I've noticed that an XPath expression can return an namespace declaration node ("foo/namespace::bar", for example).
The generic XmlNode.Content() will return the URL - unfortunately there doesn't seem to be a way to access the prefix. The obvious hack of getting the parent node and searching for the declaration fails because namespace declarations are on their own axis and don't actually have parents.
I don't know what the right solution here is, but we'll possibly want a new type that derives from Xml.Node but is aware it wraps an C.xmlNsPtr
Thoughts?
The text was updated successfully, but these errors were encountered:
This is pretty much an edge case - most people don't construct XPath expressions to select namespace nodes - but needed for correctness when implementing XSLT or XQuery on top of gokogiri.
For example, the XSLT 1.0 spec requires xsl:copy to handle namespace nodes returned from an XPath by outputting the namespace declaration (with the same prefix and URI) to the destination. I've never seen this done outside a contrived example, but you never know.
In my testing I've noticed that an XPath expression can return an namespace declaration node ("foo/namespace::bar", for example).
The generic XmlNode.Content() will return the URL - unfortunately there doesn't seem to be a way to access the prefix. The obvious hack of getting the parent node and searching for the declaration fails because namespace declarations are on their own axis and don't actually have parents.
I don't know what the right solution here is, but we'll possibly want a new type that derives from Xml.Node but is aware it wraps an C.xmlNsPtr
Thoughts?
The text was updated successfully, but these errors were encountered: