1 / 30

XML

XML. chapter 06 : XSLT (eXtensible Stylesheet Language Transformation). 학습목표. Namespaces 란 ? Namespaces 선언 XSLT 기능 XSLT 엘리먼트 및 사용법. Namespaces. Namespaces ( 네임스페이스 ). Namespaces 란 ? : 동일한 XML 파일 또는 서로 다른 XML 파일 내에서 같은 이름의 element ( 또는 attribute) 가 존재할 때

zayit
Download Presentation

XML

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. XML

  2. chapter 06 : XSLT (eXtensible Stylesheet Language Transformation)

  3. 학습목표 • Namespaces 란? • Namespaces 선언 • XSLT 기능 • XSLT 엘리먼트 및 사용법

  4. Namespaces

  5. Namespaces ( 네임스페이스) • Namespaces 란? • : 동일한 XML 파일 또는 서로 다른 XML 파일 내에서 • 같은 이름의 element ( 또는 attribute)가 존재할 때 • 이름 충돌을 방지하기 위한 이름공간. • Namespaces 목적 • : 이름충돌을 방지하기 위해서 element와 attribute를 • 그룹으로 관리한다.

  6. 눈 JAVA 애플리케이션 ? • Namespaces ( 네임스페이스) • 이름충돌의 예. • : 눈

  7. 실질적 element 이름 선언 URI 값 (실제적인 parser에 의해 해석 안됨. 유일값 권고) Prefix (식별기능) Tag 사용시에는 Prefix 이용 프로토콜명://웹서버명.도메인이름/작성년도/구체적인이름 • Namespaces ( 네임스페이스) • Namespaces 선언 • :실제로 네임스페이스이름 대신에 접두사를 이용한다. QName (Qualified Name)

  8. Namespaces ( 네임스페이스) • 이름충돌의 해결.

  9. XSLT

  10. HTML XSLT XML wml • XSLT • XSLT 란? • : XML문서를 다른 XML구조(html , wml등) 로 변환하는 기술. • XSLT 구성요소 3가지 • : XML 파일 + XSL프로세서 + XSL스타일시트

  11. XSLT Processor XML XML HTML XSL 스타일시트 XSL스타일시트 wml xsl의root xsl의namespace • XSLT Memory 에 Tree 구조로 생성 (DOM 객체 ) • XSL스타일시트 기본구조

  12. XSLT • XSL스타일시트 • 1. Template element • : XML 의 특정 element을 다른 형태로 변환. Output data Match command XSLT template문 • 상위의 노드 부터 실행된다. ( / 가 최초로 실행 )

  13. XSLT • 노드 와 노드셋 : 노드는 tree구조에서 사용되는 용어 XML문서자체를 의미 엘리먼트 노드 텍스트 노드 노드셋

  14. XSLT 브라우저에 msxml 내장 (xsl프로세서)

  15. XSLT • XSL스타일시트 • 2. apply-templates element • : match에서 지정된 element의 내용을 출력. ( = 다른 template 검색)

  16. XSLT • XSL스타일시트 • 3. 여러 elements들의 templates 설정 • : match와 일치하는 노드가 있는 경우에 match 실행. 없는 경우에는 text 노드 실행

  17. XSLT <xsl:apply-templates select=“pet”/>

  18. 요소경로 • XSLT • XSL스타일시트 • 4. value-of element • : element의 내용을 문자로 출력.

  19. XSLT • XSL스타일시트 • 5. template의 name 속성 • : 반복적인 template을 사용하기 위해서 name 으로 선언.

  20. XSLT

  21. Boolean값인 Xpath 표현식 • XSLT • XSL스타일시트 • 6. xsl:if 엘리먼트 • : 조건

  22. XSLT

  23. XSLT • XSL스타일시트 • 7. xsl:choose 엘리먼트 • : 자바의 switch 문과 동일

  24. XSLT

  25. XSLT • XSL스타일시트 • 8. xsl:for-each 엘리먼트 • : 반복처리

  26. XSLT

  27. XSLT 이용한 HTML 생성

  28. Html도 well-formed 문서 • XSLT • XSLT & HTML • : 기본은 html 로 생성된다.

  29. XSLT • XSLT & HTML • : <xsl:output method=“text” /> 사용하여 text로 바꿈.

  30. 공부한 내용 • XSLT

More Related