Hi, Jody,

I think that is a bug in the XMLBeans code... The Saver doesn't seem to
take your XmlOptionCharEscapeMap into consideration when saving
attribute values, only when saving element text. You can open a JIRA for
it if you have a JIRA account, or I can do it for you.

Radu

On Wed, 2008-07-16 at 08:26 -0700, Jody Marca wrote:
> Hi i want to map some char with XmlOptionCharEscapeMap.DECIMAL mode; i
> have some problem with following characters
> à ì ù è ò ' and also with tab ('\t') and newline ('\n')
> The main problem is tab and new line in attribute value
> 
> this is the code:
> 
> XmlOptions options = new XmlOptions();
> XmlOptionCharEscapeMap escapes = new XmlOptionCharEscapeMap();
>           escapes.addMapping('\t',XmlOptionCharEscapeMap.DECIMAL);
>           escapes.addMapping('\n',XmlOptionCharEscapeMap.DECIMAL);
> options.setSaveSubstituteCharacters(escapes);
> 
> .....
> 
> comment.setXmiId(vincolo.getId());
>         comment.setIsSpecification("false");
>         comment.setName(vincolo.getNome());
>         comment.setBody(vincolo.getVincoloOCL());
> 
> /* where vincolo.getVincoloOCL() is "context
> Accesso_interno_Posizione_ingresso\ninv:
> \nself.geometria.coordinateDimension() = 3"
> 
> ....
> documento.save(new File("test.xml"),options);
> 
> The result is 
> <UML:Comment
> xmi.id="GeometryConstraint_Accesso_interno_Posizione_ingresso"
> isSpecification="false" name="Vincolo_geometria_GU_Point3D"
> body="context Accesso_interno_Posizione_ingresso
> inv:
> self.geometria.coordinateDimension() = 3">
> 
> but I'm expect something like 
> <UML:Comment
> xmi.id="GeometryConstraint_Accesso_interno_Posizione_ingresso"
> isSpecification="false" name="Vincolo_geometria_GU_Point3D"
> body="context
> Accesso_interno_Posizione_ingresso&#10;inv:&#10self.geometria.coordinateDimension()
>  = 3">
> 
> can anyone help me?
> Regards
>    Jody
> 
> 
> 


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to