/** Returns the type of the given node. */ public short getNodeType(int nodeIndex) { return getNodeType(nodeIndex, true); }
/** * Returns internal Xerces details about all elements in the specified document. * The id of the returned {@link Map} is the {@code nodeIndex} of an element, and the list * is the array of ordered attributes names. * @param document the document * @return the map of an element index with its ordered attribute names */ public static Map<Integer, List<String>> getAttributesOrderMap(final Document document) { final Map<Integer, List<String>> map = new HashMap<>(); if (document instanceof DeferredDocumentImpl) { final DeferredDocumentImpl deferredDocument = (DeferredDocumentImpl) document; final int fNodeCount = getPrivate(deferredDocument, "fNodeCount"); for (int i = 0; i < fNodeCount; i++) { final int type = deferredDocument.getNodeType(i, false); if (type == org.w3c.dom.Node.ELEMENT_NODE) { int attrIndex = deferredDocument.getNodeExtra(i, false); final List<String> attributes = new ArrayList<>(); map.put(i, attributes); while (attrIndex != -1) { attributes.add(deferredDocument.getNodeName(attrIndex, false)); attrIndex = deferredDocument.getPrevSibling(attrIndex, false); } } } } return map; }
/** * Returns internal Xerces details about all elements in the specified document. * The id of the returned {@link Map} is the {@code nodeIndex} of an element, and the list * is the array of ordered attributes names. * @param document the document * @return the map of an element index with its ordered attribute names */ public static Map<Integer, List<String>> getAttributesOrderMap(final Document document) { final Map<Integer, List<String>> map = new HashMap<>(); if (document instanceof DeferredDocumentImpl) { final DeferredDocumentImpl deferredDocument = (DeferredDocumentImpl) document; final int fNodeCount = getPrivate(deferredDocument, "fNodeCount"); for (int i = 0; i < fNodeCount; i++) { final int type = deferredDocument.getNodeType(i, false); if (type == Node.ELEMENT_NODE) { int attrIndex = deferredDocument.getNodeExtra(i, false); final List<String> attributes = new ArrayList<>(); map.put(i, attributes); while (attrIndex != -1) { attributes.add(deferredDocument.getNodeName(attrIndex, false)); attrIndex = deferredDocument.getPrevSibling(attrIndex, false); } } } } return map; }
int prevSib = getRealPrevSibling(nodeIndex); if (prevSib != -1 && getNodeType(prevSib, false) == Node.TEXT_NODE) { break; } while (getNodeType(prevSib, false) == Node.TEXT_NODE);
/** * Synchronizes the data. This is special because of the way * that the "fast" notation stores its information internally. */ protected void synchronizeData() { // no need to synchronize again needsSyncData(false); // name DeferredDocumentImpl ownerDocument = (DeferredDocumentImpl)this.ownerDocument(); name = ownerDocument.getNodeName(fNodeIndex); ownerDocument.getNodeType(fNodeIndex); // public and system ids publicId = ownerDocument.getNodeValue(fNodeIndex); systemId = ownerDocument.getNodeURI(fNodeIndex); int extraDataIndex = ownerDocument.getNodeExtra(fNodeIndex); ownerDocument.getNodeType(extraDataIndex); baseURI = ownerDocument.getNodeName(extraDataIndex); } // synchronizeData()
int node = fDeferredDocumentImpl.getLastChild (fDocumentTypeIndex, false); while (node != -1) { short nodeType = fDeferredDocumentImpl.getNodeType (node, false); if (nodeType == Node.ENTITY_NODE) { String nodeName = fDeferredDocumentImpl.getNodeName (node, false);
int nodeIndex = fDeferredDocumentImpl.getLastChild (fDocumentTypeIndex, false); while (nodeIndex != -1) { short nodeType = fDeferredDocumentImpl.getNodeType (nodeIndex, false); if (nodeType == Node.ENTITY_NODE) { String nodeName = fDeferredDocumentImpl.getNodeName (nodeIndex, false);
int nodeIndex = fDeferredDocumentImpl.getLastChild (fDocumentTypeIndex, false); while (nodeIndex != -1) { short nodeType = fDeferredDocumentImpl.getNodeType (nodeIndex, false); if (nodeType == Node.ENTITY_NODE) { String nodeName = fDeferredDocumentImpl.getNodeName (nodeIndex, false);
int nodeIndex = fDeferredDocumentImpl.getLastChild (fDocumentTypeIndex, false); while (nodeIndex != -1) { short nodeType = fDeferredDocumentImpl.getNodeType (nodeIndex, false); if (nodeType == Node.NOTATION_NODE) { String nodeName = fDeferredDocumentImpl.getNodeName (nodeIndex, false);
short nodeType = fDeferredDocumentImpl.getNodeType (node, false); if (nodeType == Node.ENTITY_NODE) { String nodeName =
short nodeType = fDeferredDocumentImpl.getNodeType (node, false);
short nodeType = fDeferredDocumentImpl.getNodeType (node, false); if (nodeType == Node.ENTITY_NODE) { String nodeName =
/** * Synchronize the entity data. This is special because of the way * that the "fast" version stores the information. */ protected void synchronizeData() { // no need to sychronize again needsSyncData(false); // get the node data DeferredDocumentImpl ownerDocument = (DeferredDocumentImpl)this.ownerDocument; name = ownerDocument.getNodeName(fNodeIndex); // get the entity data publicId = ownerDocument.getNodeValue(fNodeIndex); systemId = ownerDocument.getNodeURI(fNodeIndex); int extraDataIndex = ownerDocument.getNodeExtra(fNodeIndex); ownerDocument.getNodeType(extraDataIndex); notationName = ownerDocument.getNodeName(extraDataIndex); // encoding and version DOM L3 version = ownerDocument.getNodeValue(extraDataIndex); encoding = ownerDocument.getNodeURI(extraDataIndex); // baseURI, actualEncoding DOM L3 int extraIndex2 = ownerDocument.getNodeExtra(extraDataIndex); baseURI = ownerDocument.getNodeName(extraIndex2); inputEncoding = ownerDocument.getNodeValue(extraIndex2); } // synchronizeData()