Oops, of course, my bad. I got confused by the fact that what
.addMappings(char, char, int) really does is call
.addMapping(char, int) in a 'for' loop...

But yeah, Brian, I think that's exactly what you are looking for.
Radu

-----Original Message-----
From: Wing Yew Poon 
Sent: Monday, March 20, 2006 6:40 PM
To: user@xmlbeans.apache.org
Subject: RE: special character escaping

Radu,
it is possible to escape a range of characters using the
XmlOptionCharEscapeMap:

        XmlOptionCharEscapeMap charEsc = new XmlOptionCharEscapeMap();
        charEsc.addMappings('A', 'Z',
XmlOptionCharEscapeMap.HEXADECIMAL);
        System.out.println(charEsc.getEscapedString('A')); //"A"
        System.out.println(charEsc.getEscapedString('B')); //"B"
        System.out.println(charEsc.getEscapedString('C')); //"C"
        System.out.println(charEsc.getEscapedString('X')); //"X"
        System.out.println(charEsc.getEscapedString('Y')); //"Y"
        System.out.println(charEsc.getEscapedString('Z')); //"Z"

I don't know if this is what Brian is looking for.
- Wing Yew

-----Original Message-----
From: Radu Preotiuc-Pietro
Sent: Monday, March 20, 2006 6:20 PM
To: user@xmlbeans.apache.org
Subject: RE: special character escaping

XmlBeans, by default, escapes the minimum number of characters that are
required:
- <
- &
- " (only if inside an attribute value)

Other than this, you can use the XmlOptions to turn on escaping for
other characters, as you correctly pointed out.
If you want to, say, escape every non-ASCII character (by the way, why
do you need that?) you would indeed have to fill the map with tens of
thousands of entries, which is less than optimal, but possible.
I guess we didn't think that someone would want to escape ranges of
characters at once, so we tried to keep the XmlOptionCharEscapeMap
simple...

Radu

-----Original Message-----
From: Brian Lee [mailto:[EMAIL PROTECTED]
Sent: Wednesday, March 15, 2006 3:05 PM
To: user@xmlbeans.apache.org
Subject: Re: special character escaping

Besides the & character does XMLBeans escape any other characters by
default?

Thanks,

Brian Lee - Developer
Macys.com


 

             Brian Lee

             <[EMAIL PROTECTED]>

 
To 
             03/15/06 01:27 PM         user@xmlbeans.apache.org

 
cc 
 

             Please respond to
Subject 
             [EMAIL PROTECTED]         special character escaping

                  che.org

 

 

 

 

 






I've looked at the archived user list and I haven't been able to find
any questions or answers regarding character escaping.
I was wondering if there's a way to either completely turn it off or to
have xmlbeans function like the Jakarta Commons
StringEscapeUtils.escapeXml() function? Any info would be much
appreciated.

Thanks,

Brian Lee - Developer
Macys.com
W: 415-422-1624
C: 415-425-4077


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




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

_______________________________________________________________________
Notice:  This email message, together with any attachments, may contain
information  of  BEA Systems,  Inc.,  its subsidiaries  and  affiliated
entities,  that may be confidential,  proprietary,  copyrighted  and/or
legally privileged, and is intended solely for the use of the individual
or entity named in this message. If you are not the intended recipient,
and have received this message in error, please immediately return this
by email and then delete it.

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

_______________________________________________________________________
Notice:  This email message, together with any attachments, may contain
information  of  BEA Systems,  Inc.,  its subsidiaries  and  affiliated
entities,  that may be confidential,  proprietary,  copyrighted  and/or
legally privileged, and is intended solely for the use of the individual
or entity named in this message. If you are not the intended recipient,
and have received this message in error, please immediately return this
by email and then delete it.

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

_______________________________________________________________________
Notice:  This email message, together with any attachments, may contain
information  of  BEA Systems,  Inc.,  its subsidiaries  and  affiliated
entities,  that may be confidential,  proprietary,  copyrighted  and/or
legally privileged, and is intended solely for the use of the individual
or entity named in this message. If you are not the intended recipient,
and have received this message in error, please immediately return this
by email and then delete it.

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

Reply via email to