Demos and Usage of org.w3c.dom.Node.getAttributes()


   1: 
   2: import org.w3c.dom.Node;
   3: 
   4:         ...
   5: 
   6:     public OneToMany(Node node, PersistentClass owner) throws MappingException {
   7:         this.referencingTable = (owner==null) ? null : owner.getTable();
   8:         ...
   9:             type = (EntityType) Hibernate.association( ReflectHelper.classForName(
  10:                 node.getAttributes().getNamedItem("class").getNodeValue()
  11:             ) );

View Full Code Here
   1: 
   2:     public static void addAttribute(Document document, Node node, String name, String value)
   3:     {
   4:         ...
   5:             attribute.setValue(value);
   6:             node.getAttributes().setNamedItem(attribute);
   7:         }
   8:         ...
   9:     {
  10:         Node node= values.getNamedItem(name);
  11:         return node == null ? defaultValue : node.getNodeValue();

View Full Code Here
   1: import org.cougaar.util.log.Logger;
   2: import org.w3c.dom.Node;
   3: import org.w3c.dom.NodeList;
   4:         ...
   5: 
   6:   public List getInstance(LDMServesPlugin ldm, Node node){
   7: 
   8:         ...
   9: 
  10:       String id        = node.getAttributes().getNamedItem("id").getNodeValue();
  11:         ...
  12:       String prototype = node.getAttributes().getNamedItem("prototype").getNodeValue();

View Full Code Here
   1:   protected String sClassName = null;
   2:   protected Node   oEHNode    = null;
   3:   protected static transient Log oLogger = LogFactory.getLog(EventHandlerRep.class);
   4:         ...
   5:   public
   6:   EventHandlerRep(Node oEHNode)
   7:   throws SAXException{
   8:         ...
   9:     this.oEHNode    = oEHNode;
  10:     if(null != oEHNode.getAttributes() && 
  11:         ...
  12:        oEHNode.getAttributes().getLength() != 0){

View Full Code Here
   1: import org.w3c.dom.Element;
   2: import org.w3c.dom.Node;
   3: import org.w3c.dom.NodeList;
   4:         ...
   5:     for (int i=0; i<nlength; i++) {
   6:       Node propNode = nlist.item(i);
   7:         ...
   8:       if (propNode.getNodeType() == Node.ELEMENT_NODE) {
   9:         if (propNode.getNodeName().equals("TransferablePropagation")) {
  10:         ...
  11:           String className  = 
  12:         propNode.getAttributes().getNamedItem("class").getNodeValue();

View Full Code Here
   1: import org.w3c.dom.Element;
   2: import org.w3c.dom.Node;
   3: import org.w3c.dom.NodeList;
   4:         ...
   5:       for (int i=0; i<nlength; i++) {
   6:     Node policyNode = nlist.item(i);
   7:         ...
   8:     if (policyNode.getNodeType() == Node.ELEMENT_NODE) {
   9:       Policy p = getPolicy(policyNode);
  10:         ...
  11: 
  12:       String policyName = policyNode.getAttributes().getNamedItem("name").getNodeValue();

View Full Code Here
   1: import org.w3c.dom.NamedNodeMap;
   2: import org.w3c.dom.Node;
   3: import org.w3c.dom.css.CSSStyleDeclaration;
   4:         ...
   5: 
   6:     protected MutableTreeNode createTree(Node node, 
   7:                                              boolean showWhitespace) {
   8:         ...
   9:         public int getRowCount() {
  10:         return node.getAttributes().getLength();
  11:         }
  12:         ...
  13:         public Object getValueAt(int row, int col) {
  14:         NamedNodeMap map = node.getAttributes();

View Full Code Here
   1: import org.w3c.dom.NamedNodeMap;
   2: import org.w3c.dom.Node;
   3: import org.w3c.dom.TypeInfo;
   4:         ...
   5:     protected boolean isNodeTypeValid(short type) {
   6:         return type == Node.ELEMENT_NODE
   7:         ...
   8:             || type == Node.COMMENT_NODE
   9:             || type == Node.TEXT_NODE
  10:         ...
  11:         while (element != null) {
  12:             NamedNodeMap nm = element.getAttributes();

View Full Code Here
   1: import org.w3c.dom.Element;
   2: import org.w3c.dom.Node;
   3: 
   4:         ...
   5:                 if (obj instanceof Element) {
   6:                     Node node = (Element)obj;
   7:                         && node.getLocalName().equals("ServiceName")) {
   8:         ...
   9:                         } else {
  10:                             Node nodeAttr = node.getAttributes().getNamedItem("xmlns");
  11:                             namespaceURI = nodeAttr.getNodeValue();
  12:         ...
  13:                         && node.getNodeName().contains("ServiceName")) {
  14:                         return node.getAttributes().getNamedItem("EndpointName").getTextContent();

View Full Code Here
   1: 
   2: public void domCheckSum(Node node)
   3: {
   4:         ...
   5:     String        s;
   6:     Node          child;
   7:     NamedNodeMap  attributes;
   8: 
   9:     switch (node.getNodeType() )

View Full Code Here
   1: 
   2:     public static void printXML(Node node, Writer writer) {
   3: 
   4:         ...
   5:         try {
   6:             if (node == null) {
   7:                 writer.write("NULL");
   8:         ...
   9:         a.setNodeValue(value);
  10:         node.getAttributes().setNamedItem(a);
  11:     }
  12:         ...
  13:         try {
  14:             Node n = node.getAttributes().getNamedItem(name);

View Full Code Here
   1: import org.w3c.dom.NamedNodeMap;
   2: import org.w3c.dom.Node;
   3: import org.w3c.dom.traversal.NodeFilter;
   4:         ...
   5:         int          i;
   6:         Node         child;
   7:         ElementState state;
   8:         ...
   9:         if (elem.hasAttributes()) {
  10:             attrMap = elem.getAttributes();
  11:             length = attrMap.getLength();
  12:         ...
  13: 
  14:     protected void checkUnboundNamespacePrefixedNode (Node node) throws IOException{

View Full Code Here