new TemplateSubPatternAssociation(template, pattern, pstring); boolean isWildCard = association.isWild(); TemplateSubPatternAssociation head = isWildCard ? m_wildCardPatterns
int importLevel = item.getImportLevel(); int docOrder = item.getDocOrderPos(); TemplateSubPatternAssociation insertPoint = head; TemplateSubPatternAssociation next; next = insertPoint.getNext(); if (null == next) break; if (importLevel > next.getImportLevel()) break; else if (importLevel < next.getImportLevel()) insertPoint = next; else if (priority > workPriority) // import precedence is equal else if (priority < workPriority) insertPoint = next; else if (docOrder >= next.getDocOrderPos()) // priorities, import are equal break; else if (importLevel > insertPoint.getImportLevel()) insertBefore = true; else if (importLevel < insertPoint.getImportLevel()) insertBefore = false; else if (priority > workPriority) else if (priority < workPriority) insertBefore = false;
/** * Dump all patterns and elements that match those patterns * */ void dumpAssociationTables() { Enumeration associations = m_patternTable.elements(); while (associations.hasMoreElements()) { TemplateSubPatternAssociation head = (TemplateSubPatternAssociation) associations.nextElement(); while (null != head) { System.out.print("(" + head.getTargetString() + ", " + head.getPattern() + ")"); head = head.getNext(); } System.out.println("\n....."); } TemplateSubPatternAssociation head = m_wildCardPatterns; System.out.print("wild card list: "); while (null != head) { System.out.print("(" + head.getTargetString() + ", " + head.getPattern() + ")"); head = head.getNext(); } System.out.println("\n....."); }
if ( (maxImportLevel > -1) && (head.getImportLevel() > maxImportLevel) ) ElemTemplate template = head.getTemplate(); xctxt.setNamespaceContext(template); && head.matchMode(mode)) while (null != (head = head.getNext()));
ElemTemplate template = head.getTemplate(); xctxt.setNamespaceContext(template); && head.matchMode(mode)) while (null != (head = head.getNext()));
/** * Given a match pattern and template association, return the * score of that match. This score or priority can always be * statically calculated. * * @param matchPat The match pattern to template association. * * @return {@link org.apache.xpath.patterns.NodeTest#SCORE_NODETEST}, * {@link org.apache.xpath.patterns.NodeTest#SCORE_NONE}, * {@link org.apache.xpath.patterns.NodeTest#SCORE_NSWILD}, * {@link org.apache.xpath.patterns.NodeTest#SCORE_QNAME}, or * {@link org.apache.xpath.patterns.NodeTest#SCORE_OTHER}, or * the value defined by the priority attribute of the template. * */ private double getPriorityOrScore(TemplateSubPatternAssociation matchPat) { double priority = matchPat.getTemplate().getPriority(); if (priority == XPath.MATCH_SCORE_NONE) { Expression ex = matchPat.getStepPattern(); if (ex instanceof NodeTest) { return ((NodeTest) ex).getDefaultScore(); } } return priority; }
curPattern = curPattern.getNext(); retValue = curPattern.getTemplate(); else retValue = curPattern.getTemplate();
if ( (maxImportLevel > -1) && (head.getImportLevel() > maxImportLevel) ) ElemTemplate template = head.getTemplate(); xctxt.setNamespaceContext(template); && head.matchMode(mode)) while (null != (head = head.getNext()));
/** * Dump all patterns and elements that match those patterns * */ void dumpAssociationTables() { Enumeration associations = m_patternTable.elements(); while (associations.hasMoreElements()) { TemplateSubPatternAssociation head = (TemplateSubPatternAssociation) associations.nextElement(); while (null != head) { System.out.print("(" + head.getTargetString() + ", " + head.getPattern() + ")"); head = head.getNext(); } System.out.println("\n....."); } TemplateSubPatternAssociation head = m_wildCardPatterns; System.out.print("wild card list: "); while (null != head) { System.out.print("(" + head.getTargetString() + ", " + head.getPattern() + ")"); head = head.getNext(); } System.out.println("\n....."); }
ElemTemplate template = head.getTemplate(); xctxt.setNamespaceContext(template); && head.matchMode(mode)) while (null != (head = head.getNext()));
/** * Given a match pattern and template association, return the * score of that match. This score or priority can always be * statically calculated. * * @param matchPat The match pattern to template association. * * @return {@link org.apache.xpath.patterns.NodeTest#SCORE_NODETEST}, * {@link org.apache.xpath.patterns.NodeTest#SCORE_NONE}, * {@link org.apache.xpath.patterns.NodeTest#SCORE_NSWILD}, * {@link org.apache.xpath.patterns.NodeTest#SCORE_QNAME}, or * {@link org.apache.xpath.patterns.NodeTest#SCORE_OTHER}, or * the value defined by the priority attribute of the template. * */ private double getPriorityOrScore(TemplateSubPatternAssociation matchPat) { double priority = matchPat.getTemplate().getPriority(); if (priority == XPath.MATCH_SCORE_NONE) { Expression ex = matchPat.getStepPattern(); if (ex instanceof NodeTest) { return ((NodeTest) ex).getDefaultScore(); } } return priority; }
curPattern = curPattern.getNext(); retValue = curPattern.getTemplate(); else retValue = curPattern.getTemplate();
int importLevel = item.getImportLevel(); int docOrder = item.getDocOrderPos(); TemplateSubPatternAssociation insertPoint = head; TemplateSubPatternAssociation next; next = insertPoint.getNext(); if (null == next) break; if (importLevel > next.getImportLevel()) break; else if (importLevel < next.getImportLevel()) insertPoint = next; else if (priority > workPriority) // import precedence is equal else if (priority < workPriority) insertPoint = next; else if (docOrder >= next.getDocOrderPos()) // priorities, import are equal break; else if (importLevel > insertPoint.getImportLevel()) insertBefore = true; else if (importLevel < insertPoint.getImportLevel()) insertBefore = false; else if (priority > workPriority) else if (priority < workPriority) insertBefore = false;
if ( (maxImportLevel > -1) && (head.getImportLevel() > maxImportLevel)) if (head.getImportLevel()<= maxImportLevel - endImportLevel) return null; ElemTemplate template = head.getTemplate(); xctxt.setNamespaceContext(template); && head.matchMode(mode)) while (null != (head = head.getNext()));
/** * Dump all patterns and elements that match those patterns * */ void dumpAssociationTables() { Enumeration associations = m_patternTable.elements(); while (associations.hasMoreElements()) { TemplateSubPatternAssociation head = (TemplateSubPatternAssociation) associations.nextElement(); while (null != head) { System.out.print("(" + head.getTargetString() + ", " + head.getPattern() + ")"); head = head.getNext(); } System.out.println("\n....."); } TemplateSubPatternAssociation head = m_wildCardPatterns; System.out.print("wild card list: "); while (null != head) { System.out.print("(" + head.getTargetString() + ", " + head.getPattern() + ")"); head = head.getNext(); } System.out.println("\n....."); }
ElemTemplate template = head.getTemplate(); xctxt.setNamespaceContext(template); && head.matchMode(mode)) while (null != (head = head.getNext()));
/** * Given a match pattern and template association, return the * score of that match. This score or priority can always be * statically calculated. * * @param matchPat The match pattern to template association. * * @return {@link org.apache.xpath.patterns.NodeTest#SCORE_NODETEST}, * {@link org.apache.xpath.patterns.NodeTest#SCORE_NONE}, * {@link org.apache.xpath.patterns.NodeTest#SCORE_NSWILD}, * {@link org.apache.xpath.patterns.NodeTest#SCORE_QNAME}, or * {@link org.apache.xpath.patterns.NodeTest#SCORE_OTHER}, or * the value defined by the priority attribute of the template. * */ private double getPriorityOrScore(TemplateSubPatternAssociation matchPat) { double priority = matchPat.getTemplate().getPriority(); if (priority == XPath.MATCH_SCORE_NONE) { Expression ex = matchPat.getStepPattern(); if (ex instanceof NodeTest) { return ((NodeTest) ex).getDefaultScore(); } } return priority; }
new TemplateSubPatternAssociation(template, pattern, pstring); boolean isWildCard = association.isWild(); TemplateSubPatternAssociation head = isWildCard ? m_wildCardPatterns