public String execute ( final String pointerStr , final Source source ) { try { final StringWriter stringWriter = new StringWriter ( ) ; final Serializer serializer = processor . newSerializer ( stringWriter ) ; serializer . setOutputProperty ( Serializer . Property . OMIT_XML_DECLARATION , "yes" ) ; executeToDestination ( pointerStr , source , serializer ) ; return stringWriter . toString ( ) ; } catch ( final XPointerException e ) { final String message = e . getLocalizedMessage ( ) ; if ( xPointerErrorHandler != null ) { xPointerErrorHandler . reportError ( message ) ; } else { LOG . error ( message , e ) ; } } return "" ; }
Execute xpointer expression on a xml source returning a xml string