1 57 58 63 64 65 66 67 package org.enhydra.apache.xerces.dom; 68 69 import org.enhydra.apache.xerces.utils.StringPool; 70 71 78 public final class DeferredAttrNSImpl 79 extends AttrNSImpl 80 implements DeferredNode { 81 82 86 87 static final long serialVersionUID = 6074924934945957154L; 88 89 93 94 protected transient int fNodeIndex; 95 96 100 104 DeferredAttrNSImpl(DeferredDocumentImpl ownerDocument, int nodeIndex) { 105 super(ownerDocument, null); 106 107 fNodeIndex = nodeIndex; 108 needsSyncData(true); 109 needsSyncChildren(true); 110 111 } 113 117 118 public int getNodeIndex() { 119 return fNodeIndex; 120 } 121 122 126 127 protected void synchronizeData() { 128 129 needsSyncData(false); 131 132 DeferredDocumentImpl ownerDocument = 134 (DeferredDocumentImpl) ownerDocument(); 135 int attrQName = ownerDocument.getNodeName(fNodeIndex); 136 StringPool pool = ownerDocument.getStringPool(); 137 name = pool.toString(attrQName); 138 139 int index = name.indexOf(':'); 141 String prefix; 142 if (index < 0) { 143 prefix = null; 144 localName = name; 145 } 146 else { 147 prefix = name.substring(0, index); 148 localName = name.substring(index + 1); 149 } 150 151 isSpecified(ownerDocument.getNodeValue(fNodeIndex) == 1); 152 namespaceURI = pool.toString(ownerDocument.getNodeURI(fNodeIndex)); 154 if (namespaceURI.length() == 0) { 156 namespaceURI = null; 157 } 158 if (namespaceURI == null) { 163 if (prefix != null) { 164 if (prefix.equals("xmlns")) { 165 namespaceURI = "http://www.w3.org/2000/xmlns/"; 166 } 167 } else if (name.equals("xmlns")) { 168 namespaceURI = "http://www.w3.org/2000/xmlns/"; 169 } 170 } 171 172 } 174 180 protected void synchronizeChildren() { 181 DeferredDocumentImpl ownerDocument = 182 (DeferredDocumentImpl) ownerDocument(); 183 ownerDocument.synchronizeChildren(this, fNodeIndex); 184 } 186 } | Popular Tags |