/** * Set the "xml:space" attribute. * A text node is preserved if an ancestor element of the text node * has an xml:space attribute with a value of preserve, and * no closer ancestor element has xml:space with a value of default. * @see <a href="http://www.w3.org/TR/xslt#strip">strip in XSLT Specification</a> * @see <a href="http://www.w3.org/TR/xslt#section-Creating-Text">section-Creating-Text in XSLT Specification</a> * * @param avt Enumerated value, either Constants.ATTRVAL_PRESERVE * or Constants.ATTRVAL_STRIP. */ public void setXmlSpace(AVT avt) { // This function is a bit-o-hack, I guess... addLiteralResultAttribute(avt); String val = avt.getSimpleString(); if(val.equals("default")) { super.setXmlSpace(Constants.ATTRVAL_STRIP); } else if(val.equals("preserve")) { super.setXmlSpace(Constants.ATTRVAL_PRESERVE); } // else maybe it's a real AVT, so we can't resolve it at this time. }
/** * This function is called after everything else has been * recomposed, and allows the template to set remaining * values that may be based on some other property that * depends on recomposition. */ public void compose(StylesheetRoot sroot) throws TransformerException { super.compose(sroot); m_extns = this.getNamespace(); m_decl = getElemExtensionDecl(sroot, m_extns); // Register the extension namespace if the extension does not have // an ElemExtensionDecl ("component"). if (m_decl == null) sroot.getExtensionNamespacesManager().registerExtension(m_extns); }
/** * Tell if the result namespace decl should be excluded. Should be called before * namespace aliasing (I think). * * @param prefix Prefix of namespace to check * @param uri URI of namespace to check * * @return True if the given namespace should be excluded * * @throws TransformerException */ private boolean excludeResultNSDecl(String prefix, String uri) throws TransformerException { if (null != m_excludeResultPrefixes) { return containsExcludeResultPrefix(prefix, uri); } return false; }
rhandler.startPrefixMapping(getPrefix(), getNamespace()); executeNSDecls(transformer); rhandler.startElement(getNamespace(), getLocalName(), getRawName()); rhandler.endElement(getNamespace(), getLocalName(), getRawName()); throw tException; unexecuteNSDecls(transformer); rhandler.endPrefixMapping(getPrefix());
isExtension = parentElem.containsExtensionElementURI(uri); ((ElemLiteralResult) elem).setNamespace(uri); ((ElemLiteralResult) elem).setLocalName(localName); ((ElemLiteralResult) elem).setRawName(rawName); ((ElemLiteralResult) elem).setIsLiteralResultAsStylesheet( isLREAsStyleSheet); ((ElemLiteralResult) elem).containsExtensionElementURI(uri); ((ElemLiteralResult) elem).setNamespace(uri); ((ElemLiteralResult) elem).setLocalName(localName); ((ElemLiteralResult) elem).setRawName(rawName); setPropertiesFromAttributes(handler, rawName, attributes, elem);
rhandler.startPrefixMapping(getPrefix(), getNamespace()); rhandler.startElement(getNamespace(), getLocalName(), getRawName()); rhandler.endElement(getNamespace(), getLocalName(), getRawName()); rhandler.endPrefixMapping(getPrefix());
/** * Return the raw value of the attribute. * * @param namespaceURI:localName or localName if the namespaceURI is null of * the attribute to get * * @return The Attr value as a string, or the empty string if that attribute * does not have a specified or default value */ public String getAttribute(String rawName) { AVT avt = getLiteralResultAttribute(rawName); if ((null != avt)) { return avt.getSimpleString(); } return EMPTYSTRING; }
/** * Return the raw value of the attribute. * * @param namespaceURI Namespace URI of attribute node to get * @param localName Local part of qualified name of attribute node to get * * @return The Attr value as a string, or the empty string if that attribute * does not have a specified or default value */ public String getAttributeNS(String namespaceURI, String localName) { AVT avt = getLiteralResultAttributeNS(namespaceURI, localName); if ((null != avt)) { return avt.getSimpleString(); } return EMPTYSTRING; }
/** * Receive notification of the end of an element. * * @param handler non-null reference to current StylesheetHandler that is constructing the Templates. * @param uri The Namespace URI, or an empty string. * @param localName The local name (without prefix), or empty string if not namespace processing. * @param rawName The qualified name (with prefix). */ public void endElement( StylesheetHandler handler, String uri, String localName, String rawName) throws org.xml.sax.SAXException { ElemTemplateElement elem = handler.getElemTemplateElement(); if (elem instanceof ElemLiteralResult) { if (((ElemLiteralResult) elem).getIsLiteralResultAsStylesheet()) { handler.popStylesheet(); } } super.endElement(handler, uri, localName, rawName); }
XSLMessages.createMessage( XSLTErrorResources.ER_EXTENSION_ELEMENT_NOT_ALLOWED_IN_SECURE_PROCESSING, new Object[] {getRawName()})); XSLTErrorResources.ER_CALL_TO_EXT_FAILED, new Object[]{getNodeName()})); transformer.getErrorListener().fatalError(te); nsh.processElement(this.getLocalName(), this, transformer, getStylesheet(), this);
/** * This function is called after everything else has been * recomposed, and allows the template to set remaining * values that may be based on some other property that * depends on recomposition. */ public void compose(StylesheetRoot sroot) throws TransformerException { super.compose(sroot); m_extns = this.getNamespace(); m_decl = getElemExtensionDecl(sroot, m_extns); // Register the extension namespace if the extension does not have // an ElemExtensionDecl ("component"). if (m_decl == null) sroot.getExtensionNamespacesManager().registerExtension(m_extns); }
rhandler.startPrefixMapping(getPrefix(), getNamespace()); executeNSDecls(transformer); rhandler.startElement(getNamespace(), getLocalName(), getRawName()); rhandler.endElement(getNamespace(), getLocalName(), getRawName()); throw tException; unexecuteNSDecls(transformer); rhandler.endPrefixMapping(getPrefix());
isExtension = parentElem.containsExtensionElementURI(uri); ((ElemLiteralResult) elem).setNamespace(uri); ((ElemLiteralResult) elem).setLocalName(localName); ((ElemLiteralResult) elem).setRawName(rawName); ((ElemLiteralResult) elem).setIsLiteralResultAsStylesheet( isLREAsStyleSheet); ((ElemLiteralResult) elem).containsExtensionElementURI(uri); ((ElemLiteralResult) elem).setNamespace(uri); ((ElemLiteralResult) elem).setLocalName(localName); ((ElemLiteralResult) elem).setRawName(rawName); setPropertiesFromAttributes(handler, rawName, attributes, elem);
rhandler.startPrefixMapping(getPrefix(), getNamespace()); rhandler.startElement(getNamespace(), getLocalName(), getRawName()); rhandler.endElement(getNamespace(), getLocalName(), getRawName()); rhandler.endPrefixMapping(getPrefix());
/** * Return the raw value of the attribute. * * @param namespaceURI:localName or localName if the namespaceURI is null of * the attribute to get * * @return The Attr value as a string, or the empty string if that attribute * does not have a specified or default value */ public String getAttribute(String rawName) { AVT avt = getLiteralResultAttribute(rawName); if ((null != avt)) { return avt.getSimpleString(); } return EMPTYSTRING; }
/** * Return the raw value of the attribute. * * @param namespaceURI Namespace URI of attribute node to get * @param localName Local part of qualified name of attribute node to get * * @return The Attr value as a string, or the empty string if that attribute * does not have a specified or default value */ public String getAttributeNS(String namespaceURI, String localName) { AVT avt = getLiteralResultAttributeNS(namespaceURI, localName); if ((null != avt)) { return avt.getSimpleString(); } return EMPTYSTRING; }
/** * Receive notification of the end of an element. * * @param handler non-null reference to current StylesheetHandler that is constructing the Templates. * @param uri The Namespace URI, or an empty string. * @param localName The local name (without prefix), or empty string if not namespace processing. * @param rawName The qualified name (with prefix). */ public void endElement( StylesheetHandler handler, String uri, String localName, String rawName) throws org.xml.sax.SAXException { ElemTemplateElement elem = handler.getElemTemplateElement(); if (elem instanceof ElemLiteralResult) { if (((ElemLiteralResult) elem).getIsLiteralResultAsStylesheet()) { handler.popStylesheet(); } } super.endElement(handler, uri, localName, rawName); }
XSLMessages.createMessage( XSLTErrorResources.ER_EXTENSION_ELEMENT_NOT_ALLOWED_IN_SECURE_PROCESSING, new Object[] {getRawName()})); XSLTErrorResources.ER_CALL_TO_EXT_FAILED, new Object[]{getNodeName()})); transformer.getErrorListener().fatalError(te); nsh.processElement(this.getLocalName(), this, transformer, getStylesheet(), this);
/** * This function is called after everything else has been * recomposed, and allows the template to set remaining * values that may be based on some other property that * depends on recomposition. */ public void compose(StylesheetRoot sroot) throws TransformerException { super.compose(sroot); m_extns = this.getNamespace(); m_decl = getElemExtensionDecl(sroot, m_extns); // Register the extension namespace if the extension does not have // an ElemExtensionDecl ("component"). if (m_decl == null) sroot.getExtensionNamespacesManager().registerExtension(m_extns); }
rhandler.startPrefixMapping(getPrefix(), getNamespace()); executeNSDecls(transformer); rhandler.startElement(getNamespace(), getLocalName(), getRawName()); rhandler.endElement(getNamespace(), getLocalName(), getRawName()); throw tException; unexecuteNSDecls(transformer); rhandler.endPrefixMapping(getPrefix());