Á¦4Àå. XSLT

½ºÅ¸ÀÏ

½ºÅ¸ÀÏ

XSL ±âº» °³³ä
        

XSLT ±âÃÊ ¿¹Á¦ 1 (¹®¼­ Ãâ·Â)   

XSLT ±âÃÊ ¿¹Á¦ 2 (¹®¼­ º¯È¯)   

XPath

  • ÆÐÅÏÀÇ [Á¶°Ç]À» À§ÇÑ ¿¬»êÀÚ
    ¿¬»êÀÚ ÆÐÅÏ     »ç¿ë ¿¹
    and, or, not [ch1 and ch2],  [ch1 or ch2],  [not ch1] //header[name  or  date],
    //header[not(date)]
    =, != [child = val], [child != val] name[@lang='kr']
    header[name!='È«±æµ¿']
    < <= > >= [child < val], [child <= val], [child > val], [child >= val], order[price < 300,000],
    order[price >= 300,000]
  • º¹ÀâÇÑ ¿¹
    • customer[. = 'microsoft']
    • //order[customer/@id = 216A]
    • /order[@number = '3125']/item/part-number[@warehouse = 'House 11']
  • ¿¹Á¦ ¹®¼­

    <xsl:value-of select="/"/> 
    <xsl:value-of select="."/> 
    <xsl:value-of select="/memo/header"/>
    <xsl:value-of select="./memo/header/date"/> 
    <xsl:value-of select="header/name"/> 

    <xsl:value-of select="memo/body"/>
    <xsl:value-of select="memo/body/*"/> 
    <xsl:value-of select="//header//name"/>
    <xsl:value-of select="//name/@lang"/>
    <xsl:value-of select="//name[@lang='kr']"/>

    <xsl:value-of select="memo/body/p[1]"/> 
    <xsl:value-of select="memo//p[2]"/> 
  • XPath ÇÔ¼ö : ±³Àç ºÎ·Ï B
    • ³ëµå °ü·Ã : text(), position(), last(), count(), name()
    • ¹®ÀÚ¿­ °ü·Ã : concat(), contains(), string(), string-length(), substring()
    • ºÎ¿ï ÇÔ¼ö : boolean(), false(), not(), true()
    • ¼ýÀÚ ÇÔ¼ö : sum(), number(), round(), ceiling(), floor()
    • ¿¹
      • /article/section[position()=2]/title/text()
      • /article/section[2]/title/text(.)
      • /article/section[2]/title/string-length()
      • count(//title)
  • XPathÀÇ Ãà À̸§
    • ¹®¸Æ³ëµå¿ÍÀÇ °ü°è¸¦ Á÷Á¢ ±â¼ú
      ancestor, parent, sibling, preceding-sibling, self, child, descendant, attribute
    • ¿¹: 
      • ÇöÀçÀ§Ä¡°¡ header ÀÏ ¶§
        <xsl:value-of select="
        child::date">
        <xsl:value-of select="
        child::name/attribute::lang">
      • ±³Àç p.149-150