addQueryToNode(xpath, ((NameStep) step2).getLocalName()); valid = true;
private boolean isElementStep( NameStep step, QName elName ) { if ( step.getAxis() != CHILD ) { return false; } // TODO namespace awareness return elName.getLocalPart().equals( step.getLocalName() ); }
private QName getQName( NameStep step ) { String prefix = step.getPrefix(); QName qName; if ( prefix.isEmpty() ) { qName = new QName( step.getLocalName() ); } else { String ns = nsBindings.translateNamespacePrefixToUri( prefix ); qName = new QName( ns, step.getLocalName(), prefix ); } return qName; }
private QName getQName( NameStep step ) { String prefix = step.getPrefix(); QName qName; if ( prefix.isEmpty() ) { qName = new QName( step.getLocalName() ); } else { String ns = nsBindings.translateNamespacePrefixToUri( prefix ); qName = new QName( ns, step.getLocalName(), prefix ); } return qName; }
private boolean isAttrStep( NameStep step, QName attrName ) { if ( step.getAxis() != ATTRIBUTE ) { return false; } // TODO namespace awareness return attrName.getLocalPart().equals( step.getLocalName() ); }
private QName toQName(Step step, PredicatesEvaluatorBuilder evaluatorCompiler) throws SAXPathException { String nsPrefix = ((NameStep) step).getPrefix(); String localPart = ((NameStep) step).getLocalName(); if(nsPrefix != null && !nsPrefix.trim().equals("")) { if(evaluatorCompiler != null) { return new QName(evaluatorCompiler.getNamespace(nsPrefix), localPart, nsPrefix); } else { // Will need to update the namespace later... when we have the // namespace prefix-to-uri mappings... return new QName(null, localPart, nsPrefix); } } else { return new QName(localPart); } }
private QName toQName(Step step, PredicatesEvaluatorBuilder evaluatorCompiler) throws SAXPathException { String nsPrefix = ((NameStep) step).getPrefix(); String localPart = ((NameStep) step).getLocalName(); if(nsPrefix != null && !nsPrefix.trim().equals("")) { if(evaluatorCompiler != null) { return new QName(evaluatorCompiler.getNamespace(nsPrefix), localPart, nsPrefix); } else { // Will need to update the namespace later... when we have the // namespace prefix-to-uri mappings... return new QName(null, localPart, nsPrefix); } } else { return new QName(localPart); } }
private QName toQName(Step step, PredicatesEvaluatorBuilder evaluatorCompiler) throws SAXPathException { String nsPrefix = ((NameStep) step).getPrefix(); String localPart = ((NameStep) step).getLocalName(); if(nsPrefix != null && !nsPrefix.trim().equals("")) { if(evaluatorCompiler != null) { return new QName(evaluatorCompiler.getNamespace(nsPrefix), localPart, nsPrefix); } else { // Will need to update the namespace later... when we have the // namespace prefix-to-uri mappings... return new QName(null, localPart, nsPrefix); } } else { return new QName(localPart); } }
private static void findQName( List<QName> list, Step step, NamespaceBindings nsContext ) { if ( step instanceof NameStep ) { NameStep ns = (NameStep) step; list.add( new QName( nsContext.getNamespaceURI( ns.getPrefix() ), ns.getLocalName() ) ); } }
private QName toQName(Step step, PredicatesEvaluatorBuilder evaluatorCompiler) throws SAXPathException { String nsPrefix = ((NameStep) step).getPrefix(); String localPart = ((NameStep) step).getLocalName(); if(nsPrefix != null && !nsPrefix.trim().equals("")) { if(evaluatorCompiler != null) { return new QName(evaluatorCompiler.getNamespace(nsPrefix), localPart, nsPrefix); } else { // Will need to update the namespace later... when we have the // namespace prefix-to-uri mappings... return new QName(null, localPart, nsPrefix); } } else { return new QName(localPart); } }
private QName toQName(Step step, PredicatesEvaluatorBuilder evaluatorCompiler) throws SAXPathException { String nsPrefix = ((NameStep) step).getPrefix(); String localPart = ((NameStep) step).getLocalName(); if(nsPrefix != null && !nsPrefix.trim().equals("")) { if(evaluatorCompiler != null) { return new QName(evaluatorCompiler.getNamespace(nsPrefix), localPart, nsPrefix); } else { // Will need to update the namespace later... when we have the // namespace prefix-to-uri mappings... return new QName(null, localPart, nsPrefix); } } else { return new QName(localPart); } }
private boolean isChildElementStepWithoutPredicateOrWithNumberPredicate( NameStep step ) { if ( step.getAxis() == CHILD && !step.getLocalName().equals( "*" ) ) { if ( step.getPredicates().isEmpty() ) { return true; } else if ( step.getPredicates().size() == 1 ) { Predicate predicate = (Predicate) step.getPredicates().get( 0 ); Expr expr = predicate.getExpr(); if ( expr instanceof NumberExpr ) { return true; } } } return false; } }
private QName getChildElementStepAsQName( ValueReference ref ) { QName qName = null; Expr xpath = ref.getAsXPath(); if ( xpath instanceof LocationPath ) { LocationPath lpath = (LocationPath) xpath; if ( lpath.getSteps().size() == 1 ) { if ( lpath.getSteps().get( 0 ) instanceof NameStep ) { NameStep step = (NameStep) lpath.getSteps().get( 0 ); if ( isChildElementStepWithoutPredicateOrWithNumberPredicate( step ) ) { String prefix = step.getPrefix(); if ( prefix.isEmpty() ) { qName = new QName( step.getLocalName() ); } else { String ns = ref.getNsContext().translateNamespacePrefixToUri( prefix ); qName = new QName( ns, step.getLocalName(), prefix ); } LOG.debug( "QName: " + qName ); } } } } return qName; }
NameStep step = (NameStep) lpath.getSteps().get( 0 ); if ( step.getAxis() == Axis.CHILD && step.getPredicates().isEmpty() && !step.getLocalName().equals( "*" ) ) { String prefix = step.getPrefix(); if ( prefix.isEmpty() ) { qName = new QName( step.getLocalName() ); } else { String ns = this.bindings.translateNamespacePrefixToUri( prefix ); qName = new QName( ns, step.getLocalName(), prefix );
private Element createRootElement(String xPath) throws JaxenException { BaseXPath baseXPath = new BaseXPath(xPath, new DocumentNavigator()); LocationPath lp = (LocationPath) (baseXPath.getRootExpr()); NameStep nameStep = (NameStep) (lp.getSteps().get(0)); String prefix = nameStep.getPrefix(); Namespace ns = prefix.isEmpty() ? Namespace.NO_NAMESPACE : MCRConstants.getStandardNamespace(prefix); return new Element(nameStep.getLocalName(), ns); }
} else if(step.getAxis() == Axis.ATTRIBUTE && step instanceof NameStep) { String nsPrefix = ((NameStep)step).getPrefix(); String localPart = ((NameStep)step).getLocalName();
} else if(step.getAxis() == Axis.ATTRIBUTE && step instanceof NameStep) { String nsPrefix = ((NameStep)step).getPrefix(); String localPart = ((NameStep)step).getLocalName();
} else if(step.getAxis() == Axis.ATTRIBUTE && step instanceof NameStep) { String nsPrefix = ((NameStep)step).getPrefix(); String localPart = ((NameStep)step).getLocalName();
} else if(step.getAxis() == Axis.ATTRIBUTE && step instanceof NameStep) { String nsPrefix = ((NameStep)step).getPrefix(); String localPart = ((NameStep)step).getLocalName();
} else if(step.getAxis() == Axis.ATTRIBUTE && step instanceof NameStep) { String nsPrefix = ((NameStep)step).getPrefix(); String localPart = ((NameStep)step).getLocalName();