WARNING: This server provides a static reference view of the NetKernel documentation. Links to dynamic content do not work. For the best experience we recommend you install NetKernel and view the documentation in the live system .

Endpoint
Name:SAX
Description:Simple API for XML
Id:org.netkernel.xml.representation.IRepSAX
Category:representation
Interface

SAX is a representation implemented by the Java class/interface org.netkernel.xml.representation.IRepSAX.

Javadoc may be available but not built for this representation. Build here.

Import Requirements

To use SAX representation you must import the module urn:org:netkernel:xml:core:

<import>
  <uri>urn:org:netkernel:xml:core</uri>
</import>

The SAX Representation is a wrapper around the org.xml.sax.XMLReader interface. It also provides a trigger method which will initiate the flow of document events. If SAX filters such as XSLT are set up in a pipeline the trigger propagates back to the head of the pipeline such that the whole pipeline execution is triggered at the tail usually by the SAXToXXX. The start of a SAX pipeline is usually created by the XXXToSAX transreptor which will convert any representation of XML into a SAX representation.

Here is an example of an XSLT pipeline implemented in groovy:

import org.netkernel.xml.representation.*;

context.setCWU(context.getRuntimeSourceIdentifier());

rep=context.source("input.xml",IRepSAX.class);

req=context.createRequest("active:xsltc");
req.addArgument("operator", "test3.xsl");
req.addArgumentByValue("operand", rep);
rep=context.issueRequest(req);

req=context.createRequest("active:xslt");
req.addArgument("operator", "test3.xsl");
req.addArgumentByValue("operand", rep);
rep=context.issueRequest(req);

req=context.createRequest("active:xsltc");
req.addArgument("operator", "test3.xsl");
req.addArgumentByValue("operand", rep);
rep=context.issueRequest(req);

req=context.createRequest("active:xslt");
req.addArgument("operator", "test3.xsl");
req.addArgumentByValue("operand", rep);
rep=context.issueRequest(req);

req=context.createRequest("active:xsltc");
req.addArgument("operator", "test3.xsl");
req.addArgumentByValue("operand", rep);
rep=context.issueRequest(req);

req=context.createRequest("active:xslt");
req.addArgument("operator", "test3.xsl");
req.addArgumentByValue("operand", rep);
rep=context.issueRequest(req);

req=context.createRequest("active:xsltc");
req.addArgument("operator", "test3.xsl");
req.addArgumentByValue("operand", rep);
req.setRepresentationClass(org.w3c.dom.Document.class);
rep=context.issueRequest(req);

resp=context.createResponseFrom(rep);
resp.setMimeType("text/xml");