Search completed in 1.23 seconds.
9 results for "transformToFragment":
Using the Mozilla JavaScript interface to XSL Transformations - XSLT: Extensible Stylesheet Language Transformations
WebXSLTUsing the Mozilla JavaScript interface to XSL Transformations
transforming the document you can use the xsltprocessor.transformtodocument() or xsltprocessor.transformtofragment() methods to transform a document using the imported xslt stylesheet.
...t() takes one argument, the source node to transform, and returns a new document with the results of the transformation: var newdocument = processor.transformtodocument(domtobetransformed); the resultant object depends on the output method of the stylesheet: html - htmldocument xml - xmldocument text - xmldocument with a single root element <transformiix:result> with the text as a child transformtofragment you can also use xsltprocessor.transformtofragment() which will return a documentfragment node.
... xsltprocessor.transformtofragment() takes two arguments: the source document to be transformed (as above) and the document object that will own the fragment (all fragments must be owned by a document).
...And 2 more matches
JavaScript/XSLT Bindings - XSLT: Extensible Stylesheet Language Transformations
WebXSLTXSLT JS interface in GeckoJavaScript XSLT Bindings
via xslt - true makes it do a deep clone var mynode = document.getelementbyid("example"); var clonednode = xmlref.importnode(mynode, true); // add the cloned dom into the xml document xmlref.appendchild(clonednode); once the stylesheet has been imported, xsltprocessor has to perform two methods for the actual transformation, namely xsltprocessor.transformtodocument() and xsltprocessor.transformtofragment().
... xsltprocessor.transformtodocument() returns a full xml document while xsltprocessor.transformtofragment() returns a document fragment that can be easily added to an existing document.
...xsltprocessor.transformtofragment() requires a second parameter, namely the document object that will own the generated fragment.
... var parser = new domparser(); var doc = parser.parsefromstring(astr, "text/xml"); figure 3 : performing the transformation var fragment = xsltprocessor.transformtofragment(xmlref, document); ...
nsIXSLTProcessor
MozillaTechXPCOMReferenceInterfacensIXSLTProcessor
ers(); 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 nsixsltprocessor.
...transformtofragment() transforms the node source applying the stylesheet imported by importstylesheet().
...nsidomdocumentfragment transformtofragment( in nsidomnode source, in nsidomdocument output ); parameters source the node to be transformed.
Connecting to Remote Content - Archive of obsolete content
ArchiveAdd-onsOverlay ExtensionsXUL SchoolConnecting to Remote Content
ment; 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 to the xslt processor xsltprocessor.importstylesheet(xsldocument); finally, you can either use nsixsltprocessor.transformtodocument() or nsixsltprocessor.transformtofragment() methods to transform the xml document.
... the nsixsltprocessor.transformtodocument() method returns a dom document with the results of the transformation, whereas, the nsixsltprocessor.transformtofragment() method returns a dom documentfragment node.
Migrate apps from Internet Explorer to Mozilla - Archive of obsolete content
ArchiveMozillaMigrate apps from Internet Explorer to Mozilla
xsltprocessor can generate a standalone document using transformtodocument(), or it can create a document fragment using transformtofragment(), which you can easily append into another dom document.
... documentfragment transformtofragment(node source, document owner) transforms the node source by applying the stylesheet imported using the importstylesheet method and generates a documentfragment.
Basic Example - XSLT: Extensible Stylesheet Language Transformations
WebXSLTXSLT JS interface in GeckoBasic Example
the .xsl file is then imported (xsltprocessor.importstylesheet(xslstylesheet)) and the transformation run (xsltprocessor.transformtofragment(xmldoc, document)).
...et", "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").innerhtml = ""; mydom = fragment; document.getelementbyid("example").appendchild(fragment); } ...
XSL Transformations in Mozilla FAQ - Web APIs
WebAPIXSLTProcessorXSL Transformations in Mozilla FAQ
there is transformtodocument and transformtofragment starting with mozilla 1.2 final, see using the mozilla javascript interface to xsl transformations.
XSLTProcessor - Web APIs
WebAPIXSLTProcessor
[throws] documentfragment xsltprocessor.transformtofragment(node source, document owner) transforms the node source by applying the stylesheet imported using the xsltprocessor.importstylesheet() function.
Advanced Example - XSLT: Extensible Stylesheet Language Transformations
WebXSLTXSLT JS interface in GeckoAdvanced Example
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 = ""; mydom = fragment; // add the new content from the transformation document.getelementbyid("example").appendchild(fragment) } // xsl stylesheet: <?xml version="1.0" encoding="utf-8"?> <xsl:stylesheet version="1.0" xmlns="http://www.w3.org/1999/xhtml" xmlns:html="http://www.w3.org/1999/xhtml" xm...