You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@xmlbeans.apache.org by "Niklas Mehner (JIRA)" <xm...@xml.apache.org> on 2006/11/27 13:51:23 UTC
[jira] Commented: (XMLBEANS-298) Saver.entitizeAttrValue() doesn't
honor SAVE_SUBSTITUTE_CHARACTERS setting
[ http://issues.apache.org/jira/browse/XMLBEANS-298?page=comments#action_12453577 ]
Niklas Mehner commented on XMLBEANS-298:
----------------------------------------
The methods are actually not in Saver but in TextSaver.
> Saver.entitizeAttrValue() doesn't honor SAVE_SUBSTITUTE_CHARACTERS setting
> --------------------------------------------------------------------------
>
> Key: XMLBEANS-298
> URL: http://issues.apache.org/jira/browse/XMLBEANS-298
> Project: XMLBeans
> Issue Type: Bug
> Affects Versions: Version 2.2
> Reporter: Niklas Mehner
>
> I'm formatting a XML Document using the following XMLOptions:
> XmlOptions options = new XmlOptions();
> options.setSavePrettyPrint();
> XmlOptionCharEscapeMap escapes = new XmlOptionCharEscapeMap();
> escapes.addMapping('<', XmlOptionCharEscapeMap.PREDEF_ENTITY);
> escapes.addMapping('>', XmlOptionCharEscapeMap.PREDEF_ENTITY);
> escapes.addMapping('&', XmlOptionCharEscapeMap.PREDEF_ENTITY);
> escapes.addMapping('\'', XmlOptionCharEscapeMap.PREDEF_ENTITY);
> escapes.addMapping('"', XmlOptionCharEscapeMap.PREDEF_ENTITY);
> options.setSaveSubstituteCharacters(escapes);
> This works when using content containing the escaped chars, but attribut values are not escaped:
> <inventory>
> <customer name1=">"/>
> </inventory>
> This should be:
> <inventory>
> <customer name1=">"/>
> </inventory>
> The reason for this is, that Saver.entitizeAttrValue() does not contain:
> [....]
> else if (isEscapedChar( ch ))
> i = replace( i, _replaceChar.getEscapedString( ch ) );
> [....]
> This is only done in Saver.entitizeContent().
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://issues.apache.org/jira/secure/Administrators.jspa
-
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