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
This will throw an error DOMException: Namespace Error in XmlSerializationVisitor.php on line 203. The addNamespaceAttributes internally always prefixes xmlns to the prefix, so you end up with something like: xmlns:xsi:location. The setAttributeNS call is not accepting that as a qualified attribute name.
Is there a way to work around this?
The text was updated successfully, but these errors were encountered:
The idea is that I add an extra property to my root class and add an XmlAttributeMap property which defines the xsi:location namespace instead of using xml_namespaces:
Okay. I tried the above in my own project: this works for me. Gave it some more thought: xsi:location is a property within the xsi namespace. So it's not a namespace in it's own right: It's an attribute. The only confusing thing is that it's an attribute to the same element which defines the xsi namespace.
So, putting it in xml_attribute_map instead of xml_namespaces is perfectly sound.
While serializing a set of PHP objects into XML: I'm failing to set the
xsi:schemalocation
attribute on the root element.I'm using YML annotations for the root level element.
I've tried configuring it like this:
This will throw an error
DOMException: Namespace Error
inXmlSerializationVisitor.php
on line 203. TheaddNamespaceAttributes
internally always prefixesxmlns
to the prefix, so you end up with something like:xmlns:xsi:location
. ThesetAttributeNS
call is not accepting that as a qualified attribute name.Is there a way to work around this?
The text was updated successfully, but these errors were encountered: