/** * Introduced in DOM Level 2. * * */ public boolean hasAttributes() { return DTM.NULL != dtm.getFirstAttribute(node); }
/** * Introduced in DOM Level 2. * * */ public boolean hasAttributes() { return DTM.NULL != dtm.getFirstAttribute(node); }
/** * Get the next node via getFirstAttribute && getNextAttribute. */ protected int getNextNode() { m_lastFetched = (DTM.NULL == m_lastFetched) ? m_cdtm.getFirstAttribute(m_context) : m_cdtm.getNextAttribute(m_lastFetched); return m_lastFetched; }
/** * Get the next node via getFirstAttribute && getNextAttribute. */ protected int getNextNode() { m_lastFetched = (DTM.NULL == m_lastFetched) ? m_cdtm.getFirstAttribute(m_context) : m_cdtm.getNextAttribute(m_lastFetched); return m_lastFetched; }
/** * Return the number of Attributes on this Element * * @return The number of nodes in this map. */ public int getLength() { if (m_count == -1) { short count = 0; for (int n = dtm.getFirstAttribute(element); n != -1; n = dtm.getNextAttribute(n)) { ++count; } m_count = count; } return (int) m_count; }
/** * Return the number of Attributes on this Element * * @return The number of nodes in this map. */ public int getLength() { if (m_count == -1) { short count = 0; for (int n = dtm.getFirstAttribute(element); n != -1; n = dtm.getNextAttribute(n)) { ++count; } m_count = count; } return (int) m_count; }
/** * Returns the <code>index</code>th item in the map. If <code>index</code> * is greater than or equal to the number of nodes in this map, this * returns <code>null</code>. * @param i The index of the requested item. * @return The node at the <code>index</code>th position in the map, or * <code>null</code> if that is not a valid index. */ public Node item(int i) { int count = 0; for (int n = dtm.getFirstAttribute(element); n != -1; n = dtm.getNextAttribute(n)) { if (count == i) return dtm.getNode(n); else ++count; } return null; }
/** * Retrieves a node specified by name. * @param name The <code>nodeName</code> of a node to retrieve. * @return A <code>Node</code> (of any type) with the specified * <code>nodeName</code>, or <code>null</code> if it does not identify * any node in this map. */ public Node getNamedItem(String name) { for (int n = dtm.getFirstAttribute(element); n != DTM.NULL; n = dtm.getNextAttribute(n)) { if (dtm.getNodeName(n).equals(name)) return dtm.getNode(n); } return null; }
/** * Returns the <code>index</code>th item in the map. If <code>index</code> * is greater than or equal to the number of nodes in this map, this * returns <code>null</code>. * @param i The index of the requested item. * @return The node at the <code>index</code>th position in the map, or * <code>null</code> if that is not a valid index. */ public Node item(int i) { int count = 0; for (int n = dtm.getFirstAttribute(element); n != -1; n = dtm.getNextAttribute(n)) { if (count == i) return dtm.getNode(n); else ++count; } return null; }
/** * Retrieves a node specified by name. * @param name The <code>nodeName</code> of a node to retrieve. * @return A <code>Node</code> (of any type) with the specified * <code>nodeName</code>, or <code>null</code> if it does not identify * any node in this map. */ public Node getNamedItem(String name) { for (int n = dtm.getFirstAttribute(element); n != DTM.NULL; n = dtm.getNextAttribute(n)) { if (dtm.getNodeName(n).equals(name)) return dtm.getNode(n); } return null; }
/** * Retrieves a node specified by local name and namespace URI. HTML-only * DOM implementations do not need to implement this method. * @param namespaceURI The namespace URI of the node to retrieve. * @param localName The local name of the node to retrieve. * * @return A <code>Node</code> (of any type) with the specified local * name and namespace URI, or <code>null</code> if they do not * identify any node in this map. * @since DOM Level 2 */ public Node getNamedItemNS(String namespaceURI, String localName) { Node retNode = null; for (int n = dtm.getFirstAttribute(element); n != DTM.NULL; n = dtm.getNextAttribute(n)) { if (localName.equals(dtm.getLocalName(n))) { String nsURI = dtm.getNamespaceURI(n); if ((namespaceURI == null && nsURI == null) || (namespaceURI != null && namespaceURI.equals(nsURI))) { retNode = dtm.getNode(n); break; } } } return retNode; }
/** * Retrieves a node specified by local name and namespace URI. HTML-only * DOM implementations do not need to implement this method. * @param namespaceURI The namespace URI of the node to retrieve. * @param localName The local name of the node to retrieve. * * @return A <code>Node</code> (of any type) with the specified local * name and namespace URI, or <code>null</code> if they do not * identify any node in this map. * @since DOM Level 2 */ public Node getNamedItemNS(String namespaceURI, String localName) { Node retNode = null; for (int n = dtm.getFirstAttribute(element); n != DTM.NULL; n = dtm.getNextAttribute(n)) { if (localName.equals(dtm.getLocalName(n))) { String nsURI = dtm.getNamespaceURI(n); if ((namespaceURI == null && nsURI == null) || (namespaceURI != null && namespaceURI.equals(nsURI))) { retNode = dtm.getNode(n); break; } } } return retNode; }
/** * Copy DOM attributes to the result element. * * @param src Source node with the attributes * * @throws TransformerException */ public static void addAttributes(SerializationHandler handler, int src) throws TransformerException { TransformerImpl transformer = (TransformerImpl) handler.getTransformer(); DTM dtm = transformer.getXPathContext().getDTM(src); for (int node = dtm.getFirstAttribute(src); DTM.NULL != node; node = dtm.getNextAttribute(node)) { addAttribute(handler, node); } }
/** * Copy DOM attributes to the result element. * * @param src Source node with the attributes * * @throws TransformerException */ public static void addAttributes(SerializationHandler handler, int src) throws TransformerException { TransformerImpl transformer = (TransformerImpl) handler.getTransformer(); DTM dtm = transformer.getXPathContext().getDTM(src); for (int node = dtm.getFirstAttribute(src); DTM.NULL != node; node = dtm.getNextAttribute(node)) { addAttribute(handler, node); } }
new org.xml.sax.helpers.AttributesImpl(); for (int i = dtm.getFirstAttribute(node); i != DTM.NULL; i = dtm.getNextAttribute(i))
new org.xml.sax.helpers.AttributesImpl(); for (int i = dtm.getFirstAttribute(node); i != DTM.NULL; i = dtm.getNextAttribute(i))
for (int attr = dtm.getFirstAttribute(node); DTM.NULL != attr; attr = dtm.getNextAttribute(attr))
for (int attr = dtm.getFirstAttribute(node); DTM.NULL != attr; attr = dtm.getNextAttribute(attr))
/** * Introduced in DOM Level 2. * * */ public boolean hasAttributes() { return DTM.NULL != dtm.getFirstAttribute(node); }
/** * Get the next node via getFirstAttribute && getNextAttribute. */ protected int getNextNode() { m_lastFetched = (DTM.NULL == m_lastFetched) ? m_cdtm.getFirstAttribute(m_context) : m_cdtm.getNextAttribute(m_lastFetched); return m_lastFetched; }