/** * Check for circularity: specifically, check that this attribute set does not contain * a direct or indirect reference to the one supplied as a parameter * @param origin the place from which the search started */ public void checkCircularity(XSLAttributeSet origin) throws XPathException { if (this==origin) { compileError("The definition of the attribute set is circular", "XTSE0720"); useAttributeSets = null; } else { if (!validated) { // if this attribute set isn't validated yet, we don't check it. // The circularity will be detected when the last attribute set in the cycle // gets validated return; } if (attributeSetElements != null) { for (Iterator it=attributeSetElements.iterator(); it.hasNext();) { ((XSLAttributeSet)it.next()).checkCircularity(origin); } } } }
/** * Check for circularity: specifically, check that this attribute set does not contain * a direct or indirect reference to the one supplied as a parameter * @param origin the place from which the search started */ public void checkCircularity(XSLAttributeSet origin) throws XPathException { if (this==origin) { compileError("The definition of the attribute set is circular", "XTSE0720"); useAttributeSets = null; } else { if (!validated) { // if this attribute set isn't validated yet, we don't check it. // The circularity will be detected when the last attribute set in the cycle // gets validated return; } if (attributeSetElements != null) { for (Iterator it=attributeSetElements.iterator(); it.hasNext();) { ((XSLAttributeSet)it.next()).checkCircularity(origin); } } } }
public void validate() throws XPathException { if (validated) return; checkTopLevel(null); stackFrameMap = getConfiguration().makeSlotManager(); AxisIterator kids = iterateAxis(Axis.CHILD); while (true) { Item child = kids.next(); if (child == null) { break; } if (!(child instanceof XSLAttribute)) { compileError("Only xsl:attribute is allowed within xsl:attribute-set", "XTSE0010"); } } if (useAtt!=null) { // identify any attribute sets that this one refers to attributeSetElements = new ArrayList(5); useAttributeSets = getAttributeSets(useAtt, attributeSetElements); // check for circularity for (Iterator it=attributeSetElements.iterator(); it.hasNext();) { ((XSLAttributeSet)it.next()).checkCircularity(this); } } validated = true; }
public void validate() throws XPathException { if (validated) return; checkTopLevel(null); stackFrameMap = getConfiguration().makeSlotManager(); AxisIterator kids = iterateAxis(Axis.CHILD); while (true) { Item child = kids.next(); if (child == null) { break; } if (!(child instanceof XSLAttribute)) { compileError("Only xsl:attribute is allowed within xsl:attribute-set", "XTSE0010"); } } if (useAtt!=null) { // identify any attribute sets that this one refers to attributeSetElements = new ArrayList(5); useAttributeSets = getAttributeSets(useAtt, attributeSetElements); // check for circularity for (Iterator it=attributeSetElements.iterator(); it.hasNext();) { ((XSLAttributeSet)it.next()).checkCircularity(this); } } validated = true; }
/** * Check for circularity: specifically, check that this attribute set does not contain * a direct or indirect reference to the one supplied as a parameter * * @param origin the place from which the search started * @throws net.sf.saxon.trans.XPathException * if an error is found */ public void checkCircularity(XSLAttributeSet origin) throws XPathException { if (this == origin) { compileError("The definition of the attribute set is circular", "XTSE0720"); } else { if (!validated) { // if this attribute set isn't validated yet, we don't check it. // The circularity will be detected when the last attribute set in the cycle // gets validated return; } if (attributeSetElements != null) { for (ComponentDeclaration attributeSetElement : attributeSetElements) { XSLAttributeSet element = (XSLAttributeSet) attributeSetElement.getSourceElement(); element.checkCircularity(origin); if (streamable && !element.streamable) { compileError("Attribute-set is declared streamable but references a non-streamable attribute set " + element.getAttributeSetName().getDisplayName(), "XTSE3430"); } } } } }
/** * Check for circularity: specifically, check that this attribute set does not contain * a direct or indirect reference to the one supplied as a parameter * * @param origin the place from which the search started * @throws net.sf.saxon.trans.XPathException * if an error is found */ public void checkCircularity(XSLAttributeSet origin) throws XPathException { if (this == origin) { compileError("The definition of the attribute set is circular", "XTSE0720"); } else { if (!validated) { // if this attribute set isn't validated yet, we don't check it. // The circularity will be detected when the last attribute set in the cycle // gets validated return; } if (attributeSetElements != null) { for (ComponentDeclaration attributeSetElement : attributeSetElements) { XSLAttributeSet element = (XSLAttributeSet) attributeSetElement.getSourceElement(); element.checkCircularity(origin); if (streamable && !element.streamable) { compileError("Attribute-set is declared streamable but references a non-streamable attribute set " + element.getAttributeSetName().getDisplayName(), "XTSE3430"); } } } } }
((XSLAttributeSet) attributeSetElement.getSourceElement()).checkCircularity(this);
((XSLAttributeSet) attributeSetElement.getSourceElement()).checkCircularity(this);