1 package JSci.mathml; 2 3 import org.w3c.dom.*; 4 import org.w3c.dom.mathml.*; 5 import org.apache.xerces.dom.ElementNSImpl; 6 7 12 public class MathMLElementImpl extends ElementNSImpl implements MathMLElement, MathMLNodeList { 13 static final String mathmlURI = "http://www.w3.org/1998/Math/MathML"; 14 15 18 public MathMLElementImpl(MathMLDocumentImpl owner, String qualifiedName) { 19 super(owner, mathmlURI, qualifiedName); 20 } 21 22 public String getClassName() { 23 return getAttribute("class"); 24 } 25 public void setClassName(String className) { 26 setAttribute("class", className); 27 } 28 29 public String getMathElementStyle() { 30 return getAttribute("style"); 31 } 32 public void setMathElementStyle(String mathElementStyle) { 33 setAttribute("style", mathElementStyle); 34 } 35 36 public String getId() { 37 return getAttribute("id"); 38 } 39 public void setId(String id) { 40 setAttribute("id", id); 41 } 42 43 public String getHref() { 44 return getAttribute("xlink:href"); 45 } 46 public void setHref(String href) { 47 setAttribute("xlink:href", href); 48 } 49 50 public String getXref() { 51 return getAttribute("xref"); 52 } 53 public void setXref(String xref) { 54 setAttribute("xref", xref); 55 } 56 57 public MathMLMathElement getOwnerMathElement() { 58 if (this instanceof MathMLMathElement) { 59 return null; 60 } 61 Node parent = getParentNode(); 62 while (!(parent instanceof MathMLMathElement)) { 63 parent = parent.getParentNode(); 64 } 65 return (MathMLMathElement) parent; 66 } 67 } 68 | Popular Tags |