1 / 15

양승혁 Yang_ka@kunsan.ac.kr 군산대학교 통계컴퓨터과학과 정보과학기술 연구실 2012.07.16

X M L. Chap 4.5.5~7 . 스키마 활용하기. 양승혁 Yang_ka@kunsan.ac.kr 군산대학교 통계컴퓨터과학과 정보과학기술 연구실 2012.07.16. 목차. 스키마 활용하기 요소와 속성 기술하기 복합형 요소 기술하기 복합형 요소의 지시어 사용하기 온라인 서점 스키마 만들어 보기 데이터 타입 사용하기. 요소와 속성 기술하기 (1/2). 복합형 요소 기술하기 자식 요소를 가지고 있거나 속성을 가지고 있는 요소 빈 요소의 경우 자 식 요소만 있는 경우

dane
Download Presentation

양승혁 Yang_ka@kunsan.ac.kr 군산대학교 통계컴퓨터과학과 정보과학기술 연구실 2012.07.16

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. X M L Chap 4.5.5~7. 스키마 활용하기 양승혁 Yang_ka@kunsan.ac.kr 군산대학교 통계컴퓨터과학과 정보과학기술 연구실 2012.07.16

  2. 목차 • 스키마활용하기 • 요소와 속성 기술하기 • 복합형 요소 기술하기 • 복합형 요소의 지시어 사용하기 • 온라인 서점 스키마 만들어 보기 • 데이터 타입 사용하기 IST (Information Sciences & Technology) Laboratory

  3. 요소와 속성 기술하기(1/2) • 복합형 요소 기술하기 • 자식 요소를 가지고 있거나 속성을 가지고 있는 요소 • 빈 요소의 경우 • 자식 요소만 있는 경우 • 속성과 텍스트가 있는 경우 • 자식 요소와 텍스트가 섞여 있는 경우 • <complexType> • 복합형 요소를 선언할 때 항상 기술 • 요소에 추가 정보를 기술하기 위해 제한자(restriction), 확장자(extention)를 사용 • <simpleContent> • 일반 문자열과 기본 내장형인 string, decimal, integer, boolean, date, time 값은 텍스트로 취급 • <complexContent> IST (Information Sciences & Technology) Laboratory

  4. 복합형 요소 기술하기(2/2) • <element name=“상품”> • <complexType> • <attribute name=“구분자” type=“positivelnteger”/> • </complexType> • </element> • <상품 구분자=“12345/”> • <element name=“종업원”> • <complexType> • <sequence> • <element name=“이름” type=“string”/> • <element name=“나이” type=“integer”/> • </sequence> • </complexType> • </element> • <종업원> • <이름>김상민</이름> • <나이>22</나이> • </종업원> • <element name=“번호”> • <complexType> • <simpleContent> • <extention base=“integer”> • <attribute name=“국가” type=“string”/> • </extention> • </simpleContent> • </complexType> • </element> • <번호 국가=“대한민국”>777</번호> • <element name=“메모”> • <complexTypeminxed=true”> • <sequence> • <element name=“date” type=“date”/> • </sequence> • </complexType> • </element> • <메모> • 오늘은 <date>03.03.02</date> 입니다. • </메모> • 빈 요소의 경우 • 자식 요소만 있는 경우 • 속성과 텍스트가 있는 경우 • 자식 요소와 텍스트가 섞여 있는 경우 IST (Information Sciences & Technology) Laboratory

  5. 복합형 요소의 지시어 사용하기(1/5) • 복합형 요소의 지시어 • 요소의기술을 제어 • 순서 지시어 : all, choice, sequence • 횟수 지시어 : maxoccurs, minoccurs • 그룹 지시어 : group, attributeGroup IST (Information Sciences & Technology) Laboratory

  6. 복합형 요소의 지시어 사용하기(2/5) • <element name =“종업원”> • <complexType> • <all> • <element name=“이름” type=“string”/> • < element name=“나이” type=“integer”/> • </all> • </complexType> • </element> • <element name =“종업원”> • <complexType> • <choice> • <element name=“이름” type=“string”/> • < element name=“나이” type=“integer”/> • </choice> • </complexType> • </element> • <element name =“종업원”> • <complexType> • <sequence> • <element name=“이름” type=“string”/> • < element name=“나이” type=“integer”/> • </sequence> • </complexType> • </element> • 순서 지시어 • all • 임의의 순서로 기술될 수 있으며 각 자식 요소는 반드시 한번 기술 • choice • 자식 요소들 중 하나가 기술 • sequence • 하위의 자식 요소들이 선언된 순서대로만 기술 IST (Information Sciences & Technology) Laboratory

  7. 복합형 요소의 지시어 사용하기(3/5) • <element name =“종업원”> • <complexType> • <choice> • <element name=“이름” type=“string”/> • < element name=“아들” type=“integer” maxOccurs=“10”/> • </choice> • </complexType> • </element> • <element name =“종업원”> • <complexType> • <choice> • <element name=“이름” type=“string”/> • < element name=“아들” type=“integer” maxOccurs=“10” minOccurs=“0”/> • </choice> • </complexType> • </element> • 횟수 지시어 • maxOccurs • 해당 요소가 기술될 수 있는 최대 횟수를 지정 • 기술 횟수를 제한하지 않을 경우 • maxOccurs=“unbounded” • minOccurs • 해당 요소가 기술될 수 있는 최소 횟수를 지정 IST (Information Sciences & Technology) Laboratory

  8. 복합형 요소의 지시어 사용하기(4/5) 종업원들.xml • <?xml version="1.0" encoding="euc-kr" ?> • <종업원들 xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" • xsi:noNamespaceSchemaLocation="종업원들.xsd"> • <종업원> • <이름>홍지현</이름> • <자식이름>김지수</자식이름> • </종업원> • <종업원> • <이름>황현숙</이름> • <자식이름>정상현</자식이름> • <자식이름>정상희</자식이름> • <자식이름>정보람</자식이름> • <자식이름>정다혜</자식이름> • </종업원> • <종업원> • <이름>이순자</이름> • </종업원> • </종업원들> 종업원들.xsd • <?xml version="1.0" encoding="euc-kr" ?> • <schema xmlns="http://www.w3.org/2001/XMLSchema"> • <element name="종업원들"> • <complexType> • <sequence> • <element name="종업원" maxOccurs="unbounded"> • <complexType> • <sequence> • <element name="이름" type="string"/> • <element name="자식이름" type="string" minOccurs="0”maxOccurs="10"/> • </sequence> • </complexType> • </element> • </sequence> • </complexType> • </element> • </schema> IST (Information Sciences & Technology) Laboratory

  9. 복합형 요소의 지시어 사용하기(5/5) • <group name=“종업원 그룹”> • <sequence> • <element name=“이름” type=“string”/> • <element name=“나이” type=“integer”/> • <element name=“생일” type=“date”/> • </sequence> • </group> • ……… • <element name=“종업원” type=“종업원정보”> • ……… • <complexType name=“종업원정보”> • <sequence> • <group ref=“종업원그룹”/> • <element name=“거주지” type-”string”/> • </sequence> • </complexType> • <attributeGroup name=“종업원속성정보”> • <attribute name=“이름” type=“string”/> • <attribute name=“나이” type=“integer”/> • <attributename=“생일” type=“date”/> • </attributeGroup> • ……… • <element name=종업원” type=“종업원정보”> • <complexType> • <attributeGroup ref=“종업원속성그룹”/> • </complexType> • </element> • 그룹 지시어 • group • 요소를 그룹으로 묶을 때 • attributeGroup • 속성을 그룹으로 묶을 때 IST (Information Sciences & Technology) Laboratory

  10. 온라인 서점 스키마 만들어 보기 • <?xml version="1.0" encoding="euc-kr" ?> • <schema xmlns="http://www.w3.org/2001/XMLSchema"> • <element name="주문서"> • <complexType> • <sequence> • <element name="발송자" type="string"/> • <element name="수신자"> • <complexType> • <sequence> • <element name="이름" type="string"/> • <element name="주소" type="string"/> • <element name="도시" type="string"/> • <element name="국가" type="string"/> • </sequence> • </complexType> • </element> 주문서.xsd • <element name="서적" maxOccurs="unbounded"> • <complexType> • <sequence> • <element name="제목" type="string"/> • <element name="출판사" type="string"/> • <element name="참고" type="string" minOccurs="0"/> • <element name="수량" type="positiveInteger"/> • <element name="가격" type="decimal"/> • </sequence> • </complexType> • </element> • </sequence> • <attribute name="주문서번호" type="string"/> • </complexType> • </element> • </schema> • <?xml version="1.0" encoding="euc-kr" ?> • <주문서 주문서번호="889923" • xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" • xsi:noNamespaceSchemaLocation="주문서.xsd"> • <발송자>김상민</발송자> • <수신자> • <이름>황현숙</이름> • <주소>마포구 연남동 562-25</주소> • <도시>서울시</도시> • <국가>대한민국</국가> • </수신자> 주문서.xml • <서적> • <제목>자바 이렇게 시작하세요</제목> • <출판사>컴스페이스</출판사> • <참고>특가판매</참고> • <수량>1</수량> • <가격>20000</가격> • </서적> • <서적> • <제목>PHP 파일럿 프로젝트 실무</제목> • <출판사>컴스페이스</출판사> • <수량>1</수량> • <가격>22000</가격> • </서적> • </주문서> IST (Information Sciences & Technology) Laboratory

  11. 데이터 타입 사용하기(1/4) • 데이터 타입 • 문자열 타입 • string 타입 • NormalizedString타입 • Toke 타입 • 날짜와 시간 타입 • date 타입 • time 타입 • dateTime타입 • duration 타입 • 숫자 타입 • decimal 타입 • interger타입 • 부울형 • boolean타입 IST (Information Sciences & Technology) Laboratory

  12. 데이터 타입 사용하기(2/4) • <element name =“고객” type=“string”/> • ……… • <고객>양승혁</고객> • ……… • 문자열 타입 • string 타입 • 일반 문자열 라인피드, 캐리지리턴, 탭 문자 등 모두 수용 • NormalizedString타입 • 일반 문자열 허용 • 라인피드, 캐리지 리턴, 탭 문자 등을 제거 • Token 타입 • 일반 문자열 • 라인피드, 캐리지 리턴, 탭 문자 등을 제거 • 문자열 앞 뒤 공백 제거 • 여러 개의 연속인 공백인 경우 한 개의 공백으로 바뀜 IST (Information Sciences & Technology) Laboratory

  13. 데이터 타입 사용하기(3/4) • CC : 세기 • YY : 년도 • MM : 월 • DD : 일 • T : 시간의 시작을 알리는 구분자 • hh : 시간 • mm : 분 • ss : 초 • P : 기간을 의미(항상 사용) • nY : 년 수 • nM : 월 수 • nD : 일 수 • T : 시간의 시작을 알리는 구분자 • nH : 시간 수 • nM : 분 수 • nS : 초 수 • <element name =“날짜” type=“date”/> • ……… • <날짜>2013-03-04</날짜> • <element name =“시간” type=“time”/> • ……… • <시간>09:20:04</시간> • <시간>09:20:04.5</시간> • <element name =“날짜와시간” type=“dateTime”/> • ……… • <날짜와시간>2013-05-15T09:10:20</날짜와시간> • <element name =“기간” type=“duration”/> • ……… • <기간>P5Y</기간 > • < 기간>P5Y2M10D</기간 > • < 기간>P5Y2M10DT15H</기간 > • < 기간>PT15H</기간 > • < 기간>-P10D</기간 > • 날짜와 시간 타입 • date 타입 • 날짜 • “CCYY-MM-DD” (세기년-월-일) 형식 • time 타입 • 시간 • “hh:mm:ss” (시:분:초) 형식 • dateTime타입 • 날짜와 시간 • “CCYY-MM-DDTHH:mm:ss” 형식 • duration 타입 • 기간 • “PnYnMnDnTnHnMnS” 형식 IST (Information Sciences & Technology) Laboratory

  14. 데이터 타입 사용하기(4/4) • <element name =“숫자” type=“decimal”/> • ……… • <숫자>999.50</숫자> • <숫자>+999.50</숫자> • <숫자>-999.5045</숫자> • <숫자>999</숫자> • <숫자>0</숫자> • <element name =“숫자” type=“interger”/> • ……… • <숫자>999</숫자> • <숫자>+999</숫자> • <숫자>-999</숫자> • <숫자>0</숫자> • <attribute name =“부울값” type=“boolean”/> • ……… • <숫자 부울값=“true”>999</숫자> • 숫자 타입 • decimal 타입 • 10진수 • interger타입 • 정수 • 부울형 • boolean타입 • true(1) 와 false(0) IST (Information Sciences & Technology) Laboratory

  15. 감사합니다 Yang_ka@kunsan.ac.kr 군산대학교 정보통계학과 정보과학기술 연구실 2012.01.03 양승혁 Yang_ka@kunsan.ac.kr 군산대학교 통계컴퓨터과학과 정보과학기술 연구실 2012.07.16

More Related