" </xsl:template>\n" + "</xsl:stylesheet>"; XML second = new XSLDocument( String.format(template, "normal", "comment", "normal", "comment", "normal") ).transform(first);
public void prepareAttributes() throws XPathException { AttributeCollection atts = getAttributeList(); String validationAtt = null; String typeAtt = null; for (int a = 0; a < atts.getLength(); a++) { String f = atts.getQName(a); if (f.equals("validation")) { validationAtt = Whitespace.trim(atts.getValue(a)); } else if (f.equals("type")) { typeAtt = Whitespace.trim(atts.getValue(a)); } else { checkUnknownAttribute(atts.getNodeName(a)); } } if (validationAtt == null) { validationAction = getDefaultValidation(); } else { validationAction = validateValidationAttribute(validationAtt); } if (typeAtt != null) { if (!isSchemaAware()) { compileError("The @type attribute is available only with a schema-aware XSLT processor", "XTSE1660"); } schemaType = getSchemaType(typeAtt); validationAction = Validation.BY_TYPE; } if (typeAtt != null && validationAtt != null) { compileError("The @validation and @type attributes are mutually exclusive", "XTSE1505"); } }
public Expression compile(Executable exec) throws XPathException { DocumentInstr inst = new DocumentInstr(false, null, getBaseURI()); inst.setValidationAction(validationAction); inst.setSchemaType(schemaType); Expression b = compileSequenceConstructor(exec, iterateAxis(Axis.CHILD), true); if (b == null) { b = Literal.makeEmptySequence(); } inst.setContentExpression(b); return inst; }
public void prepareAttributes() throws XPathException { AttributeCollection atts = getAttributeList(); String f = getNamePool().getClarkName(nc); if (f.equals(StandardNames.VALIDATION)) { validationAtt = Whitespace.trim(atts.getValue(a)); typeAtt = Whitespace.trim(atts.getValue(a)); } else { checkUnknownAttribute(nc); validationAction = getContainingStylesheet().getDefaultValidation(); } else { validationAction = Validation.getCode(validationAtt); if (validationAction != Validation.STRIP && !getConfiguration().isSchemaAware(Configuration.XSLT)) { compileError("To perform validation, a schema-aware XSLT processor is needed", "XTSE1660"); compileError("Invalid value of @validation attribute", "XTSE0020"); if (!getConfiguration().isSchemaAware(Configuration.XSLT)) { compileError("The @type attribute is available only with a schema-aware XSLT processor", "XTSE1660"); schemaType = getSchemaType(typeAtt); validationAction = Validation.BY_TYPE; compileError("The @validation and @type attributes are mutually exclusive", "XTSE1505");
public Expression compile(Compilation exec, ComponentDeclaration decl) throws XPathException { DocumentInstr inst = new DocumentInstr(false, null); inst.setValidationAction(validationAction, schemaType); Expression b = compileSequenceConstructor(exec, decl, true); if (b == null) { b = Literal.makeEmptySequence(); } inst.setContentExpression(b); inst.setLocation(allocateLocation()); return inst; }
public void prepareAttributes() throws XPathException { AttributeCollection atts = getAttributeList(); String f = getNamePool().getClarkName(nc); if (f.equals(StandardNames.VALIDATION)) { validationAtt = Whitespace.trim(atts.getValue(a)); typeAtt = Whitespace.trim(atts.getValue(a)); } else { checkUnknownAttribute(nc); validationAction = getContainingStylesheet().getDefaultValidation(); } else { validationAction = Validation.getCode(validationAtt); if (validationAction != Validation.STRIP && !getConfiguration().isSchemaAware(Configuration.XSLT)) { compileError("To perform validation, a schema-aware XSLT processor is needed", "XTSE1660"); compileError("Invalid value of @validation attribute", "XTSE0020"); if (!getConfiguration().isSchemaAware(Configuration.XSLT)) { compileError("The @type attribute is available only with a schema-aware XSLT processor", "XTSE1660"); schemaType = getSchemaType(typeAtt); validationAction = Validation.BY_TYPE; compileError("The @validation and @type attributes are mutually exclusive", "XTSE1505");
public Expression compile(Compilation exec, ComponentDeclaration decl) throws XPathException { DocumentInstr inst = new DocumentInstr(false, null); inst.setValidationAction(validationAction, schemaType); Expression b = compileSequenceConstructor(exec, decl, true); if (b == null) { b = Literal.makeEmptySequence(); } inst.setContentExpression(b); inst.setLocation(allocateLocation()); return inst; }
public void prepareAttributes() throws XPathException { AttributeCollection atts = getAttributeList(); String validationAtt = null; String typeAtt = null; for (int a = 0; a < atts.getLength(); a++) { String f = atts.getQName(a); if (f.equals("validation")) { validationAtt = Whitespace.trim(atts.getValue(a)); } else if (f.equals("type")) { typeAtt = Whitespace.trim(atts.getValue(a)); } else { checkUnknownAttribute(atts.getNodeName(a)); } } if (validationAtt == null) { validationAction = getDefaultValidation(); } else { validationAction = validateValidationAttribute(validationAtt); } if (typeAtt != null) { if (!isSchemaAware()) { compileError("The @type attribute is available only with a schema-aware XSLT processor", "XTSE1660"); } schemaType = getSchemaType(typeAtt); validationAction = Validation.BY_TYPE; } if (typeAtt != null && validationAtt != null) { compileError("The @validation and @type attributes are mutually exclusive", "XTSE1505"); } }
return new XSLDecimalFormat(); case StandardNames.XSL_DOCUMENT: return new XSLDocument(); case StandardNames.XSL_ELEMENT: return new XSLElement();
public Expression compile(Executable exec) throws XPathException { DocumentInstr inst = new DocumentInstr(false, null, getBaseURI()); inst.setValidationMode(validationAction); inst.setSchemaType(schemaType); Expression b = compileSequenceConstructor(exec, iterateAxis(Axis.CHILD), true); if (b == null) { b = Literal.makeEmptySequence(); } inst.setContentExpression(b); return inst; }
return new XSLDecimalFormat(); case StandardNames.XSL_DOCUMENT: return new XSLDocument(); case StandardNames.XSL_ELEMENT: return new XSLElement();
return new XSLDecimalFormat(); case StandardNames.XSL_DOCUMENT: return new XSLDocument(); case StandardNames.XSL_ELEMENT: return new XSLElement();
return new XSLDecimalFormat(); case StandardNames.XSL_DOCUMENT: return new XSLDocument(); case StandardNames.XSL_ELEMENT: return new XSLElement();
return new XSLDecimalFormat(); case StandardNames.XSL_DOCUMENT: return new XSLDocument(); case StandardNames.XSL_ELEMENT: return new XSLElement();