/** * Examine a text node in the stylesheet to see if it is a text value template * * @param node the text node * @throws XPathException if the node is is a text value template with variable content */ private boolean examineTextNode(NodeInfo node) throws XPathException { if (node instanceof TextValueTemplateNode) { ((TextValueTemplateNode) node).validate(); return !(((TextValueTemplateNode) node).getContentExpression() instanceof Literal); } else { return false; } }
/** * Examine a text node in the stylesheet to see if it is a text value template * * @param node the text node * @throws XPathException if the node is is a text value template with variable content */ private boolean examineTextNode(NodeInfo node) throws XPathException { if (node instanceof TextValueTemplateNode) { ((TextValueTemplateNode) node).validate(); return !(((TextValueTemplateNode) node).getContentExpression() instanceof Literal); } else { return false; } }
/** * Compile a content value text node. * * @param node the text node potentially containing the template * @param contents a list to which expressions representing the fixed and variable parts of the content template * will be appended */ public void compileContentValueTemplate(TextImpl node, List<Expression> contents) { if (node instanceof TextValueTemplateNode) { Expression exp = ((TextValueTemplateNode) node).getContentExpression(); if (getConfiguration().getBooleanProperty(Feature.STRICT_STREAMABILITY) && !(exp instanceof Literal)) { exp = new SequenceInstr(exp); } contents.add(exp); } else { contents.add(new StringLiteral(node.getStringValue())); } }
/** * Compile a content value text node. * * @param node the text node potentially containing the template * @param contents a list to which expressions representing the fixed and variable parts of the content template * will be appended */ public void compileContentValueTemplate(TextImpl node, List<Expression> contents) { if (node instanceof TextValueTemplateNode) { Expression exp = ((TextValueTemplateNode) node).getContentExpression(); if (getConfiguration().getBooleanProperty(Feature.STRICT_STREAMABILITY) && !(exp instanceof Literal)) { exp = new SequenceInstr(exp); } contents.add(exp); } else { contents.add(new StringLiteral(node.getStringValue())); } }