/** * Get the prefix of the n'th declaration (or undeclaration) in the list, * counting from zero. * * @param index the index identifying which declaration is required. * @return the namespace prefix. For a declaration or undeclaration of the * default namespace, this is the zero-length string. * @throws IndexOutOfBoundsException if the index is out of range. */ public String getPrefix(int index) { return namePool.getPrefixFromNamespaceCode(namespaceCodes[index]); }
/** * Get the prefix of the n'th declaration (or undeclaration) in the list, * counting from zero. * * @param index the index identifying which declaration is required. * @return the namespace prefix. For a declaration or undeclaration of the * default namespace, this is the zero-length string. * @throws IndexOutOfBoundsException if the index is out of range. */ public String getPrefix(int index) { return namePool.getPrefixFromNamespaceCode(namespaceCodes[index]); }
/** * Get an iterator over all the prefixes declared in this namespace context. This will include * the default namespace (prefix="") and the XML namespace where appropriate */ public Iterator iteratePrefixes() { ArrayList prefixes = new ArrayList(namespaceCodes.length); for (int i=0; i<namespaceCodes.length; i++) { prefixes.add(namePool.getPrefixFromNamespaceCode(namespaceCodes[i])); } return prefixes.iterator(); }
/** * Get an iterator over all the prefixes declared in this namespace context. This will include * the default namespace (prefix="") and the XML namespace where appropriate */ public Iterator iteratePrefixes() { ArrayList prefixes = new ArrayList(namespaceCodes.length); for (int i=0; i<namespaceCodes.length; i++) { prefixes.add(namePool.getPrefixFromNamespaceCode(namespaceCodes[i])); } return prefixes.iterator(); }
/** * Get an iterator over all the prefixes declared in this namespace context. This will include * the default namespace (prefix="") and the XML namespace where appropriate */ public Iterator iteratePrefixes() { ArrayList prefixes = new ArrayList(namespaceCodes.length); for (int i=0; i<namespaceCodes.length; i++) { prefixes.add(namePool.getPrefixFromNamespaceCode(namespaceCodes[i])); } return prefixes.iterator(); }
public Object next() { if (phase == 1) { phase = 2; return "xml"; } else { return pool.getPrefixFromNamespaceCode(iter.next()); } }
/** * It is possible for a single output element to use the same prefix to refer to different * namespaces. In this case we have to generate an alternative prefix for uniqueness. The * one we generate is based on the sequential position of the element/attribute: this is * designed to ensure both uniqueness (with a high probability) and repeatability * @param nscode the namespace code * @param seq sequence number to help in making the generated prefix unique * @return the invented prefix */ private String getSubstitutePrefix(int nscode, int seq) { String prefix = getNamePool().getPrefixFromNamespaceCode(nscode); return prefix + '_' + seq; }
public Object next() { if (phase == 1) { phase = 2; return "xml"; } else { return pool.getPrefixFromNamespaceCode(iter.next()); } }
public String getNamespacePrefix(int i) { if (currentStaxEvent != START_ELEMENT && currentStaxEvent != END_ELEMENT) { throw new IllegalStateException(""+currentStaxEvent); } int nscode = startElementEvent.getLocalNamespaces()[i]; return namePool.getPrefixFromNamespaceCode(nscode); }
/** * It is possible for a single output element to use the same prefix to refer to different * namespaces. In this case we have to generate an alternative prefix for uniqueness. The * one we generate is based on the sequential position of the element/attribute: this is * designed to ensure both uniqueness (with a high probability) and repeatability * @param nscode the namespace code * @param seq sequence number to help in making the generated prefix unique * @return the invented prefix */ private String getSubstitutePrefix(int nscode, int seq) { String prefix = getNamePool().getPrefixFromNamespaceCode(nscode); return prefix + '_' + seq; }
/** * It is possible for a single output element to use the same prefix to refer to different * namespaces. In this case we have to generate an alternative prefix for uniqueness. The * one we generate is based on the sequential position of the element/attribute: this is * designed to ensure both uniqueness (with a high probability) and repeatability * @param nscode the namespace code of the proposed element or attribute name * @param seq sequence number of attribute, used for generating distinctive prefixes * @return the actual allocated name, which may be different. */ private String getSubstitutePrefix(int nscode, int seq) { String prefix = getNamePool().getPrefixFromNamespaceCode(nscode); return prefix + '_' + seq; }
/** * It is possible for a single output element to use the same prefix to refer to different * namespaces. In this case we have to generate an alternative prefix for uniqueness. The * one we generate is based on the sequential position of the element/attribute: this is * designed to ensure both uniqueness (with a high probability) and repeatability * @param nscode the proposed namespace code * @param seq sequence number for use in the substitute prefix * @return a prefix to use in place of the one originally proposed */ private String getSubstitutePrefix(int nscode, int seq) { String prefix = getNamePool().getPrefixFromNamespaceCode(nscode); return prefix + '_' + seq; }
/** * It is possible for a single output element to use the same prefix to refer to different * namespaces. In this case we have to generate an alternative prefix for uniqueness. The * one we generate is based on the sequential position of the element/attribute: this is * designed to ensure both uniqueness (with a high probability) and repeatability * @param nscode the namespace code of the proposed element or attribute name * @param seq sequence number of attribute, used for generating distinctive prefixes * @return the actual allocated name, which may be different. */ private String getSubstitutePrefix(int nscode, int seq) { String prefix = getNamePool().getPrefixFromNamespaceCode(nscode); return prefix + '_' + seq; }
public Object next() { if (pool == null) { pool = getNamePool(); return "xml"; } else { return pool.getPrefixFromNamespaceCode(iter.next()); } } public void remove() {
public Object next() { if (pool == null) { pool = getNamePool(); return "xml"; } else { return pool.getPrefixFromNamespaceCode(iter.next()); } } public void remove() {
public Object next() { if (pool == null) { pool = getNamePool(); return "xml"; } else { return pool.getPrefixFromNamespaceCode(iter.next()); } } public void remove() {
/** * Handle a namespace */ public void namespace(int namespaceCode, int properties) throws XPathException { int nc = newPool.allocateNamespaceCode(oldPool.getPrefixFromNamespaceCode(namespaceCode), oldPool.getURIFromNamespaceCode(namespaceCode)); nextReceiver.namespace(nc, properties); }
/** * Handle a namespace */ public void namespace(int namespaceCode, int properties) throws XPathException { int nc = newPool.allocateNamespaceCode(oldPool.getPrefixFromNamespaceCode(namespaceCode), oldPool.getURIFromNamespaceCode(namespaceCode)); nextReceiver.namespace(nc, properties); }
public void namespace(int namespaceCode, int properties) throws XPathException { if (contentStarted) { String prefix = getNamePool().getPrefixFromNamespaceCode(namespaceCode); String uri = getNamePool().getURIFromNamespaceCode(namespaceCode); processingInstruction("namespace", "prefix=\"" + prefix + "\" uri=\"" + uri + "\"", 0, 0); } else { super.namespace(namespaceCode, properties); } }
public void namespace(int namespaceCode, int properties) throws XPathException { if (contentStarted) { String prefix = getNamePool().getPrefixFromNamespaceCode(namespaceCode); String uri = getNamePool().getURIFromNamespaceCode(namespaceCode); processingInstruction("namespace", "prefix=\"" + prefix + "\" uri=\"" + uri + "\"", 0, 0); } else { super.namespace(namespaceCode, properties); } }