Open ronaldtse opened 3 months ago
The workaround is actually this:
class SomeClass < Shale::Mapper
attribute :schema_location, Shale::Type::String
xml do
root "Dictionary"
map_attribute "schemaLocation", to: :schema_location, prefix: "xsi", namespace: "http://www.w3.org/2001/XMLSchema-instance"
end
In XML files there are many occasions that alongside an XML namespace declaration, a
schemaLocation
is also provided.e.g.
Notice that in the original
<gml:Dictionary>
it containsschemaLocation
. However, in Shale I have to manually encode schemaLocation as a dataattribute
, which is quite crazy.