addStringComponent(components, avt, last, len); break; } else if (i8 >= 0 && (i0 < 0 || i8 < i0)) { // found a "}" throw err; addStringComponent(components, avt, last, i8 + 1); last = i8 + 2; } else if (i1 >= 0 && i1 == i0) { // found a doubled "{{" addStringComponent(components, avt, last, i1 + 1); last = i1 + 2; } else if (i0 >= 0) { // found a single "{" if (i0 > last) { addStringComponent(components, avt, last, i0); && isIntegerOrIntegerPair(exp)) { env.issueWarning("Found {" + showIntegers(exp) + "} in regex attribute: perhaps {{" + showIntegers(exp) + "}} was intended? (The attribute is an AVT, so curly braces should be doubled)", exp.getLocation()); components.add(makeFirstItem(exp, env)); } else { components.add(XSLLeafNodeConstructor.makeSimpleContentConstructor(
/** * Make an attribute value template in the context of this stylesheet element * @param expression the source text of the attribute value template * @return a compiled XPath expression that computes the value of the attribute (including * concatenating the results of embedded expressions with any surrounding fixed text) */ protected Expression makeAttributeValueTemplate(String expression) throws XPathException { try { return AttributeValueTemplate.make(expression, getLineNumber(), staticContext); } catch (XPathException err) { compileError(err); return new StringLiteral(expression); } }
addStringComponent(components, avt, last, len); break; } else if (i8 >= 0 && (i0 < 0 || i8 < i0)) { // found a "}" throw err; addStringComponent(components, avt, last, i8 + 1); last = i8 + 2; } else if (i1 >= 0 && i1 == i0) { // found a doubled "{{" addStringComponent(components, avt, last, i1 + 1); last = i1 + 2; } else if (i0 >= 0) { // found a single "{" if (i0 > last) { addStringComponent(components, avt, last, i0); components.add(makeFirstItem(exp, env)); } else { components.add(visitor.simplify(
addStringComponent(components, avt, last, len); break; } else if (i8 >= 0 && (i0 < 0 || i8 < i0)) { // found a "}" throw err; addStringComponent(components, avt, last, i8 + 1); last = i8 + 2; } else if (i1 >= 0 && i1 == i0) { // found a doubled "{{" addStringComponent(components, avt, last, i1 + 1); last = i1 + 2; } else if (i0 >= 0) { // found a single "{" if (i0 > last) { addStringComponent(components, avt, last, i0); components.add(makeFirstItem(exp, env)); } else { components.add(visitor.simplify(
addStringComponent(components, avt, last, len); break; } else if (i8 >= 0 && (i0 < 0 || i8 < i0)) { // found a "}" throw err; addStringComponent(components, avt, last, i8 + 1); last = i8 + 2; } else if (i1 >= 0 && i1 == i0) { // found a doubled "{{" addStringComponent(components, avt, last, i1 + 1); last = i1 + 2; } else if (i0 >= 0) { // found a single "{" if (i0 > last) { addStringComponent(components, avt, last, i0); && isIntegerOrIntegerPair(exp)) { env.issueWarning("Found {" + showIntegers(exp) + "} in regex attribute: perhaps {{" + showIntegers(exp) + "}} was intended? (The attribute is an AVT, so curly braces should be doubled)", exp.getLocation()); components.add(makeFirstItem(exp, env)); } else { components.add(XSLLeafNodeConstructor.makeSimpleContentConstructor(
addStringComponent(components, avt, last, len); break; } else if (i8 >= 0 && (i0 < 0 || i8 < i0)) { // found a "}" throw err; addStringComponent(components, avt, last, i8 + 1); last = i8 + 2; } else if (i1 >= 0 && i1 == i0) { // found a doubled "{{" addStringComponent(components, avt, last, i1 + 1); last = i1 + 2; } else if (i0 >= 0) { // found a single "{" if (i0 > last) { addStringComponent(components, avt, last, i0); components.add(makeFirstItem(exp, env)); } else { components.add(visitor.simplify(
/** * Make an attribute value template in the context of this stylesheet element * @param expression the source text of the attribute value template * @return a compiled XPath expression that computes the value of the attribute (including * concatenating the results of embedded expressions with any surrounding fixed text) */ protected Expression makeAttributeValueTemplate(String expression) throws XPathException { try { return AttributeValueTemplate.make(expression, getLineNumber(), staticContext); } catch (XPathException err) { compileError(err); return new StringLiteral(expression); } }
private String processShadowAttribute(String expression, String baseUri, AttributeLocation loc) throws XPathException { UseWhenStaticContext staticContext = new UseWhenStaticContext(compilation, startTag); staticContext.setBaseURI(baseUri); staticContext.setContainingLocation(loc); setNamespaceBindings(staticContext); Expression expr = AttributeValueTemplate.make(expression, staticContext); expr = typeCheck(expr, staticContext); SlotManager stackFrameMap = allocateSlots(expression, expr); XPathContext dynamicContext = makeDynamicContext(staticContext); ((XPathContextMajor) dynamicContext).openStackFrame(stackFrameMap); return expr.evaluateAsString(dynamicContext).toString(); }
private String processShadowAttribute(String expression, String baseUri, AttributeLocation loc) throws XPathException { UseWhenStaticContext staticContext = new UseWhenStaticContext(compilation, startTag); staticContext.setBaseURI(baseUri); staticContext.setContainingLocation(loc); setNamespaceBindings(staticContext); Expression expr = AttributeValueTemplate.make(expression, staticContext); expr = typeCheck(expr, staticContext); SlotManager stackFrameMap = allocateSlots(expression, expr); XPathContext dynamicContext = makeDynamicContext(staticContext); ((XPathContextMajor) dynamicContext).openStackFrame(stackFrameMap); return expr.evaluateAsString(dynamicContext).toString(); }
public void validate() throws XPathException { contentExp = AttributeValueTemplate.make(getStringValue(), getStaticContext()); contentExp = new ValueOf(contentExp, false, true); contentExp.setRetainedStaticContext(((StyleElement)getParent()).makeRetainedStaticContext()); contentExp = ((StyleElement)getParent()).typeCheck("tvt", contentExp); } }
public void validate() throws XPathException { contentExp = AttributeValueTemplate.make(getStringValue(), getStaticContext()); contentExp = new ValueOf(contentExp, false, true); contentExp.setRetainedStaticContext(((StyleElement)getParent()).makeRetainedStaticContext()); contentExp = ((StyleElement)getParent()).typeCheck("tvt", contentExp); } }
/** * Make an attribute value template in the context of this stylesheet element * * @param expression the source text of the attribute value template * @return a compiled XPath expression that computes the value of the attribute (including * concatenating the results of embedded expressions with any surrounding fixed text) */ protected Expression makeAttributeValueTemplate(String expression, int attIndex) { StaticContext env = attIndex == -1 ? staticContext : getStaticContext(getAttributeList().getNodeName(attIndex).getStructuredQName()); if (attIndex >= 0) { StructuredQName attName = getAttributeList().getNodeName(attIndex).getStructuredQName(); env = getStaticContext(attName); } try { return AttributeValueTemplate.make(expression, env); } catch (XPathException err) { compileError(err); return new StringLiteral(expression); } }
/** * Make an attribute value template in the context of this stylesheet element * * @param expression the source text of the attribute value template * @return a compiled XPath expression that computes the value of the attribute (including * concatenating the results of embedded expressions with any surrounding fixed text) */ protected Expression makeAttributeValueTemplate(String expression, int attIndex) { StaticContext env = attIndex == -1 ? staticContext : getStaticContext(getAttributeList().getNodeName(attIndex).getStructuredQName()); if (attIndex >= 0) { StructuredQName attName = getAttributeList().getNodeName(attIndex).getStructuredQName(); env = getStaticContext(attName); } try { return AttributeValueTemplate.make(expression, env); } catch (XPathException err) { compileError(err); return new StringLiteral(expression); } }
Expression expr = AttributeValueTemplate.make(avt, dummyContext);