0

How to change string representation objects in Variables or Expressions views?

enter image description here

1 Answer 1

2

Eclipse have special feature for this that call Detail Formatter

enter image description here

For org.w3c.dom.Node interface need add this code:

if (this == null) return null;  

javax.xml.transform.TransformerFactory tf = javax.xml.transform.TransformerFactory.newInstance();   

javax.xml.transform.Transformer transformer = tf.newTransformer();  

transformer.setOutputProperty(javax.xml.transform.OutputKeys.METHOD, "xml");  
transformer.setOutputProperty(javax.xml.transform.OutputKeys.INDENT, "yes");  
transformer.setOutputProperty("{http://xml.apache.org/xslt}indent-amount", "3");  


javax.xml.transform.dom.DOMSource source = new javax.xml.transform.dom.DOMSource(this);  
if (source == null) return "Corrupted XML document: " + this.toString();  

java.io.StringWriter os = new java.io.StringWriter();  
javax.xml.transform.stream.StreamResult result = new   javax.xml.transform.stream.StreamResult(os);  
transformer.transform(source,result);  

return os.toString ();
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.