-
-
Notifications
You must be signed in to change notification settings - Fork 79
-
I'm working with a funky XML RPC API that will sometimes return embedded XML documents inside other elements, without applying any special encoding. These embedded documents often contain xml comments and processing instructions.
For example, this XML document that embeds a full XML schema inside the <TypeInfo> element:
<?xml version="1.0" encoding="UTF-8"?> <Types> <TypeName>MyType</TypeName> <TypeInfo> <xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema"> <!-- some full XML schema document here --> </xs:schema> </TypeInfo> </Types>
For my use cases, I typically want to access/store these embedded documents as text, rather than fully parsed XML nodes, eg:
my_model.type_name > 'MyType' print(my_model.type_info) > '<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema">\n\t<!-- some full XML schema document here -->\n</xs:schema>'
Is this possible with xsdata? If so what would an example model look like?
Beta Was this translation helpful? Give feedback.
All reactions
Replies: 1 comment
-
Here we have a similar issue, but embedded documents are signed xml documents, in this case it is important to treat them differently to prevent serialization/deserialization from somehow invalidating the signature of the document.
I'm also interested in whether it's possible to handle this in some way directly in xsdata.
Beta Was this translation helpful? Give feedback.