private void processShadowAttributes(NodeName elemName, Location location, URI baseUri) throws XPathException { AttributeCollection atts = startTag.getAllAttributes(); for (int a=0; a<atts.getLength(); a++) { String local = atts.getLocalName(a); String uri = atts.getURI(a); if (local.startsWith("_") && (uri.isEmpty() || uri.equals(NamespaceConstant.SAXON)) && local.length() >= 2) { String value = atts.getValue(a); AttributeLocation attLocation = new AttributeLocation(elemName.getStructuredQName(), atts.getNodeName(a).getStructuredQName(), location); String newValue = processShadowAttribute(value, baseUri.toString(), attLocation); String plainName = local.substring(1); NodeName newName = uri.isEmpty() ? new NoNamespaceName(plainName) : new FingerprintedQName(atts.getPrefix(a), NamespaceConstant.SAXON, plainName); // if a corresponding attribute exists with no underscore, overwrite it. The attribute() // method ensures that the shadow attribute won't be passed down the pipeline. // Otherwise overwrite the shadow attribute itself. int index = atts.getIndex("", plainName); if (index == -1) { index = a; } ((AttributeCollectionImpl)atts).setAttribute( index, newName, BuiltInAtomicType.UNTYPED_ATOMIC, newValue, atts.getLocation(a), 0); } } }
private void processShadowAttributes(NodeName elemName, Location location, URI baseUri) throws XPathException { AttributeCollection atts = startTag.getAllAttributes(); for (int a=0; a<atts.getLength(); a++) { String local = atts.getLocalName(a); if (local.startsWith("_") && atts.getURI(a).equals("") && local.length() >= 2) { String value = atts.getValue(a); AttributeLocation attLocation = new AttributeLocation(elemName.getStructuredQName(), atts.getNodeName(a).getStructuredQName(), location); String newValue = processShadowAttribute(value, baseUri.toString(), attLocation); String plainName = local.substring(1); NodeName newName = new NoNamespaceName(plainName); // if a corresponding attribute exists with no underscore, overwrite it. The attribute() // method ensures that the shadow attribute won't be passed down the pipeline. // Otherwise overwrite the shadow attribute itself. int index = atts.getIndex("", plainName); if (index == -1) { index = a; } ((AttributeCollectionImpl)atts).setAttribute( index, newName, BuiltInAtomicType.UNTYPED_ATOMIC, newValue, atts.getLocation(a), 0); } } }
AttributeCollection allAtts = startTag.getAllAttributes(); NodeName attName = allAtts.getNodeName(allAtts.getIndex(stdAttUri, "use-when")); AttributeLocation attLoc = new AttributeLocation(elemName.getStructuredQName(), attName.getStructuredQName(), location); throw new XPathException("xsl:use-package cannot appear in an imported stylesheet", "XTSE3008"); AttributeCollection atts = startTag.getAllAttributes(); String name = atts.getValue("", "name"); String pversion = atts.getValue("", "package-version");
AttributeCollection allAtts = startTag.getAllAttributes(); NodeName attName = allAtts.getNodeName(allAtts.getIndex(stdAttUri, "use-when")); AttributeLocation attLoc = new AttributeLocation(elemName.getStructuredQName(), attName.getStructuredQName(), location); throw new XPathException("xsl:use-package cannot appear in an imported stylesheet", "XTSE3008"); AttributeCollection atts = startTag.getAllAttributes(); String name = atts.getValue("", "name"); String pversion = atts.getValue("", "package-version");