{"json_modified": "2016-03-28T08:20:59.229768", "uuid": "cc42fe6a-bb60-4c53-bda3-0c60e83f4b49", "title": "Advanced Example", "url": "/en-US/docs/Web/XSLT/XSLT_JS_interface_in_Gecko/Advanced_Example", "tags": ["XSLT"], "translations": [{"uuid": "76372d48-31d7-426b-8d9b-36aedc8a9d66", "title": "Exemple avanc\u00e9", "url": "/fr/docs/L'interface_XSLT_JavaScript_dans_Gecko/Exemple_avanc%C3%A9", "tags": ["Traduction_\u00e0_relire"], "summary": "Dans l'exemple avanc\u00e9, nous allons trier plusieurs div
selon leur contenu. L'exemple permet de trier le contenu plusieurs fois, en alternant entre le tri ascendant et le tri descendant. Le JavaScript ne charge que le fichier .xsl la premi\u00e8re fois, et d\u00e9finit la variable xslloaded
\u00e0 true
une fois que le fichier est fini de charg\u00e9. En utilisant la m\u00e9thode getParameter
sur l'objet XSLTProcessor
, le code peut estimer s'il faut trier de fa\u00e7on ascendante ou descendante. Il trie par d\u00e9faut de mani\u00e8re ascendante si le param\u00e8tre est vide (lors du premier tri, car sa valeur n'est pas d\u00e9finie dans le fichier XSLT). La valeur du tri est d\u00e9finie \u00e0 l'aide de setParameter
.", "localization_tags": [], "locale": "fr", "last_edit": "2016-02-15T03:42:24", "review_tags": []}, {"uuid": "6dda5cbe-5c1a-4dc9-bdfc-aec44f280fc6", "title": "Exemplo Avan\u00e7ado", "url": "/pt-BR/docs/The_XSLT_JavaScript_Interface_in_Gecko/Advanced_Example", "tags": [], "summary": "O exemplo avan\u00e7ado apresentar\u00e1 v\u00e1rios tipos de divs baseado em seu conte\u00fado. O exemplo permite tipificar o conte\u00fado muitas vezes, alternando entre tipos ascendente ou descendente. O JavaScript apenas carrega o arquivo .xsl a primeira vez, e prepara a vari\u00e1vel xslloaded
verdadeira (true) assim que o arquivo tiver terminado de carregar. Usando o m\u00e9todo getParameter
no obejto XSLTProcessor
, o c\u00f3digo pode decidir pelo tipo ascendente ou descendente. Se o par\u00e2metro estiver vazio o padr\u00e3o \u00e9 ascendente (primeira vezes que o tipo aparece, como n\u00e3o h\u00e1 valor para isto no aarquivo XSLT). O valor do tipo \u00e9 colocado usando setParameter
.", "localization_tags": ["inprogress"], "locale": "pt-BR", "last_edit": "2015-01-24T03:02:01", "review_tags": ["editorial"]}], "modified": "2016-02-29T00:49:16", "label": "Advanced Example", "localization_tags": [], "locale": "en-US", "id": 40955, "last_edit": "2016-02-29T00:49:11", "summary": "The advanced example will sort several divs based on their content. The example allows to sort the content multiple times, alternating between ascending and descending sorting. The JavaScript only loads the .xsl file the first time, and sets the xslloaded
variable to true once it has finished loading the file. Using the XSLTProcessor.getParameter()
method, the code can figure wether to sort by ascending or descending. It defaults to ascending if the parameter is empty (first time the sorting happens, as there is no value for it in the XSLT file). The sorting value is set using XSLTProcessor.setParameter()
.", "sections": [{"id": "Advanced_Example", "title": "Advanced Example"}], "slug": "Web/XSLT/XSLT_JS_interface_in_Gecko/Advanced_Example", "review_tags": ["technical"]}