public void validate() throws XPathException { if (use!=null) { attributeSets = getAttributeSets(use, null); // find any referenced attribute sets } }
AttributeCollection atts = getAttributeList(); String copyNamespacesAtt = null; String validationAtt = null; String f = getNamePool().getClarkName(nc); if (f.equals(StandardNames.USE_ATTRIBUTE_SETS)) { use = atts.getValue(a); inheritAtt = Whitespace.trim(atts.getValue(a)); } else { checkUnknownAttribute(nc); copyNamespaces = false; } else { compileError("Value of copy-namespaces must be 'yes' or 'no'", "XTSE0020"); compileError("The type and validation attributes must not both be specified", "XTSE1505"); if (validationAction != Validation.STRIP && !getConfiguration().isSchemaAware(Configuration.XSLT)) { compileError("To perform validation, a schema-aware XSLT processor is needed", "XTSE1660"); validationAction = getContainingStylesheet().getDefaultValidation(); schemaType = getSchemaType(typeAtt); if (!getConfiguration().isSchemaAware(Configuration.XSLT)) { compileError("The @type attribute is available only with a schema-aware XSLT processor", "XTSE1660"); inheritNamespaces = false; } else {
public void prepareAttributes() throws XPathException { AttributeCollection atts = getAttributeList(); String copyNamespacesAtt = null; String validationAtt = null; inheritAtt = Whitespace.trim(atts.getValue(a)); } else { checkUnknownAttribute(atts.getNodeName(a)); copyNamespaces = processBooleanAttribute("copy-namespaces", copyNamespacesAtt); compileError("The type and validation attributes must not both be specified", "XTSE1505"); validationAction = validateValidationAttribute(validationAtt); } else { validationAction = getDefaultValidation(); schemaType = getSchemaType(typeAtt); if (!isSchemaAware()) { compileError("The @type attribute is available only with a schema-aware XSLT processor", "XTSE1660"); inheritNamespaces = processBooleanAttribute("inherit-namespaces", inheritAtt); select = makeExpression(selectAtt, getAttributeList().getIndex("", "select")); selectSpecified = true;
public Expression compile(Compilation exec, ComponentDeclaration decl) throws XPathException { select = typeCheck("select", select); try { RoleDiagnostic role = new RoleDiagnostic(RoleDiagnostic.INSTRUCTION, "xsl:copy/select", 0); role.setErrorCode("XTTE3180"); select = getConfiguration().getTypeChecker(false).staticTypeCheck(select, SequenceType.OPTIONAL_ITEM, role, makeExpressionVisitor()); } catch (XPathException err) { compileError(err); Expression content = compileSequenceConstructor(exec, decl, true); content = Block.makeBlock(choice, content); content.setLocation( allocateLocation());
public Expression compile(Executable exec) throws XPathException { Copy inst = new Copy(copyNamespaces, inheritNamespaces, schemaType, validationAction); Expression content = compileSequenceConstructor(exec, iterateAxis(Axis.CHILD), true); if (attributeSets != null) { UseAttributeSets use = new UseAttributeSets(attributeSets); // The use-attribute-sets is ignored unless the context item is an element node. So we // wrap the UseAttributeSets instruction in a conditional to perform a run-time test Expression condition = new InstanceOfExpression( new ContextItemExpression(), SequenceType.makeSequenceType(NodeKindTest.ELEMENT, StaticProperty.EXACTLY_ONE)); Expression choice = Choose.makeConditional(condition, use); if (content == null) { content = choice; } else { content = Block.makeBlock(choice, content); content.setLocationId( allocateLocationId(getSystemId(), getLineNumber())); } } if (content == null) { content = Literal.makeEmptySequence(); } inst.setContentExpression(content); return inst; }
return new XSLComment(); case StandardNames.XSL_COPY: return new XSLCopy(); case StandardNames.XSL_COPY_OF: return new XSLCopyOf();
AttributeCollection atts = getAttributeList(); String copyNamespacesAtt = null; String validationAtt = null; String f = getNamePool().getClarkName(nc); if (f.equals(StandardNames.USE_ATTRIBUTE_SETS)) { use = atts.getValue(a); inheritAtt = Whitespace.trim(atts.getValue(a)); } else { checkUnknownAttribute(nc); copyNamespaces = false; } else { compileError("Value of copy-namespaces must be 'yes' or 'no'", "XTSE0020"); compileError("The type and validation attributes must not both be specified", "XTSE1505"); if (validationAction != Validation.STRIP && !getConfiguration().isSchemaAware(Configuration.XSLT)) { compileError("To perform validation, a schema-aware XSLT processor is needed", "XTSE1660"); validationAction = getContainingStylesheet().getDefaultValidation(); schemaType = getSchemaType(typeAtt); if (!getConfiguration().isSchemaAware(Configuration.XSLT)) { compileError("The @type attribute is available only with a schema-aware XSLT processor", "XTSE1660"); inheritNamespaces = false; } else {
public void prepareAttributes() throws XPathException { AttributeCollection atts = getAttributeList(); String copyNamespacesAtt = null; String validationAtt = null; inheritAtt = Whitespace.trim(atts.getValue(a)); } else { checkUnknownAttribute(atts.getNodeName(a)); copyNamespaces = processBooleanAttribute("copy-namespaces", copyNamespacesAtt); compileError("The type and validation attributes must not both be specified", "XTSE1505"); validationAction = validateValidationAttribute(validationAtt); } else { validationAction = getDefaultValidation(); schemaType = getSchemaType(typeAtt); if (!isSchemaAware()) { compileError("The @type attribute is available only with a schema-aware XSLT processor", "XTSE1660"); inheritNamespaces = processBooleanAttribute("inherit-namespaces", inheritAtt); select = makeExpression(selectAtt, getAttributeList().getIndex("", "select")); selectSpecified = true;
public Expression compile(Compilation exec, ComponentDeclaration decl) throws XPathException { select = typeCheck("select", select); try { RoleDiagnostic role = new RoleDiagnostic(RoleDiagnostic.INSTRUCTION, "xsl:copy/select", 0); role.setErrorCode("XTTE3180"); select = getConfiguration().getTypeChecker(false).staticTypeCheck(select, SequenceType.OPTIONAL_ITEM, role, makeExpressionVisitor()); } catch (XPathException err) { compileError(err); Expression content = compileSequenceConstructor(exec, decl, true); content = Block.makeBlock(choice, content); content.setLocation( allocateLocation());
public Expression compile(Executable exec) throws XPathException { Copy inst = new Copy(copyNamespaces, inheritNamespaces, schemaType, validationAction); Expression content = compileSequenceConstructor(exec, iterateAxis(Axis.CHILD), true); if (attributeSets != null) { UseAttributeSets use = new UseAttributeSets(attributeSets); // The use-attribute-sets is ignored unless the context item is an element node. So we // wrap the UseAttributeSets instruction in a conditional to perform a run-time test Expression condition = new InstanceOfExpression( new ContextItemExpression(), SequenceType.makeSequenceType(NodeKindTest.ELEMENT, StaticProperty.EXACTLY_ONE)); Expression choice = Choose.makeConditional(condition, use); if (content == null) { content = choice; } else { content = Block.makeBlock(choice, content); content.setLocationId( allocateLocationId(getSystemId(), getLineNumber())); } } if (content == null) { content = Literal.makeEmptySequence(); } inst.setContentExpression(content); return inst; }
return new XSLComment(); case StandardNames.XSL_COPY: return new XSLCopy(); case StandardNames.XSL_COPY_OF: return new XSLCopyOf();
AttributeCollection atts = getAttributeList(); String copyNamespacesAtt = null; String validationAtt = null; String f = getNamePool().getClarkName(nc); if (f.equals(StandardNames.USE_ATTRIBUTE_SETS)) { use = atts.getValue(a); inheritAtt = Whitespace.trim(atts.getValue(a)); } else { checkUnknownAttribute(nc); copyNamespaces = false; } else { compileError("Value of copy-namespaces must be 'yes' or 'no'", "XTSE0020"); compileError("The type and validation attributes must not both be specified", "XTSE1505"); if (validationAction != Validation.STRIP && !getConfiguration().isSchemaAware(Configuration.XSLT)) { compileError("To perform validation, a schema-aware XSLT processor is needed", "XTSE1660"); validationAction = getContainingStylesheet().getDefaultValidation(); schemaType = getSchemaType(typeAtt); if (!getConfiguration().isSchemaAware(Configuration.XSLT)) { compileError("The @type attribute is available only with a schema-aware XSLT processor", "XTSE1660"); inheritNamespaces = false; } else {
public Expression compile(Executable exec) throws XPathException { Copy inst = new Copy(copyNamespaces, inheritNamespaces, schemaType, validationAction); Expression content = compileSequenceConstructor(exec, iterateAxis(Axis.CHILD), true); if (attributeSets != null) { UseAttributeSets use = new UseAttributeSets(attributeSets); // The use-attribute-sets is ignored unless the context item is an element node. So we // wrap the UseAttributeSets instruction in a conditional to perform a run-time test Expression condition = new InstanceOfExpression( new ContextItemExpression(), SequenceType.makeSequenceType(NodeKindTest.ELEMENT, StaticProperty.EXACTLY_ONE)); Expression choice = Choose.makeConditional(condition, use); if (content == null) { content = choice; } else { content = Block.makeBlock(choice, content); content.setLocationId( allocateLocationId(getSystemId(), getLineNumber())); } } if (content == null) { content = Literal.makeEmptySequence(); } inst.setContentExpression(content); return inst; }
return new XSLComment(); case StandardNames.XSL_COPY: return new XSLCopy(); case StandardNames.XSL_COPY_OF: return new XSLCopyOf();
public void validate() throws XPathException { if (use!=null) { attributeSets = getAttributeSets(use, null); // find any referenced attribute sets } }
return new XSLComment(); case StandardNames.XSL_COPY: return new XSLCopy(); case StandardNames.XSL_COPY_OF: return new XSLCopyOf();
public void validate() throws XPathException { if (use!=null) { attributeSets = getAttributeSets(use, null); // find any referenced attribute sets } }
return new XSLComment(); case StandardNames.XSL_COPY: return new XSLCopy(); case StandardNames.XSL_COPY_OF: return new XSLCopyOf();