1 28 29 package com.caucho.xsl.java; 30 31 import com.caucho.java.JavaWriter; 32 import com.caucho.xml.XmlChar; 33 34 37 public class TextNode extends XslNode { 38 private String _text; 39 40 public TextNode(String text) 41 { 42 _text = text; 43 } 44 45 48 public String getText() 49 { 50 return _text; 51 } 52 53 58 public void generate(JavaWriter out) 59 throws Exception 60 { 61 if (! isWhitespace()) { 62 out.print("out.print(\""); 63 out.printJavaString(_text); 64 out.println("\");"); 65 } 66 } 67 68 public boolean isWhitespace() 69 { 70 for (int i = 0; i < _text.length(); i++) { 71 char ch = _text.charAt(i); 72 73 if (! XmlChar.isWhitespace(ch)) 74 return false; 75 } 76 77 return true; 78 } 79 } 80 | Popular Tags |