/** * This will execute the following XSLT instructions * from the snapshot point, after the stylesheet execution * context has been reset from the snapshot point. * * @param ts The snapshot of where to start execution * * @throws TransformerException * @deprecated This is an internal tooling API that nobody seems to be using */ public void executeFromSnapshot(TransformSnapshot ts) throws TransformerException { ElemTemplateElement template = getMatchedTemplate(); int child = getMatchedNode(); pushElemTemplateElement(template); //needed?? m_xcontext.pushCurrentNode(child); //needed?? this.executeChildTemplates(template, true); // getResultTreeHandler()); }
/** * Execute the xsl:apply-imports transformation. * * @param transformer non-null reference to the the current transform-time state. * * @throws TransformerException */ public void execute( TransformerImpl transformer) throws TransformerException { if (transformer.currentTemplateRuleIsNull()) { transformer.getMsgMgr().error(this, XSLTErrorResources.ER_NO_APPLY_IMPORT_IN_FOR_EACH); //"xsl:apply-imports not allowed in a xsl:for-each"); } int sourceNode = transformer.getXPathContext().getCurrentNode(); if (DTM.NULL != sourceNode) { // supply the current templated (matched, not named) ElemTemplate matchTemplate = transformer.getMatchedTemplate(); transformer.applyTemplateToNode(this, matchTemplate, sourceNode); } else // if(null == sourceNode) { transformer.getMsgMgr().error(this, XSLTErrorResources.ER_NULL_SOURCENODE_APPLYIMPORTS); //"sourceNode is null in xsl:apply-imports!"); } }
/** * Create a result ContentHandler from a Result object, based * on the current OutputProperties. * * @param outputTarget Where the transform result should go, * should not be null. * * @return A valid ContentHandler that will create the * result tree when it is fed SAX events. * * @throws TransformerException */ public SerializationHandler createSerializationHandler(Result outputTarget) throws TransformerException { SerializationHandler xoh = createSerializationHandler(outputTarget, getOutputFormat()); return xoh; }
/** * Process the source node to the output result, if the * processor supports the "http://xml.org/trax/features/dom/input" * feature. * %REVIEW% Do we need a Node version of this? * @param node The input source node, which can be any valid DTM node. * @param outputTarget The output source target. * * @throws TransformerException */ public void transformNode(int node, Result outputTarget) throws TransformerException { SerializationHandler xoh = createSerializationHandler(outputTarget); this.setSerializationHandler(xoh); m_outputTarget = outputTarget; transformNode(node); }
/** * Process the source tree to the output result. * @param xmlSource The input for the source tree. * @param outputTarget The output source target. * @param shouldRelease Flag indicating whether to release DTMManager. * * @throws TransformerException */ public void transform(Source xmlSource, Result outputTarget, boolean shouldRelease) throws TransformerException { synchronized (m_reentryGuard) { SerializationHandler xoh = createSerializationHandler(outputTarget); this.setSerializationHandler(xoh); m_outputTarget = outputTarget; transform(xmlSource, shouldRelease); } }
if (null != transformer.getOutputPropertyNoDefault(OutputKeys.METHOD)) return; Properties prevProperties = transformer.getOutputFormat().getProperties(); transformer.setContentHandler(ch);
if (transformer.currentTemplateRuleIsNull()) transformer.getMsgMgr().error(this, if (transformer.getDebug()) transformer.getTraceManager().fireTraceEvent(this); int sourceNode = transformer.getXPathContext().getCurrentNode(); if (DTM.NULL != sourceNode) ElemTemplate matchTemplate = transformer.getMatchedTemplate(); transformer.applyTemplateToNode(this, matchTemplate, sourceNode); transformer.getMsgMgr().error(this, if (transformer.getDebug()) transformer.getTraceManager().fireTraceEndEvent(this);
setExtensionsTable(getStylesheet()); XPathContext xctxt = getXPathContext(); DTM dtm = xctxt.getDTM(node); pushGlobalVars(node); StylesheetRoot stylesheet = this.getStylesheet(); int n = stylesheet.getGlobalImportCount(); try this.applyTemplateToNode(null, null, node); this.reset();
clearParameters(); setParameter(s1, null, params.getProperty(name)); else setParameter(s2, s1, params.getProperty(name));
throws TransformerException XPathContext xctxt = transformer.getXPathContext(); transformer.getStackGuard().checkForInfinateLoop(); if (transformer.getDebug()) transformer.getTraceManager().fireTraceEvent(this); transformer.executeChildTemplates(this, true); if (transformer.getDebug()) transformer.getTraceManager().fireTraceEndEvent(this);
if (transformer.getDebug()) transformer.getTraceManager().fireTraceEvent(this); String data = transformer.transformToString(this); transformer.getMsgMgr().message(this, data, m_terminate); transformer.getErrorListener().fatalError(new TransformerException(XSLMessages.createMessage(XSLTErrorResources.ER_STYLESHEET_DIRECTED_TERMINATION, null))); //"Stylesheet directed termination")); if (transformer.getDebug()) transformer.getTraceManager().fireTraceEndEvent(this);
XPathContext xctxt = transformer.getXPathContext(); int sourceNode = xctxt.getCurrentNode(); transformer.getMsgMgr().warn( this, XSLTErrorResources.WG_PROCESSINGINSTRUCTION_NAME_CANT_BE_XML, new Object[]{ Constants.ATTRNAME_NAME, piName }); transformer.getMsgMgr().warn( this, XSLTErrorResources.WG_PROCESSINGINSTRUCTION_NOTVALID_NCNAME, new Object[]{ Constants.ATTRNAME_NAME, piName }); String data = transformer.transformToString(this); transformer.getResultTreeHandler().processingInstruction(piName, data);
pushMode(mode); xctxt.pushCurrentNode(xctxt.getDTMHandleFromNode(context)); executeChildTemplates(elem, handler); popMode();
public Object extFunction(String ns, String funcName, Vector argVec, Object methodKey) throws javax.xml.transform.TransformerException {//System.out.println("TransImpl.extFunction() " + ns + " " + funcName +" " + getExtensionsTable()); return getExtensionsTable().extFunction(ns, funcName, argVec, methodKey, getXPathContext().getExpressionContext()); }
/** * Conditionally execute a sub-template. * The expression is evaluated and the resulting object is converted * to a boolean as if by a call to the boolean function. If the result * is true, then the content template is instantiated; otherwise, nothing * is created. * * @param transformer non-null reference to the the current transform-time state. * * @throws TransformerException */ public void execute(TransformerImpl transformer) throws TransformerException { XPathContext xctxt = transformer.getXPathContext(); int sourceNode = xctxt.getCurrentNode(); if (m_test.bool(xctxt, sourceNode, this)) { transformer.executeChildTemplates(this, true); } }
XPathContext xctxt = transformer.getXPathContext(); int sourceNode = xctxt.getCurrentNode(); transformer.executeChildTemplates(when, true); transformer.executeChildTemplates(childElem, true); transformer.getMsgMgr().error( this, XSLTErrorResources.ER_CHOOSE_REQUIRES_WHEN);
/** * Send a message to diagnostics. * The xsl:message instruction sends a message in a way that * is dependent on the XSLT transformer. The content of the xsl:message * instruction is a template. The xsl:message is instantiated by * instantiating the content to create an XML fragment. This XML * fragment is the content of the message. * * @param transformer non-null reference to the the current transform-time state. * * @throws TransformerException */ public void execute( TransformerImpl transformer) throws TransformerException { String data = transformer.transformToString(this); transformer.getMsgMgr().message(this, data, m_terminate); if(m_terminate) transformer.getErrorListener().fatalError(new TransformerException(XSLMessages.createMessage(XSLTErrorResources.ER_STYLESHEET_DIRECTED_TERMINATION, null))); //"Stylesheet directed termination")); } }
XPathContext xctxt = transformer.getXPathContext(); String langValue = m_lang_avt.evaluate(xctxt, contextNode, this); transformer.getMsgMgr().warn(this, null, xctxt.getDTM(contextNode).getNode(contextNode), XSLTErrorResources.WG_LOCALE_NOT_FOUND, new Object[]{ langValue }); //"Warning: Could not find locale for xml:lang="+langValue);
/** * Create a new transformation context for this Templates object. * * @return A Transformer instance, never null. */ public Transformer newTransformer() { return new TransformerImpl(this); }
/** * Set the content event handler. * * @param handler The new content handler. * @throws java.lang.NullPointerException If the handler * is null. * @see org.xml.sax.XMLReader#setContentHandler */ public void setContentHandler (ContentHandler handler) { m_transformer.setContentHandler(handler); // super.setContentHandler(m_transformer.getResultTreeHandler()); }