How do I work with mixed content?
For mixed content, Sequence has a specific API for adding text: addText(...).
All other APIs work equally with text as they do with Properties. The getProperty(int) API will return null for mixed content text data. The following example of mixed content code can be used to print all the mixed content text from a DataObject:
DataObject mixedContent = ...
Sequence seq = mixedContent.getSequence();
for (int i=0; i < seq.size(); i++)
{
Property prop = seq.getProperty(i);
Object value = seq.getValue(i);
if (prop == null)
{
System.out.println("Found mixed content text: "+value);
}
else
{
System.out.println("Found Property "+prop.getName()+": "+value);
}
}
This topic only applies to BAW, and is located in the BAW repository. Last updated on 2025-03-13 12:15