1 package net.sf.saxon.dom; 2 3 import net.sf.saxon.om.NodeInfo; 4 import net.sf.saxon.type.Type; 5 import org.w3c.dom.Attr ; 6 import org.w3c.dom.DOMException ; 7 import org.w3c.dom.Element ; 8 import org.w3c.dom.TypeInfo ; 9 10 14 15 public class AttrOverNodeInfo extends NodeOverNodeInfo implements Attr { 16 17 20 21 public String getName() { 22 return node.getDisplayName(); 23 } 24 25 29 30 public String getValue() { 31 return node.getStringValue(); 32 } 33 34 40 41 public boolean getSpecified() { 42 return true; 43 } 44 45 49 50 public void setValue(String value) throws DOMException { 51 disallowUpdate(); 52 } 53 54 59 60 public Element getOwnerElement() { 61 if (node.getNodeKind()!=Type.ATTRIBUTE) { 62 throw new UnsupportedOperationException ( 63 "This method is defined only on attribute nodes"); 64 } 65 return (Element )wrap(node.getParent()); 66 } 67 70 71 public TypeInfo getSchemaTypeInfo() { 72 int annotation = node.getTypeAnnotation(); 73 if (annotation == -1 || ((annotation & NodeInfo.IS_DTD_TYPE) != 0)) { 74 return null; 75 } 76 return new TypeInfoImpl(node.getConfiguration(), 77 node.getConfiguration().getSchemaType(annotation)); 78 } 79 80 } 81 82 | Popular Tags |