Skip to content

Commit

Permalink
convert content to md
Browse files Browse the repository at this point in the history
  • Loading branch information
SphinxKnight committed Sep 23, 2022
1 parent 29a63a0 commit 454bab6
Show file tree
Hide file tree
Showing 3 changed files with 64 additions and 70 deletions.
46 changes: 21 additions & 25 deletions files/pt-br/web/xslt/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,35 +7,31 @@ tags:
- XSLT
translation_of: Web/XSLT
---
<div>{{XSLTRef}}</div>
{{XSLTRef}}

<p><strong>Extensible Stylesheet Language Transformations (XSLT)</strong> is an <a href="/pt-BR/docs/Web/XML/XML_introduction">XML</a>-based language used, in conjunction with specialized processing software, for the transformation of XML documents.</p>
**Extensible Stylesheet Language Transformations (XSLT)** is an [XML](/pt-BR/docs/Web/XML/XML_introduction)-based language used, in conjunction with specialized processing software, for the transformation of XML documents.

<p>Although the process is referred to as "transformation," the original document is not changed; rather, a new XML document is created based on the content of an existing document. Then, the new document may be serialized (output) by the processor in standard XML syntax or in another format, such as <a href="/pt-BR/docs/Web/HTML">HTML</a> or plain text.</p>
Although the process is referred to as "transformation," the original document is not changed; rather, a new XML document is created based on the content of an existing document. Then, the new document may be serialized (output) by the processor in standard XML syntax or in another format, such as [HTML](/pt-BR/docs/Web/HTML) or plain text.

<p>XSLT is most often used to convert data between different XML schemas or to convert XML data into web pages or PDF documents.</p>
XSLT is most often used to convert data between different XML schemas or to convert XML data into web pages or PDF documents.

<h2 id="Documentation">Documentation</h2>
## Documentation

<dl>
<dt><a href="/pt-BR/docs/Web/XSLT/Element">XSLT Element Reference</a></dt>
<dd>Reference.</dd>
<dt><a href="/pt-BR/docs/Web/XSLT/Transforming_XML_with_XSLT">Transforming XML with XSLT</a></dt>
<dd>XSLT allows a stylesheet author to transform a primary XML document in two significant ways: manipulating and sorting the content, including a wholesale reordering of it if so desired, and transforming the content into a different format.</dd>
<dt><a href="/pt-BR/docs/Web/XSLT/Using_the_Mozilla_JavaScript_interface_to_XSL_Transformations">Using the Mozilla JavaScript interface to XSL Transformations</a></dt>
<dd>This document describes the JavaScript interface to the XSLT processing engine in Mozilla 1.2 and up.</dd>
<dt><a href="/pt-BR/docs/Web/XSLT/PI_Parameters">Specifying parameters using processing instructions</a></dt>
<dd>Firefox allows stylesheet parameters to be specified when using the <code>&lt;?xml-stylesheet?&gt;</code> processing instruction. This is done using the <code>&lt;?xslt-param?&gt;</code> PI described in this document.</dd>
<dt><a href="https://www.w3schools.com/xml/xsl_intro.asp">XSLT Tutorial</a></dt>
<dd>This <a href="https://www.w3schools.com">W3Schools</a> tutorial teaches the reader how to use XSLT to transform XML documents into other formats, like XHTML.</dd>
<dt><a href="https://www.xml.com/pub/a/2000/08/holman/">What is XSLT?</a></dt>
<dd>This extensive introduction to XSLT and XPath assumes no prior knowledge of the technologies and guides the reader through background, context, structure, concepts and introductory terminology.</dd>
<dt><a href="/pt-BR/docs/Web/XSLT/Common_errors">Common XSLT Errors</a></dt>
<dd>This article lists some common problems using XSLT in Firefox.</dd>
</dl>
- [XSLT Element Reference](/pt-BR/docs/Web/XSLT/Element)
- : Reference.
- [Transforming XML with XSLT](/pt-BR/docs/Web/XSLT/Transforming_XML_with_XSLT)
- : XSLT allows a stylesheet author to transform a primary XML document in two significant ways: manipulating and sorting the content, including a wholesale reordering of it if so desired, and transforming the content into a different format.
- [Using the Mozilla JavaScript interface to XSL Transformations](/pt-BR/docs/Web/XSLT/Using_the_Mozilla_JavaScript_interface_to_XSL_Transformations)
- : This document describes the JavaScript interface to the XSLT processing engine in Mozilla 1.2 and up.
- [Specifying parameters using processing instructions](/pt-BR/docs/Web/XSLT/PI_Parameters)
- : Firefox allows stylesheet parameters to be specified when using the `<?xml-stylesheet?>` processing instruction. This is done using the `<?xslt-param?>` PI described in this document.
- [XSLT Tutorial](https://www.w3schools.com/xml/xsl_intro.asp)
- : This [W3Schools](https://www.w3schools.com) tutorial teaches the reader how to use XSLT to transform XML documents into other formats, like XHTML.
- [What is XSLT?](https://www.xml.com/pub/a/2000/08/holman/)
- : This extensive introduction to XSLT and XPath assumes no prior knowledge of the technologies and guides the reader through background, context, structure, concepts and introductory terminology.
- [Common XSLT Errors](/pt-BR/docs/Web/XSLT/Common_errors)
- : This article lists some common problems using XSLT in Firefox.

<h2 id="Related_Topics">Related Topics</h2>
## Related Topics

<ul>
<li><a href="/pt-BR/docs/Web/XML/XML_introduction">XML</a>, <a href="/pt-BR/docs/Web/XPath">XPath</a></li>
</ul>
- [XML](/pt-BR/docs/Web/XML/XML_introduction), [XPath](/pt-BR/docs/Web/XPath)
Original file line number Diff line number Diff line change
Expand Up @@ -4,30 +4,31 @@ slug: Web/XSLT/XSLT_JS_interface_in_Gecko/Advanced_Example
translation_of: Web/XSLT/XSLT_JS_interface_in_Gecko/Advanced_Example
original_slug: The_XSLT_JavaScript_Interface_in_Gecko/Advanced_Example
---
<h2 id="Advanced_Example" name="Advanced_Example">Exemplo Avançado</h2>
## Exemplo Avançado

<p>O exemplo avançado apresentará vários tipos de divs baseado em seu conteúdo. O exemplo permite tipificar o conteúdo muitas vezes, alternando entre tipos ascendente ou descendente. O JavaScript apenas carrega o arquivo .xsl a primeira vez, e prepara a variável <code>xslloaded</code> verdadeira (true) assim que o arquivo tiver terminado de carregar. Usando o método <code>getParameter</code> no obejto <code>XSLTProcessor</code>, o código pode decidir pelo tipo ascendente ou descendente. Se o parâmetro estiver vazio o padrão é ascendente (primeira vezes que o tipo aparece, como não há valor para isto no aarquivo XSLT). O valor do tipo é colocado usando <code>setParameter</code>.</p>
O exemplo avançado apresentará vários tipos de divs baseado em seu conteúdo. O exemplo permite tipificar o conteúdo muitas vezes, alternando entre tipos ascendente ou descendente. O JavaScript apenas carrega o arquivo .xsl a primeira vez, e prepara a variável `xslloaded` verdadeira (true) assim que o arquivo tiver terminado de carregar. Usando o método `getParameter` no obejto `XSLTProcessor`, o código pode decidir pelo tipo ascendente ou descendente. Se o parâmetro estiver vazio o padrão é ascendente (primeira vezes que o tipo aparece, como não há valor para isto no aarquivo XSLT). O valor do tipo é colocado usando `setParameter`.

<p>The XSLT file has a parameter called <code>myOrder</code> that JavaScript sets to change the sorting method. The <code>xsl:sort</code> element's order attribute can access the value of the parameter using <code>$myOrder</code>. However, the value needs to be an XPATH expression and not a string, so <code>{$myOrder}</code> is used. Using {} evaluates the content as an XPath expression.</p>
The XSLT file has a parameter called `myOrder` that JavaScript sets to change the sorting method. The `xsl:sort` element's order attribute can access the value of the parameter using `$myOrder`. However, the value needs to be an XPATH expression and not a string, so `{$myOrder}` is used. Using {} evaluates the content as an XPath expression.

<p>Once the transformation is complete, the result is appened to the document, as shown in this example.</p>
Once the transformation is complete, the result is appened to the document, as shown in this example.

<p><small><b>Figure 7 : Sorting based on div content<span class="comment">view example</span></b></small></p>
**Figure 7 : Sorting based on div contentview example**

<pre class="brush: js">// XHTML Fragment:
```js
// XHTML Fragment:

&lt;div id="example"&gt;
&lt;div&gt;1&lt;/div&gt;
&lt;div&gt;2&lt;/div&gt;
&lt;div&gt;3&lt;/div&gt;
&lt;div&gt;4&lt;/div&gt;
&lt;div&gt;5&lt;/div&gt;
&lt;div&gt;6&lt;/div&gt;
&lt;div&gt;7&lt;/div&gt;
&lt;div&gt;8&lt;/div&gt;
&lt;div&gt;9&lt;/div&gt;
&lt;div&gt;10&lt;/div&gt;
&lt;/div&gt;
<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

Expand Down Expand Up @@ -81,21 +82,21 @@ function sort() {

// XSL Stylesheet:

&lt;?xml version="1.0" encoding="UTF-8"?&gt;
&lt;xsl:stylesheet version="1.0" xmlns="http://www.w3.org/1999/xhtml" xmlns:html="http://www.w3.org/1999/xhtml" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"&gt;
&lt;xsl:output method="html" indent="yes" /&gt;
<?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" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:output method="html" indent="yes" />

&lt;xsl:param name="myOrder" /&gt;
<xsl:param name="myOrder" />

&lt;xsl:template match="/"&gt;
<xsl:template match="/">

&lt;xsl:apply-templates select="/div//div"&gt;
&lt;xsl:sort select="." data-type="number" order="{$myOrder}" /&gt;
&lt;/xsl:apply-templates&gt;
&lt;/xsl:template&gt;
<xsl:apply-templates select="/div//div">
<xsl:sort select="." data-type="number" order="{$myOrder}" />
</xsl:apply-templates>
</xsl:template>

&lt;xsl:template match="div"&gt;
&lt;xsl:copy-of select="." /&gt;
&lt;/xsl:template&gt;
&lt;/xsl:stylesheet&gt;
</pre>
<xsl:template match="div">
<xsl:copy-of select="." />
</xsl:template>
</xsl:stylesheet>
```
23 changes: 10 additions & 13 deletions files/pt-br/web/xslt/xslt_js_interface_in_gecko/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,17 +9,14 @@ tags:
translation_of: Web/XSLT/XSLT_JS_interface_in_Gecko
original_slug: The_XSLT_JavaScript_Interface_in_Gecko
---
<ol>
<li><a href="/en-US/docs/The_XSLT//JavaScript_Interface_in_Gecko/Introduction" title="en/The_XSLT//JavaScript_Interface_in_Gecko/Introduction">Introduction</a></li>
<li><a href="/en-US/docs/The_XSLT//JavaScript_Interface_in_Gecko/JavaScript//XSLT_Bindings" title="en/The_XSLT//JavaScript_Interface_in_Gecko/JavaScript//XSLT_Bindings">JavaScript/XSLT Bindings</a></li>
<li><a href="/en-US/docs/The_XSLT//JavaScript_Interface_in_Gecko/Basic_Example" title="en/The_XSLT//JavaScript_Interface_in_Gecko/Basic_Example">Basic Example</a></li>
<li><a href="/en-US/docs/The_XSLT//JavaScript_Interface_in_Gecko/Setting_Parameters" title="en/The_XSLT//JavaScript_Interface_in_Gecko/Setting_Parameters">Setting Parameters</a></li>
<li><a href="/en-US/docs/The_XSLT//JavaScript_Interface_in_Gecko/Advanced_Example" title="en/The_XSLT//JavaScript_Interface_in_Gecko/Advanced_Example">Advanced Example</a></li>
<li><a href="/en-US/docs/The_XSLT//JavaScript_Interface_in_Gecko/Interface_List" title="en/The_XSLT//JavaScript_Interface_in_Gecko/Interface_List">Interface List</a></li>
<li><a href="/en-US/docs/The_XSLT//JavaScript_Interface_in_Gecko/Resources" title="en/The_XSLT//JavaScript_Interface_in_Gecko/Resources">Resources</a></li>
</ol>
1. [Introduction](/pt-BR/docs/The_XSLT//JavaScript_Interface_in_Gecko/Introduction "en/The_XSLT//JavaScript_Interface_in_Gecko/Introduction")
2. [JavaScript/XSLT Bindings](/pt-BR/docs/The_XSLT//JavaScript_Interface_in_Gecko/JavaScript//XSLT_Bindings "en/The_XSLT//JavaScript_Interface_in_Gecko/JavaScript//XSLT_Bindings")
3. [Basic Example](/pt-BR/docs/The_XSLT//JavaScript_Interface_in_Gecko/Basic_Example "en/The_XSLT//JavaScript_Interface_in_Gecko/Basic_Example")
4. [Setting Parameters](/pt-BR/docs/The_XSLT//JavaScript_Interface_in_Gecko/Setting_Parameters "en/The_XSLT//JavaScript_Interface_in_Gecko/Setting_Parameters")
5. [Advanced Example](/pt-BR/docs/The_XSLT//JavaScript_Interface_in_Gecko/Advanced_Example "en/The_XSLT//JavaScript_Interface_in_Gecko/Advanced_Example")
6. [Interface List](/pt-BR/docs/The_XSLT//JavaScript_Interface_in_Gecko/Interface_List "en/The_XSLT//JavaScript_Interface_in_Gecko/Interface_List")
7. [Resources](/pt-BR/docs/The_XSLT//JavaScript_Interface_in_Gecko/Resources "en/The_XSLT//JavaScript_Interface_in_Gecko/Resources")

<h2 id="See_also">See also</h2>
<ul>
<li><a href="/en-US/docs/Using_the_Mozilla_JavaScript_interface_to_XSL_Transformations">Using the Mozilla JavaScript interface to XSL Transformations</a></li>
</ul>
## See also

- [Using the Mozilla JavaScript interface to XSL Transformations](/pt-BR/docs/Using_the_Mozilla_JavaScript_interface_to_XSL_Transformations)

0 comments on commit 454bab6

Please sign in to comment.