You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Is it possible to set up a schema so that a string will be marshalled as <![CDATA[...]]> in the resulting XML?
If not, is this something planned or open to contribution?
Not at the moment. Technically there is no difference between a string and CDATA wrapping.
Open for contribution, sure. I think this can be solved with a custom simple type.
Actually the tricky part is to avoid encoding of special characters, which mean using document.createCDATASection instead of document.createTextNode in Output.js.
I'll try to make a PR for this as it would be much cleaner than hacking it with a custom type or a string replace.
I've made a few minor changes. Mainly to check that if the text contains ]]> it must be split in two CDATA sections as CDATA section can't contain ]]>.
Also used cdata as laconic form for asCDATA.
Apart from that everything was fine. Thank you for your contribution!
Please check if the latest changes are fine for you.
Activity
highsource commentedon Jun 1, 2017
Not at the moment. Technically there is no difference between a string and CDATA wrapping.
Open for contribution, sure. I think this can be solved with a custom simple type.
jahow commentedon Jun 2, 2017
Actually the tricky part is to avoid encoding of special characters, which mean using
document.createCDATASectioninstead ofdocument.createTextNodein Output.js.I'll try to make a PR for this as it would be much cleaner than hacking it with a custom type or a string replace.
Thanks!
Issue #173.
highsource commentedon Jun 21, 2017
I've made a few minor changes. Mainly to check that if the text contains
]]>it must be split in two CDATA sections as CDATA section can't contain]]>.Also used
cdataas laconic form forasCDATA.Apart from that everything was fine. Thank you for your contribution!
Please check if the latest changes are fine for you.
highsource commentedon Jun 21, 2017
https://github.com/highsource/jsonix/wiki/Properties#value-property
jahow commentedon Jun 22, 2017
Perfect! Glad I could help improve the library. Thanks for documenting the feature.