Search completed in 1.35 seconds.
XSLTProcessor - Web APIs
an
xsltprocessor applies an xslt stylesheet transformation to an xml document to produce a new xml document as output.
... new
xsltprocessor() methods [throws] void
xsltprocessor.importstylesheet(node stylesheet) imports the xslt stylesheet.
... [throws] documentfragment
xsltprocessor.transformtofragment(node source, document owner) transforms the node source by applying the stylesheet imported using the
xsltprocessor.importstylesheet() function.
...And 11 more matches
nsIXSLTProcessor
content/xslt/public/nsi
xsltprocessor.idlscriptable xslt processor inherits from: nsisupports last changed in gecko 1.7 implemented by: @mozilla.org/document-transformer;1?type=xslt.
... to create an instance, use: var
xsltprocessor = components.classes["@mozilla.org/document-transformer;1?type=xslt"] .createinstance(components.interfaces.nsi
xsltprocessor); method overview void clearparameters(); nsivariant getparameter(in domstring namespaceuri, in domstring localname); void importstylesheet(in nsidomnode style); void removeparameter(in domstring namespaceuri, in domstring localname); void reset(); void setparameter(in domstring namespaceuri, in domstring localname, in nsivariant value); nsidomdocument transformtodocument(in nsidomnode source); nsidomdocumentfragment transformtofragment(in nsidomnode source, in nsidomdocument output); methods clearparameters() removes all set parameters from this nsi
xsltprocessor.
...importstylesheet() imports the specified stylesheet into this
xsltprocessor for transformations.
...And 2 more matches
Using the Mozilla JavaScript interface to XSL Transformations - XSLT: Extensible Stylesheet Language Transformations
creating an
xsltprocessor to start, you need to create an
xsltprocessor object: var processor = new
xsltprocessor(); specifying the stylesheet before you can use it, you must import a stylesheet with the
xsltprocessor.importstylesheet() method.
... var testtransform = document.implementation.createdocument("", "test", null); // just an example to get a transform into a script as a dom // xmldocument.load is asynchronous, so all processing happens in the // onload handler testtransform.addeventlistener("load", onload, false); testtransform.load("test-transform.xml"); function onload() { processor.importstylesheet(testtransform); }
xsltprocessor.importstylesheet() requires one argument, a dom node.
... transforming the document you can use the
xsltprocessor.transformtodocument() or
xsltprocessor.transformtofragment() methods to transform a document using the imported xslt stylesheet.
...And 9 more matches
JavaScript/XSLT Bindings - XSLT: Extensible Stylesheet Language Transformations
javascript/xslt bindings javascript can run xslt transformations through the
xsltprocessor object.
... once instantiated, an
xsltprocessor has an
xsltprocessor.importstylesheet() method that takes as an argument the xslt stylesheet to be used in the transformation.
... the stylesheet has to be passed in as an xml document, which means that the .xsl file has to be loaded by the page before calling
xsltprocessor.importstylesheet().
...And 5 more matches
Index - XSLT: Extensible Stylesheet Language Transformations
using the
xsltprocessor.getparameter() method, the code can figure whether to sort in ascending or descending order.
...the sorting value is set using
xsltprocessor.setparameter().
... 8 interface list needscontent, reference see
xsltprocessor in the web api documentation section.
...And 3 more matches
Connecting to Remote Content - Archive of obsolete content
let domparser = components.classes["@mozilla.org/xmlextras/domparser;1"] .createinstance(components.interfaces.nsidomparser); let filestream = components.classes["@mozilla.org/network/file-input-stream;1"] .createinstance(components.interfaces.nsifileinputstream); let
xsltprocessor = components.classes["@mozilla.org/document-transformer;1?type=xslt"] .createinstance(components.interfaces.nsi
xsltprocessor); let xsldocument; filestream.init(somexslfile, -1, 0x01, 0444); // read only // parse from the xslt stylesheet file stream xsldocument = domparser.parsefromstream( filestream, null, filestream.available(), "text/xml"); // import the xslt stylesheet t...
...o the xslt processor
xsltprocessor.importstylesheet(xsldocument); finally, you can either use nsi
xsltprocessor.transformtodocument() or nsi
xsltprocessor.transformtofragment() methods to transform the xml document.
... the nsi
xsltprocessor.transformtodocument() method returns a dom document with the results of the transformation, whereas, the nsi
xsltprocessor.transformtofragment() method returns a dom documentfragment node.
... request.onload = function(aevent) { let responsexml = aevent.target.responsexml; let xulnode; // transform the xml document to a xul document xuldocument =
xsltprocessor.transformtodocument(responsexml); // append the xul node to a xul element xulnode = document.adoptnode(xuldocument.firstchild); document.getelementbyid("foo").appendchild(xulnode); }; we effectively transformed the xml file into xul and integrated it into the ui.
Advanced Example - XSLT: Extensible Stylesheet Language Transformations
using the
xsltprocessor.getparameter() method, the code can figure whether to sort in ascending or descending order.
...the sorting value is set using
xsltprocessor.setparameter().
... figure 7: sorting based on div contentview example // xhtml fragment: <div id="example"> <div>1</div> <div>2</div> <div>3</div> <div>4</div> <div>5</div> <div>6</div> <div>7</div> <div>8</div> <div>9</div> <div>10</div> </div> // javascript var xslref; var xslloaded = false; var
xsltprocessor = new
xsltprocessor(); var mydom; var xmlref = document.implementation.createdocument("", "", null); function sort() { if (!xslloaded){ p = new xmlhttprequest(); p.open("get", "example2.xsl", false); p.send(null); xslref = p.responsexml;
xsltprocessor.importstylesheet(xslref); xslloaded = true; } // create a new xml document in memory xmlref = document.implemen...
... // importnode is used to clone the nodes we want to process via xslt - true makes it do a deep clone var mynode = document.getelementbyid("example"); var clonednode = xmlref.importnode(mynode, true); // after cloning, we append xmlref.appendchild(clonednode); // set the sorting parameter in the xsl file var sortval =
xsltprocessor.getparameter(null, "myorder"); if (sortval == "" || sortval == "descending")
xsltprocessor.setparameter(null, "myorder", "ascending"); else
xsltprocessor.setparameter(null, "myorder", "descending"); // initiate the transformation var fragment =
xsltprocessor.transformtofragment(xmlref, document); // clear the contents document.getelementbyid("example").innerhtml = ""; my...
Index
1106 nsi
xsltprocessor interfaces, interfaces:scriptable, xpcom, xpcom interface reference, xslt implemented by: @mozilla.org/document-transformer;1?type=xslt.
... to create an instance, use: 1107 nsi
xsltprocessorobsolete use nsi
xsltprocessor instead.
PI Parameters - XSLT: Extensible Stylesheet Language Transformations
this has been possible for a while when using the
xsltprocessor in javascript.
... <?xslt-param name="color" value="blue"?> <?xslt-param name="size" select="2"?> <?xml-stylesheet type="text/xsl" href="style.xsl"?> note that these pis have no effect when transformation is done using the
xsltprocessor object in javascript.
Basic Example - XSLT: Extensible Stylesheet Language Transformations
the .xsl file is then imported (
xsltprocessor.importstylesheet(xslstylesheet)) and the transformation run (
xsltprocessor.transformtofragment(xmldoc, document)).
... figure 6 : example var xslstylesheet; var
xsltprocessor = new
xsltprocessor(); var mydom; var xmldoc; function init(){ // load the xslt file, example1.xsl var myxmlhttprequest = new xmlhttprequest(); myxmlhttprequest.open("get", "example1.xsl", false); myxmlhttprequest.send(null); xslstylesheet = myxmlhttprequest.responsexml;
xsltprocessor.importstylesheet(xslstylesheet); // load the xml file, example1.xml myxmlhttprequest = new xmlhttprequest(); myxmlhttprequest.open("get", "example1.xml", false); myxmlhttprequest.send(null); xmldoc = myxmlhttprequest.responsexml; var fragment =
xsltprocessor.transformtofragment(xmldoc, document); document.getelementbyid("example").i...
Setting Parameters - XSLT: Extensible Stylesheet Language Transformations
xsltprocessor provides three javascript methods to interact with these parameters:
xsltprocessor.setparameter(),
xsltprocessor.getparameter() and
xsltprocessor.removeparameter().
... figure 7 : parameters /* xslt: <xsl:param name="myorder" /> */ // javascript: var sortval =
xsltprocessor.getparameter(null, "myorder"); if (sortval == "" || sortval == "descending")
xsltprocessor.setparameter(null, "myorder", "ascending"); else
xsltprocessor.setparameter(null, "myorder", "descending"); ...
XPCOM Interface Reference
rnsiwindowwatchernsiwindowsregkeynsiwindowsshellservicensiworkernsiworkerfactorynsiworkerglobalscopensiworkermessageeventnsiworkermessageportnsiworkerscopensiwritablepropertybagnsiwritablepropertybag2nsixformsmodelelementnsixformsnsinstanceelementnsixformsnsmodelelementnsixmlhttprequestnsixmlhttprequesteventtargetnsixmlhttprequestuploadnsixpcexceptionnsixpcscriptablensixpconnectnsixsltexceptionnsi
xsltprocessornsi
xsltprocessorobsoletensixulappinfonsixulbrowserwindownsixulbuilderlistenernsixulruntimensixulsortservicensixultemplatebuildernsixultemplatequeryprocessornsixultemplateresultnsixulwindownsixmlrpcclientnsixmlrpcfaultnsizipentrynsizipreadernsizipreadercachensizipwriternsmsgfilterfileattribvaluensmsgfolderflagtypensmsgjunkstatusnsmsgkeynsmsglabelvaluensmsgpriorityvaluensmsgruleactiontypensmsgsearch...
XPCOM Interface Reference by grouping
snode nsisyncmessagesender script nsiscriptableunescapehtml nsiscriptableunicodeconverter nsiscripterror nsiscripterror2 stylesheet nsistylesheetservice url nsiuri nsiurl util nsidomserializer nsidomxpathevaluator nsidomxpathexception nsidomxpathexpression nsidomxpathresult xslt nsixsltexception nsi
xsltprocessor download nsidownload nsidownloadmanager nsidownloadprogresslistener element internal nsiworker nsiworkerglobalscope nsiworkermessageevent nsiworkermessageport nsiworkerscope tree nsitreeboxobject nsitreecolumn nsitreecolumns nsitreecontentview nsitreeselection nsitreeview xform nsixformsmodelelement ...
Index - Web APIs
5279
xsltprocessor api, dom, dom reference, reference, xslt an
xsltprocessor applies an xslt stylesheet transformation to an xml document to produce a new xml document as output.
Web APIs
tsourceschangeeventinit xrpermissiondescriptor xrpermissionstatus xrpose xrreferencespace xrreferencespaceevent xrreferencespaceeventinit xrreferencespacetype xrrenderstate xrrenderstateinit xrrigidtransform xrsession xrsessionevent xrsessioneventinit xrsessioninit xrsessionmode xrspace xrsystem xrtargetraymode xrview xrviewerpose xrviewport xrvisibilitystate xrwebgllayer xrwebgllayerinit
xsltprocessor ...