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 think that it would be good to clarify in the docs how HappyMapper deals with this in the context of qualified vs unqualified namespaces in XML Schema (if XML Schema conformance is the goal, which seems so). Both of these require mappings that are not obvious, particularly if you want to parse instance docs in a prefix independent manner. See this gist for an example. (Note that these were generated by the jaxb2ruby HappyMapper template).
There, as in @burtlo's example above, :namespace must be set to nil to parse an unqualified instance doc else parsing will fail as the XPath lookup will include the parent's namespace prefix. Not sure if this is a feature or bug 😕.
The following happymapper model defines a default namespace for the top level element and removes the namespace in the child elements.
This model will parse XML that looks like the following:
However, this model will not persist the xml correctly when
#to_xml
is used. It instead generates xml of the following format:When persisting the default namespace is being applied.
The text was updated successfully, but these errors were encountered: