XSLdocument ¹®¼­ ÃÖ»óÀ§ ¼öÁØÀÇ ³ëµå(node) ÂüÁ¶¸¦ ¹ÝȯÇÑ´Ù.

Àμö
: (¼Ó¼º °³Ã¼)
¼Ó¼º°ªÀº ½ºÅ¸ÀϽ¬Æ®(style sheet) ¹®¼­ÀÇ ÃÖ»óÀ§(root) ³ëµå(node)¸¦ ÂüÁ¶ÇÏ´Â °³Ã¼ÀÌ´Ù.

ÀÌ ¼Ó¼ºÀº ÀбâÀü¿ëÀÌ¸ç µðÆúÆ®°ªÀº ¾ø´Ù.

Ư±â

XSL style sheetÀÇ DOM(Document Object Model)¿¡ Á¢¼ÓÇÏ·Á¸é XSLDocumentÀ» »ç¿ëÇÏ¸é µÈ´Ù.

Àû¿ë
°³Ã¼scriptHTML±Ô°ÝIE
Âü°í
XMLDocument

Äڵ常

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>