1 24 25 package org.enhydra.xml.xhtml.dom.xerces; 26 27 import org.w3c.dom.Node ; 28 import org.w3c.dom.Text ; 29 30 public class XHTMLTitleElementImpl 31 extends XHTMLElementImpl 32 implements org.enhydra.xml.xhtml.dom.XHTMLTitleElement 33 { 34 35 public XHTMLTitleElementImpl (XHTMLDocumentBase owner, String namespaceURI, String tagName) { 36 super( owner, namespaceURI, tagName); 37 } 38 39 public void setId (String newValue) { 40 setAttribute("id", newValue); 41 } 42 43 public String getId () { 44 return getAttribute ("id"); 45 } 46 public void setLang (String newValue) { 47 setAttribute("lang", newValue); 48 } 49 50 public String getLang () { 51 return getAttribute ("lang"); 52 } 53 public void setDir (String newValue) { 54 setAttribute("dir", newValue); 55 } 56 57 public String getDir () { 58 return getAttribute ("dir"); 59 } 60 public void setClassName (String newValue) { 61 setAttribute("class", newValue); 62 } 63 64 public String getClassName () { 65 return getAttribute ("class"); 66 } 67 public void setTitle (String newValue) { 68 setAttribute("title", newValue); 69 } 70 71 public String getTitle () { 72 return getAttribute ("title"); 73 } 74 public void setXmlLang (String newValue) { 75 setAttribute("xml:lang", newValue); 76 } 77 78 public String getXmlLang () { 79 return getAttribute ("xml:lang"); 80 } 81 ; 82 83 public String getText() { 84 Node child; 85 String text; 86 87 child = getFirstChild(); 90 text = ""; 91 while ( child != null ) { 92 if ( child instanceof Text ) 93 text = text + ( (Text ) child ).getData(); 94 child = child.getNextSibling(); 95 } 96 return text; 97 } 98 99 public void setText( String text ) { 100 Node child; 101 Node next; 102 103 child = getFirstChild(); 106 while ( child != null ) { 107 next = child.getNextSibling(); 108 removeChild( child ); 109 child = next; 110 } 111 insertBefore( getOwnerDocument().createTextNode( text ), getFirstChild() ); 112 } 113 114 115 ; 116 } 117 118 119 | Popular Tags |