CDATA support
See original GitHub issueDear developers,
I have to use mixed CDATA contents. It means that the node can have CDATA or text or both mixed. I am not able to change the XSD Schema for a new simply type. For a fast solution I added a regex detection for the use of cdata in the jsonix.js, but I don’t think that this is a good solution. Is there a way to keep CDATA from XML file?
My fast solution:
if (this.asCDATA && value.match(/<.+>/g) != null)
Best regards, Justin
Issue Analytics
- State:
- Created 5 years ago
- Comments:7 (2 by maintainers)
Top Results From Across the Web
Technical Support - CData Software
We provide premium technical support via email and phone. All Premium emails and calls are given priority over any standard support questions. Responses...
Read more >Technical Support - CData Arc
We provide standard technical support via email. We do our best to answer the ...
Read more >Contact Us - CData Software
Global Sales and Support. Billing & Pending Order Inquiries. Mon-Fri, 9am- 6pm EST (800) 235-7250 (within US) (919) 928-5214 (outside US) sales@cdata.com ...
Read more >Contact Us - CData Software
Please use the form below to send us your questions, comments, and suggestions. For technical support please submit a specific Online Support Request....
Read more >Online Help Files - CData Software
Online Help Files. Each online help file offers extensive overviews, samples, walk-throughs, and API documentation. Drivers & Data Connectors ...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
I’m on FOSSGIS2019 so I can’t reply promptly.
Technically this
is exactly the same as this
I understand that these are different cosmetics but technically it is not really relevant.
However I can follow that you might be interested in actual cosmetics to make XML more readable. The problem is, however the presentation in the JS side. Somehow you will need to distinguish between normal text and CDATA-text. So improving cosmetics on the XML side might lead to much more complex models on the JS side. Which, in my PoV is a too high price.
But here’s an idea. Maybe we could implement some automatic that Jsonix automatically produces CDATA sections if the text contains too much markup/special characters? Like if there are more that N
<
s,>
s,'
es and&
s then automatically create a CDATA-section.What do you think?
I just had an idea. Maybe you like: https://github.com/highsource/jsonix/pull/215
This would allow the user to do a conditional CDATA by regex.
if ((this.asCDATA && this.CDATAcondition == null) || (this.asCDATA && value.match(new RegExp(this.CDATAcondition)) ))