XSLdocument ¹®¼ ÃÖ»óÀ§ ¼öÁØÀÇ ³ëµå(node) ÂüÁ¶¸¦ ¹ÝȯÇÑ´Ù.
ÀÌ ¼Ó¼ºÀº ÀбâÀü¿ëÀÌ¸ç µðÆúÆ®°ªÀº ¾ø´Ù.
XSL style sheetÀÇ DOM(Document Object Model)¿¡ Á¢¼ÓÇÏ·Á¸é XSLDocumentÀ» »ç¿ëÇÏ¸é µÈ´Ù.
°³Ã¼ | script | HTML | ±Ô°Ý | IE |
---|
XSLDocument¸¦ »ç¿ëÇÏ¿© XSL DOM¿¡ Á¢¼ÓÇÏ°í sort key¸¦ ³ªÅ¸³»´Â ¾ÖÆ®¸®ºäÆ®¸¦ º¯°æÇÑ´Ù.
<SCRIPT> function sort(key){ //½ºÅ¸ÀϽ¬Æ®¿¡¼ "order-by" ¾ÖÆ®¸®ºäÆ®¸¦ ã´Â´Ù. var str=document.XSLDocument.selectNodes("*/xsl:template[@match='menu']/xsl:apply-templates/@order-by"); for (var i=str.nextNode();i !=null;i=str.nextNode()){ // Á¤·ÄÅ°¸¦ »õ·Î¿î °ªÀ¸·Î º¯°æÇÑ´Ù. i.value=key; } var doc=document.XMLDocument.selectSingleNode('story/menu'); // ¾÷µ¥ÀÌÆ®ÇÒ ¹®¼ÀÇ ÇϺμ¼Æ®¸¦ ã´Â´Ù. menu.innerHTML=doc.transformNode(document.XSLDocument); // ÇϺμ¼Æ®¿¡ ½ºÅ¸ÀÏÀ» Àû¿ëÇÏ°í µð½ºÇ÷¹À̸¦ ¾÷µ¥ÀÌÆ®ÇÑ´Ù. } </SCRIPT>