[ http://issues.apache.org/jira/browse/XMLBEANS-192?page=all ]
     
Lawrence Jones resolved XMLBEANS-192:
-------------------------------------

    Fix Version: Version 2.1
                     (was: Version 2)
     Resolution: Won't Fix

Hi Stephen

The escaping of '<' as '&lt;' and '&' as '&amp;' are required by the XML spec. 
The escaping of '>' is not required (except if you want to include the string 
"]]>" but do _not_ want it interpreted as the end of a CDATA section). See the 
XML Spec section 2.4 (http://www.w3.org/TR/REC-xml/#syntax).

By default we only escape those characters that absolutely need to be escaped.

On the other hand there is some code which was put in to allow the user to 
choose to escape certain characters in certain ways (as hex and octal and, for 
a limited set of characters, as predefined entities). See 
http://issues.apache.org/jira/browse/XMLBEANS-177.

For you - you want to insist that all '>' chars (that are not markup) are 
escaped as '&gt;' i.e. as the predefined entity for the '>' character. The way 
to do this is to set up your Saver with an XmlOptions object on which you have 
called setSaveSubstituteCharacters().

The argument to setSaveSubstituteCharacters() is a XmlOptionCharEscapeMap 
object. You should set this up by calling:

XmlOptionCharEscapeMap escapes = new XmlOptionCharEscapeMap();
escapes.addMapping('>', XmlOptionCharEscapeMap.PREDEF_ENTITY);

I'm resolving as "Won't Fix" for these reasons, but please re-open if I 
misunderstood your requirements.

> Saver.java does not properly convert the Greater Than (>) to &gt; when it is 
> contains inside an element or attribute.
> ---------------------------------------------------------------------------------------------------------------------
>
>          Key: XMLBEANS-192
>          URL: http://issues.apache.org/jira/browse/XMLBEANS-192
>      Project: XMLBeans
>         Type: Bug
>     Versions: Version 2
>  Environment: Windows XP
>     Reporter: Stephen Cole
>      Fix For: Version 2.1

>
> Saver.java does not properly convert the Greater Than (>) sign to &gt; when 
> it is contains inside an element or attribute. However it seems to correctly 
> convert the &, < symbols correctly.
> For example if have following fragment of input XML:
> <FareDisplayOptions>
>     <PF2 PF2Ind="<>" PF3Allow="<>" PF3Rule="<>"
>     </PF2>
> </FareDisplayOptions>
> It gets converted to: (Notice that the < gets converted correclty, but the > 
> does not)
> <FareDisplayOptions>
>     <PF2 PF2Ind="&lt;>" PF3Allow="&lt;>" PF3Rule="&lt;>"
>     </PF2>
> </FareDisplayOptions>

-- 
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: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to