XmlCursor set/getTextValue not working for me
Bartolomeo Nicolotti <[email protected]> Tue, 03 Aug 2010 16:47:06 +0200
| Newsgroups | gmane.text.xml.xmlbeans.user |
|---|---|
| Organization | SIAP-Sistemi Applicativi |
| Message-ID | <1280846826.12478.41.camel@LxPC37> |
Hello,
I'm trying to use this code to replace character "à" with "a'":
XmlCursor cursor = xmlObj.newCursor();
while( !cursor.toNextToken().isNone() ){
switch( cursor.currentTokenType().intValue() ){
case TokenType.INT_TEXT:
case TokenType.INT_ATTR:
{
String strval = cursor.getTextValue();
strval = strval.replaceAll("à","a'");
try{
cursor.setTextValue( strval );
}catch(IllegalStateException e){
//discard this
}
}
}
}
but the document remains unchanged, what's my mistake?
Many thanks
Best regards