I need to include a full XML document inside a text field in other XML document
For example
<mytexttag>
<![CDATA[
here the xml document starting with <?xml version="1.0"
]]>
</mytexttag>
I must use a fixed XSD and I can not adapt it.
I have read that CDATA is still part of the document and it means that the data in between these strings includes data that could be interpreted as XML markup, but should not be.
But i don't know if I can bypass the restrictions. Currently, if I include a complete XML, I have parsing errors
This could be a real example
<?xml version="1.0" encoding="UTF-8"?>
<mytexttag>
<![CDATA[ <n1:ClientInvoiceExtension xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:n1="http://www.myclient.es/facturae/ClientInvoiceExtension/v1.0" xsi:schemaLocation="http://www.myclient.es/facturae/ClientInvoiceExtension/v1.0/ClientInvoiceExtension_v1_0.xsd"><Version>1.0</Version><LineExtension><InvoiceFamily>ejempló con carañññ</InvoiceFamily><ContractCode>el code</ContractCode><PurchaseRequestCode>String</PurchaseRequestCode><DerivationCode>String</DerivationCode>ContractFileCode>String</ContractFileCode><Patient><IPF>PASAPORTE</IPF><PatientId>String</PatientId><FullName>String</FullName></Patient><Process><Contingency>String</Contingency><Year>0</Year><Province>String</Province><Number>String</Number></Process><MazCenterId>String</MazCenterId><MazCenterProvince>String</MazCenterProvince><Diagnostic>String</Diagnostic><Medical>String</Medical><RecipeNumber>String</RecipeNumber><MazEmployeeFullName>String</MazEmployeeFullName> <HealthcareDeliveryCode>String</HealthcareDeliveryCode> </LineExtension></n1:MazInvoiceExtension>]]>
</mytexttag>
When a insert special characters like 'á ó ñ' my xml editor says it is invalid xml
I can consider encode in base64, but I have a size restriction in that field and would rather not increase the size