/** * Process an attribute string of type T_STRINGLIST into * a vector of XPath match patterns. * * @param handler non-null reference to current StylesheetHandler that is constructing the Templates. * @param uri The Namespace URI, or an empty string. * @param name The local name (without prefix), or empty string if not namespace processing. * @param rawName The qualified name (with prefix). * @param value a whitespace delimited list of string values. * * @return A StringVector of the tokenized strings. */ StringVector processSTRINGLIST(StylesheetHandler handler, String uri, String name, String rawName, String value) { StringTokenizer tokenizer = new StringTokenizer(value, " \t\n\r\f"); int nStrings = tokenizer.countTokens(); StringVector strings = new StringVector(nStrings); for (int i = 0; i < nStrings; i++) { strings.addElement(tokenizer.nextToken()); } return strings; }
/** * Find out if the given "extension-element-prefix" property is defined. * @see <a href="http://www.w3.org/TR/xslt#extension-element">extension-element in XSLT Specification</a> * * @param uri The URI to find * * @return True if the given URI is found */ public boolean containsExtensionElementURI(String uri) { if (null == m_ExtensionElementURIs) return false; return m_ExtensionElementURIs.contains(uri); }
/** * Get the element at the given index * * * @param i Index of element to get * * @return The element at the given index * * @throws ArrayIndexOutOfBoundsException */ public String getElement(int i) throws ArrayIndexOutOfBoundsException { if (null == m_elements) throw new ArrayIndexOutOfBoundsException(); return (String) m_elements.elementAt(i); }
/** * Store the source location of the current node. This method must be called * as every node is added to the DTM or for no node. */ protected void setSourceLocation() { m_sourceSystemId.addElement(m_locator.getSystemId()); m_sourceLine.addElement(m_locator.getLineNumber()); m_sourceColumn.addElement(m_locator.getColumnNumber()); //%REVIEW% %BUG% Prevent this from arising in the first place // by not allowing the enabling conditions to change after we start // building the document. if (m_sourceSystemId.size() != m_size) { String msg = "CODING ERROR in Source Location: " + m_size + " != " + m_sourceSystemId.size(); System.err.println(msg); throw new RuntimeException(msg); } }
/** * Get whether or not the passed prefix is contained flagged by * the "exclude-result-prefixes" property. * @see <a href="http://www.w3.org/TR/xslt#literal-result-element">literal-result-element in XSLT Specification</a> * * @param prefix non-null reference to prefix that might be excluded. * @param uri reference to namespace that prefix maps to * * @return true if the prefix should normally be excluded.> */ public boolean containsExcludeResultPrefix(String prefix, String uri) { if (null == m_ExcludeResultPrefixs || uri == null ) return false; // This loop is ok here because this code only runs during // stylesheet compile time. for (int i =0; i< m_ExcludeResultPrefixs.size(); i++) { if (uri.equals(getNamespaceForPrefix(m_ExcludeResultPrefixs.elementAt(i)))) return true; } return false; /* if (prefix.length() == 0) prefix = Constants.ATTRVAL_DEFAULT_PREFIX; return m_ExcludeResultPrefixs.contains(prefix); */ }
hasMore = tokenizer.hasMoreTokens(); if ((null != usedrefs) && usedrefs.contains(ref)) usedrefs = new StringVector(); usedrefs.addElement(ref);
/** * Get the number of "exclude-result-prefixes" Strings. * @see <a href="http://www.w3.org/TR/xslt#literal-result-element">literal-result-element in XSLT Specification</a> * * @return The number of prefix strings to be excluded. */ public int getExcludeResultPrefixCount() { return (null != m_ExcludeResultPrefixs) ? m_ExcludeResultPrefixs.size() : 0; }
public SAX2RTFDTM(DTMManager mgr, Source source, int dtmIdentity, DTMWSFilter whiteSpaceFilter, XMLStringFactory xstringfactory, boolean doIndexing) { super(mgr, source, dtmIdentity, whiteSpaceFilter, xstringfactory, doIndexing); // NEVER track source locators for RTFs; they aren't meaningful. I think. // (If we did track them, we'd need to tail-prune these too.) //org.apache.xalan.processor.TransformerFactoryImpl.m_source_location; m_useSourceLocationProperty=false; m_sourceSystemId = (m_useSourceLocationProperty) ? new StringVector() : null; m_sourceLine = (m_useSourceLocationProperty) ? new IntVector() : null; m_sourceColumn = (m_useSourceLocationProperty) ? new IntVector() : null; // Record initial sizes of fields that are pushed and restored // for RTF tail-pruning. More entries can be popped than pushed, so // we need this to mark the primordial state of the DTM. m_emptyNodeCount = m_size; m_emptyNSDeclSetCount = (m_namespaceDeclSets == null) ? 0 : m_namespaceDeclSets.size(); m_emptyNSDeclSetElemsCount = (m_namespaceDeclSetElements == null) ? 0 : m_namespaceDeclSetElements.size(); m_emptyDataCount = m_data.size(); m_emptyCharsCount = m_chars.size(); m_emptyDataQNCount = m_dataOrQName.size(); }
/** * Store the source location of the current node. This method must be called * as every node is added to the DTM or for no node. */ protected void setSourceLocation() { m_sourceSystemId.addElement(m_locator.getSystemId()); m_sourceLine.addElement(m_locator.getLineNumber()); m_sourceColumn.addElement(m_locator.getColumnNumber()); //%REVIEW% %BUG% Prevent this from arising in the first place // by not allowing the enabling conditions to change after we start // building the document. if (m_sourceSystemId.size() != m_size) { String msg = "CODING ERROR in Source Location: " + m_size + " != " + m_sourceSystemId.size(); System.err.println(msg); throw new RuntimeException(msg); } }
hasMore = tokenizer.hasMoreTokens(); if ((null != usedrefs) && usedrefs.contains(ref)) usedrefs = new StringVector(); usedrefs.addElement(ref);
/** * Get count of functions defined in this extension element * * * @return count of functions defined in this extension element */ public int getFunctionCount() { return (null != m_functions) ? m_functions.size() : 0; }
/** * Get whether or not the passed prefix is contained flagged by * the "exclude-result-prefixes" property. * @see <a href="http://www.w3.org/TR/xslt#literal-result-element">literal-result-element in XSLT Specification</a> * * @param prefix non-null reference to prefix that might be excluded. * @param uri reference to namespace that prefix maps to * * @return true if the prefix should normally be excluded.> */ public boolean containsExcludeResultPrefix(String prefix, String uri) { if (null == m_ExcludeResultPrefixs || uri == null ) return false; // This loop is ok here because this code only runs during // stylesheet compile time. for (int i =0; i< m_ExcludeResultPrefixs.size(); i++) { if (uri.equals(getNamespaceForPrefix(m_ExcludeResultPrefixs.elementAt(i)))) return true; } return false; /* if (prefix.length() == 0) prefix = Constants.ATTRVAL_DEFAULT_PREFIX; return m_ExcludeResultPrefixs.contains(prefix); */ }
public SAX2RTFDTM(DTMManager mgr, Source source, int dtmIdentity, DTMWSFilter whiteSpaceFilter, XMLStringFactory xstringfactory, boolean doIndexing) { super(mgr, source, dtmIdentity, whiteSpaceFilter, xstringfactory, doIndexing); // NEVER track source locators for RTFs; they aren't meaningful. I think. // (If we did track them, we'd need to tail-prune these too.) //org.apache.xalan.processor.TransformerFactoryImpl.m_source_location; m_useSourceLocationProperty=false; m_sourceSystemId = (m_useSourceLocationProperty) ? new StringVector() : null; m_sourceLine = (m_useSourceLocationProperty) ? new IntVector() : null; m_sourceColumn = (m_useSourceLocationProperty) ? new IntVector() : null; // Record initial sizes of fields that are pushed and restored // for RTF tail-pruning. More entries can be popped than pushed, so // we need this to mark the primordial state of the DTM. m_emptyNodeCount = m_size; m_emptyNSDeclSetCount = (m_namespaceDeclSets == null) ? 0 : m_namespaceDeclSets.size(); m_emptyNSDeclSetElemsCount = (m_namespaceDeclSetElements == null) ? 0 : m_namespaceDeclSetElements.size(); m_emptyDataCount = m_data.size(); m_emptyCharsCount = m_chars.size(); m_emptyDataQNCount = m_dataOrQName.size(); }
/** * Process an attribute string of type T_STRINGLIST into * a vector of XPath match patterns. * * @param handler non-null reference to current StylesheetHandler that is constructing the Templates. * @param uri The Namespace URI, or an empty string. * @param name The local name (without prefix), or empty string if not namespace processing. * @param rawName The qualified name (with prefix). * @param value a whitespace delimited list of string values. * * @return A StringVector of the tokenized strings. */ StringVector processSTRINGLIST(StylesheetHandler handler, String uri, String name, String rawName, String value) { StringTokenizer tokenizer = new StringTokenizer(value, " \t\n\r\f"); int nStrings = tokenizer.countTokens(); StringVector strings = new StringVector(nStrings); for (int i = 0; i < nStrings; i++) { strings.addElement(tokenizer.nextToken()); } return strings; }
/** * Store the source location of the current node. This method must be called * as every node is added to the DTM or for no node. */ protected void setSourceLocation() { m_sourceSystemId.addElement(m_locator.getSystemId()); m_sourceLine.addElement(m_locator.getLineNumber()); m_sourceColumn.addElement(m_locator.getColumnNumber()); //%REVIEW% %BUG% Prevent this from arising in the first place // by not allowing the enabling conditions to change after we start // building the document. if (m_sourceSystemId.size() != m_size) { String msg = "CODING ERROR in Source Location: " + m_size + " != " + m_sourceSystemId.size(); System.err.println(msg); throw new RuntimeException(msg); } }
/** * Find out if this contains a given "extension-element-prefix" property. * @see <a href="http://www.w3.org/TR/xslt#extension-element">extension-element in XSLT Specification</a> * * @param uri URI of extension element to look for * * @return True if the given URI was found in the list */ public boolean containsExtensionElementURI(String uri) { if (null == m_ExtensionElementURIs) return false; return m_ExtensionElementURIs.contains(uri); }
/** * Get a function at a given index in this extension element * * * @param i Index of function to get * * @return Name of Function at given index * * @throws ArrayIndexOutOfBoundsException */ public String getFunction(int i) throws ArrayIndexOutOfBoundsException { if (null == m_functions) throw new ArrayIndexOutOfBoundsException(); return (String) m_functions.elementAt(i); }
/** * Return the count of elements defined for this extension element * * * @return the count of elements defined for this extension element */ public int getElementCount() { return (null != m_elements) ? m_elements.size() : 0; }