XML & XPath
----
이름 소스 코딩 시간
조현태 OurMajorLangIsCAndCPlusPlus/XML/조현태 ?
김상섭허준수 OurMajorLangIsCAndCPlusPlus/XML/김상섭허준수 많이..ㅡㅜ

----
반드시 C로 작성할 것! (확장자 .c 사용)

테스트 1

XML 입력
~cpp
<zeropage>
   <studies>
      <cpp>
         이상규
         <participants>
            <name>김상섭</name>
            <name>김민경</name>
            <name>송수생</name>
            <name>조현태</name>
         </participants>
      </cpp>
      <java>
         이선호
         <participants>
            <name>김민경</name>
            <name>송수생</name>
            <name>조현태</name>
         </participants>
      </java>
      <mfc>
         <participants/>
      </mfc>
   </studies>
</zeropage>

쿼리 - zeropage//name
~cpp
<name>김상섭</name>
<name>김민경</name>
<name>송수생</name>
<name>조현태</name>
<name>김민경</name>
<name>송수생</name>
<name>조현태</name>

쿼리 - zeropage/studies/java/participants
~cpp
<participants>
   <name>김민경</name>
   <name>송수생</name>
   <name>조현태</name>
</participants>

쿼리 - zeropage//mfc/participants
~cpp
<participants/>

테스트 2

XML 입력
~cpp
<a>
   <b>
      <c>1</c>
   </b>
   <x>
      <b>
         <c>2</c>
      </b>
   </x>
   <y>
      <b>
         <c>3</c>
      </b>
   </y>
</a>

쿼리 - a/b/c
~cpp
<c>1</c>

쿼리 - a//b/c
~cpp
<c>1</c>
<c>2</c>
<c>3</c>

테스트 3

XML 입력
~cpp
<a>
   <b>
      <c>1</c>
      <x>
         <b>
            <c>2</c>
            <y>
               <b>
                  <c>3</c>
               </b>
            </y>
         </b>
      </x>
   </b>
</a>

쿼리 - a/b/c
~cpp
<c>1</c>

쿼리 - a//b//c
~cpp
<c>1</c>
<c>2</c>
<c>3</c>
<c>2</c>
<c>3</c>
<c>3</c>
----
OurMajorLangIsCAndCPlusPlus
Retrieved from http://wiki.zeropage.org/wiki.php/OurMajorLangIsCAndCPlusPlus/XML
last modified 2021-02-07 05:23:57