Daffodil supports this with the "stringAsXml" runtime property. Here is the page
describing the feature:
https://cwiki.apache.org/confluence/display/DAFFODIL/Proposal%3A+Embedded+XML+Strings
We also have some small tests/examples of schemas that are a useful reference:
https://github.com/apache/daffodil/tree/main/daffodil-test/src/test/resources/org/apache/daffodil/infoset/stringAsXml
- Steve
On 2026-02-12 04:14 PM, Busuttil (US), Brandon J via users wrote:
Greetings!
I’m looking for any assistance in developing a DFDL schema which handles a
particular use case. The schema needs to process a data block which is primarily
fixed format binary data, but also has embedded XML content of a known fixed
length within it.
We are looking to develop a DFDL schema which is capable of parsing and un-
parsing a mixed format data block so that the embedded XML content is output as
straight XML when parsing, and then serialized back to character data when being
un-parsed.
In the example below, we want to convert “TEXT” into an integer value, “DATA”
into an integer value, and then simply leave “<element1><element2>3</element2></
element1>” as XML. Note that the XML content is _a known fixed length_ string.
For example:
_Given the following input data…_
TEXTDATA<element1><element2>3</element2></element1>
_Create a DFDL schema that outputs the following XML…_
<?xml version=”1.0” encoding=”UTF-8”?>
<ns1:INTEGER1>1413830740</ns1:INTEGER1>
<ns1:INTEGER2>1145132097</ns1:INTEGER2>
<element1>
<element2>3</element2>
</element1>
_What we currently can do…_
At the moment we can parse the entire embedded XML content into a string, but
the problem is that DFDL is outputting the XML as escaped XML, and we want it to
output un-escaped XML. For example we want it to output
This:
<element1><element2>3</element2></element1>
Instead of this:
<element1><element2>3</element2></element1>
Thanks,
Brandon Busuttil
The Boeing Company | BDS | Autonomous Systems
Software Engineer, Maritime Undersea
/**//This transmission is intended only for the use of the individual(s), firm,
or company to whom it is addressed and may contain information that is
privileged and/or confidential. If the reader of this message is not the
intended recipient, you are hereby notified that any disclosure, distribution,
dissemination, downloading, or copying of the information is strictly
prohibited. If you have received this transmission in error, please contact me
for directions./