Control XML version in output

I’m trying to get Lucee to output an XML version=‘1.1’ document. All output is version 1.0.

Is there no way to do this?

To date - unable to affect serialization any other way than to do it by hand. Would have thought there would be more control but I cannot find it.

which functions and tags are affected?

If I’m understanding your question, no tags or functions are broken. I’m simply unable to get an XML version 1.1 output. It seems that most serialization is done ‘by magic’ and when I take a parsed XML document object (say xmlDoc) and writeoutput(xmlDoc) it works well but is ALWAYS version 1.0.

XML version 1.1 apparently allows broader character entities and I’m hoping XML version 1.1 output will prevent my XML feeds from breaking when there are some more recent emojis in it.

Does that make sense?

yep, makes sense. wanna file a bug? https://luceeserver.atlassian.net/projects/LDEV/summary

you could even link it to @markdrew’s emoji bug!
https://luceeserver.atlassian.net/browse/LDEV-1199

Heh - great bug. I’ll try and tie this to it. But it is actually a bit different (not really interested in emojis in code . . . yet).

Thanks you looking!!
B.

https://luceeserver.atlassian.net/browse/LDEV-1701

could you provide a test sample?

Well - here’s one shot at changing the version . . .

<cfscript>
    strXML &= "<ROOT><CREATE_DATE>2018-03-02T14:46:05</CREATE_DATE><ITEM>
    Text and stuff and 📈 and other stuff</ITEM></ROOT>";
    xDoc = XMLParse(strXML);
    xDoc.setXmlVersion(1.1);
    getpagecontext().getresponse().setContentType(JavaCast("string","text/xml"));
    writeoutput(xDoc);
</cfscript>

You could even skip out putting the XML and just

writeoutput (xDoc.getXmlVersion()) 

and you’ll see the object thinks its vesion 1.1. But the declaration is still vesion 1.0.

At the moment I’m just looking at putting everything in CDATA (which is probably what I should do anyway) but , unfortunately, I’m not sure there wont be downstream consequences.

It seems that the :chart_with_upwards_trend: character does fine in XML as far as I can see. But all the ways that I’ve found to serialize the XML document (other than doing it by hand) generates a numeric character reference

&#55357;&#56520;

which is apparently an invalid xmlchar in version 1.0. Further paging around would indicate that pushing to version 1.1 to solve this would not be recommended. So perhaps this is a request for increased access to the serialization process to manage this sort of issue.