[prev in list] [next in list] [prev in thread] [next in thread] 

List:       xmlbeans-dev
Subject:    [jira] [Updated] (XMLBEANS-501) Can't use encoded HTML entities
From:       "Shane StClair (JIRA)" <xmlbeans-dev () xml ! apache ! org>
Date:       2013-06-12 20:26:21
Message-ID: JIRA.12652483.1371068188169.106064.1371068781082 () arcas
[Download RAW message or body]


     [ https://issues.apache.org/jira/browse/XMLBEANS-501?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel \
]

Shane StClair updated XMLBEANS-501:
-----------------------------------

          Description: 
Due to hardcoding in TextSaver, currently it's impossible to set HTML encoded values \
(e.g. &euro;, &trade;, etc) using xmlbeans. This is because ampersands are detected \
and replaced with &amp; in various methods in TextSaver (entitizeContent, \
entitizeAttrValue, emitAttrValue, and entitizeAndWriteText).

I believe the intent is to replace naked ampersands with the encoded entity (&amp;), \
however currently entities that are already encoded are not detected, so you end up \
with things like &amp;euro;, &amp;#10;, etc.

Seems like there are a few options:

1. Confine all character replacement to XmlOptionCharEscapeMap and provide a method \
to initialize without defaults or remove defaults (i.e. remove & -> &amp; \
replacement) 2. Provide an XmlOptions setting to disable ampersand replacement and \
let the user be responsible for preventing invalid content 3. In TextSaver, examine \
characters following the ampersand to see if the ampersand begins an encoded entity.  \
Affects Version/s: Version 2.6  Summary: Can't use encoded HTML entities  (was: Can)
    
> Can't use encoded HTML entities
> -------------------------------
> 
> Key: XMLBEANS-501
> URL: https://issues.apache.org/jira/browse/XMLBEANS-501
> Project: XMLBeans
> Issue Type: Improvement
> Affects Versions: Version 2.6
> Reporter: Shane StClair
> Priority: Minor
> 
> Due to hardcoding in TextSaver, currently it's impossible to set HTML encoded \
> values (e.g. &euro;, &trade;, etc) using xmlbeans. This is because ampersands are \
> detected and replaced with &amp; in various methods in TextSaver (entitizeContent, \
> entitizeAttrValue, emitAttrValue, and entitizeAndWriteText). I believe the intent \
> is to replace naked ampersands with the encoded entity (&amp;), however currently \
> entities that are already encoded are not detected, so you end up with things like \
> &amp;euro;, &amp;#10;, etc. Seems like there are a few options:
> 1. Confine all character replacement to XmlOptionCharEscapeMap and provide a method \
> to initialize without defaults or remove defaults (i.e. remove & -> &amp; \
> replacement) 2. Provide an XmlOptions setting to disable ampersand replacement and \
> let the user be responsible for preventing invalid content 3. In TextSaver, examine \
> characters following the ampersand to see if the ampersand begins an encoded \
> entity.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@xmlbeans.apache.org
For additional commands, e-mail: dev-help@xmlbeans.apache.org


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic