-
-
Notifications
You must be signed in to change notification settings - Fork 100
Open
Description
When trying to serialize a document into XML and using a Generated\DocumentType it will result in having a <result>{structure}</result> form.
Is there a way to specify how I want the root to be?
For external schemas, it is not always possible to adjust the schema and add something like <xs:element name="concrete" type="DocumentType"/>. Those types are meant to be serialized and wrapped into an anyType container like:
<data xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<SerializedDocumentTypeWithoutRootElement>...</SerializedDocumentTypeWithoutRootElement>
</data>
My goal is avoiding manual string replacing and manipulating output after serializing into XML.
I tried to play with SerializerInterface->serialize and look into SerializationContext, but without any examples it's hard to understand if it's what I need.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels