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
        



---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscr...@xmlbeans.apache.org
For additional commands, e-mail: user-h...@xmlbeans.apache.org

  • [no subject] Stylus Studio
    • XmlCursor set/getTextValue not working for me Bartolomeo Nicolotti

Reply via email to