XPath

1 개요[ | ]

XML Path Language; XPath
XML 경로 언어; X패스
  • XML의 노드를 선택하는 쿼리 언어
  • XML 문서 요소들에 대한 경로를 표현 가능

2 예시[ | ]

<?xml version="1.0" encoding="utf-8"?>
<wikimedia>
  <projects>
    <project name="Wikipedia" launch="2001-01-05">
      <editions>
        <edition language="English">en.wikipedia.org</edition>
        <edition language="German">de.wikipedia.org</edition>
        <edition language="French">fr.wikipedia.org</edition>
        <edition language="Polish">pl.wikipedia.org</edition>
      </editions>
    </project>
    <project name="Wiktionary" launch="2002-12-12">
      <editions>
        <edition language="English">en.wiktionary.org</edition>
        <edition language="French">fr.wiktionary.org</edition>
        <edition language="Vietnamese">vi.wiktionary.org</edition>
        <edition language="Turkish">tr.wiktionary.org</edition>
      </editions>
    </project>
  </projects>
</wikimedia>
  • /wikimedia/projects/project/@name
→ project 요소들의 name 속성들
→ 즉 { Wikipedia, Wiktionary }
  • /wikimedia/projects/project/editions/edition[@language="English"]/text()
→ English언어 edition 요소의 문자열
→ 즉 { en.wikipedia.org, en.wikitionary.org }

3 같이 보기[ | ]

4 참고[ | ]

문서 댓글 ({{ doc_comments.length }})
{{ comment.name }} {{ comment.created | snstime }}