컴퓨터 공부/XML

[5월 19일 1교시] XSLT elements 1

려리군 2009. 5. 19. 14:56

참고 주소 : http://www.w3schools.com/xsl/xsl_w3celementref.asp


<xsl:element>

출력(output)에 새로운 xml element 생성

속성

name = "element name"

namespace = "uri-참조"


<xsl:attribute>

element 내부에 attribute 추가

예시) 

XSLT : <name><xsl:attribute name="id">11</xsl:attribute>James</name>

output : <name id="11">James</name>


<xsl:attribute-set>

attribute 그룹을 정의

정의된 그룹은 <xsl:element>의 use-attribute-sets 속성을 이용하여 호출할 수 있다.


<xsl:if><xsl:choose>

조건문 처리

둘 다 test속성을 이용해 논리 표현식이 참이 경우 내용에 대해 해석한다.


<xsl:for-each>

구문 : <xsl:for-each select="(XPath)">

표현식은 test처럼

해당하는 노드에 대하여 반복적으로 탬플릿을 적용하는 효과


<xsl:copy-of>

구문 : <xsl:copy-of select="(XPath)"/>

해당 부분의 subtree 자체를 복사


<xsl:copy>

구문 : <xsl:copy use-attibute-sets = "">


<xsl:sort>

결과를 특정 순서로 정렬

<xsl:for-each>나 <xsl:apply-template>의 자식 노드로만 사용된다.

속성

select : 정렬할 대상

data-type

order : 오름차순/내림차순