You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@xmlbeans.apache.org by Stylus Studio <st...@gmail.com> on 2010/04/20 16:01:38 UTC

(Unknown)

http://AnnalynbwCornishfkq.spaces.live.com

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


XmlCursor set/getTextValue not working for me

Posted by Bartolomeo Nicolotti <bn...@siapcn.it>.
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-unsubscribe@xmlbeans.apache.org
For additional commands, e-mail: user-help@xmlbeans.apache.org