코딩공부/php

xml parsing ( xml attribute 읽어 오기 )

dev__pixui 2015. 4. 3. 18:06

xml attribute


<main>

<circle name = "가">  // 노드 뒤에  attribute = "" 으로 작성

<type>1</type>

<x> 235</x>

<y>332</y>

</circle>

<circle name = "나">

<type>1</type>

<x> 235</x>

<y>332</y>

</circle>

<circle name = "다">

<type>1</type>

<x> 235</x>

<y>332</y>

</circle>

</main>


trace( xml.circle[1].@name)


attribute 불러 오는 방법


xml.노드명[순번].@Attribute명



CDATA


CDATA 안에 <> 꺽쇠 괄호가 들어 있어도 xml 꺾쇠로 인정하지 않음


사용방법


<![CATA[.............]]>   ... 있는 부분에 데이터 작성