Tags: mmcdole/goxpp
Tags
Add test for absolute path as xml:base I wanted to prove to myself that the current xml:base implementation handles absolute paths with no domain part (as in "xml:base=/absolute") by replacing the current base path (as illustrate in the spec example: https://www.w3.org/TR/xmlbase/) All tests pass.
Keep track of the current xml:base value Tracks xml:base attributes in a stack of *url.URLs. Consumers of the parser can access the top-level URL through `XMLPullParser.BaseStack.Top()` This is useful for applications that need to resolve URLs in XML documents relative to the xml:base attributes. To that end, a helper method is provided which will resolve a relative string to an absolute URL according to the current base: `func (p *XMLPullParser) XmlBaseResolveUrl(u string) (*url.URL, error)` Includes a single test. It is not comprehensive, but it checks for xml:base to two levels, tests resolving a string against the current base, as well as resolution of relative xml:base values.