Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Disable CDATA in all fields #752

Open
DevGrohl opened this issue Apr 26, 2017 · 4 comments
Open

Disable CDATA in all fields #752

DevGrohl opened this issue Apr 26, 2017 · 4 comments

Comments

@DevGrohl
Copy link

I have been looking for days a way to disable CDATA in all the class and child classes in a non-repetitive way (XMLElement).

Now, I tried using XmlDiscriminator:
* @XmlDiscriminator(attribute=false, cdata=false)

But didn't work:

<header>
<signature><![CDATA[BHNUMS]]></signature>
<details>
<productCategoryCode><![CDATA[01]]></productCategoryCode>
<specVersion><![CDATA[43]]></specVersion>
</details>
</header>

I think XmlDiscriminator expects me to use the Discriminator at the same time, but I don't really need it, anyone can guide me in a way to get my XML without CDATA ?

@goetas
Copy link
Collaborator

goetas commented Apr 26, 2017

Currently this feature do not exists yet. PR are welcome :)

@mvrhov
Copy link

mvrhov commented Apr 26, 2017

I added the CDATA support. At the time it was deemed to be to expensive to test each string if can be serialized without putting it in CDATA

@steve-rhodes
Copy link

Any update on this? ;-) Right now I have to remove all CDATA with a preg_replace.

@ArthurJam
Copy link

I think it s better to introduce an escaping strategy to let people choose if by default the CDTA is enable or disable.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

5 participants