XML with JAVA chapter 07 XML xml xml

  • Slides: 14
Download presentation
XML with JAVA

XML with JAVA

chapter 07 : XML 스키마 Ⅰ

chapter 07 : XML 스키마 Ⅰ

스키마 문서 작성 xml 문서>~. xml <? xml version=“ 1. 0” encoding=“euc-kr”? > <memberlist

스키마 문서 작성 xml 문서>~. xml <? xml version=“ 1. 0” encoding=“euc-kr”? > <memberlist xmlns: xsi=“http: //www. w 3. org/2001/XMLSchemainstance” xsi: no. Namespace. Schema. Location=“c1. xsd”> 회원에 대한 내용이 온다. </memberlist> 요소 선언 1. 단순 데이터를 갖는 요소 <element name=“요소명” min. Occurs=“최소횟수” max. Occurs=“최 대횟수” type=“데이터형”>

스키마 문서 작성 xsd> <element name=“name” min. Occurs=“ 0” max. Occurs=“ 3” type=“xsd: string”/>

스키마 문서 작성 xsd> <element name=“name” min. Occurs=“ 0” max. Occurs=“ 3” type=“xsd: string”/> xml> <name>오정원</name> <name>이나라</name> 숫자형 데이터 타입 : type=“xsd: int” 요소를 무한대로 나열 : max. Occurs=“unbounded”

스키마 문서 작성 xsd> <xsd: element name=“member”> <xsd: complex. Type> <xsd: sequence> <xsd: element

스키마 문서 작성 xsd> <xsd: element name=“member”> <xsd: complex. Type> <xsd: sequence> <xsd: element name=“hobby” min. Occurs=“ 0” max. Occurs=“unbounded” type=“xsd: string”/> </xsd: sequence> </xsd: complex. Type> </xsd: element>

스키마 문서 작성 xml> <member> <hobby>바둑</hobby> <hobby>축구</hobby> </member> 예제참조(ch 07_1. xsd, ch 07_1. xml)

스키마 문서 작성 xml> <member> <hobby>바둑</hobby> <hobby>축구</hobby> </member> 예제참조(ch 07_1. xsd, ch 07_1. xml)

스키마 문서 작성 • 데이터와 속성을 갖는 엘리먼트 <element name=“요소명” min. Occurs=“최소반복수” max. Occurs=“최대반복수”>

스키마 문서 작성 • 데이터와 속성을 갖는 엘리먼트 <element name=“요소명” min. Occurs=“최소반복수” max. Occurs=“최대반복수”> <complex. Type> <simple. Content> <extension base=“데이터타입”> 속성 </extension> </simple. Content> </complex. Type> </element> 예제참조(ch 07_4. xsd, ch 07_4. xml)