티스토리 뷰

반응형

== devpia 강좌란에서 퍼온 자료임 =

 

 

 

 

본 문서는 MSDN 온라인 컬럼 을 참고로 제작하였습니다.
이금우


안녕하세요..

이번에는요 앞에서 SQL 서버의


Pubs 데이터베이스의 authors 테이블의 내용을

ADO 2.5 을 이용하여 xml 화일로 변환하였습니다.

이번에는 생성된 xml 파일에 대해


간단히 알아 보도록 하겠습니다.

생성된 xml 파일의 내용을 살표 보면

--------------------------------------

< xml xmlns:s="uuid:BDC6E3F0-6DA3-11d1-A2A3-00AA00C14882"
    xmlns:dt="uuid:C2F41010-65B3-11d1-A29F-00AA00C14882"
    xmlns:rs="urn:schemas-microsoft-com:rowset"
    xmlns:z="#RowsetSchema">
< s:Schema id="RowsetSchema">
    < s:ElementType name="row" content="eltOnly">
        < s:AttributeType name="au_id" rs:number="1" 
rs:writeunknown="true">
            < s:datatype dt:type="string" rs:dbtype="str" 
dt:maxLength="11" rs:maybenull="false"/>
        < /s:AttributeType>
        < s:AttributeType name="au_lname" rs:number="2" 
rs:writeunknown="true">
            < s:datatype dt:type="string" rs:dbtype="str" 
dt:maxLength="40" rs:maybenull="false"/>
        < /s:AttributeType>
        < s:AttributeType name="au_fname" rs:number="3" 
rs:writeunknown="true">
            < s:datatype dt:type="string" rs:dbtype="str" 
dt:maxLength="20" rs:maybenull="false"/>
        < /s:AttributeType>
        < s:AttributeType name="phone" rs:number="4" 
rs:writeunknown="true">
            < s:datatype dt:type="string" rs:dbtype="str" 
dt:maxLength="12" rs:fixedlength="true" rs:maybenull="false"/>
        < /s:AttributeType>
        < s:AttributeType name="address" rs:number="5" 
rs:nullable="true" rs:writeunknown="true">
            < s:datatype dt:type="string" rs:dbtype="str" 
dt:maxLength="40"/>
        < /s:AttributeType>
        < s:AttributeType name="city" rs:number="6" 
rs:nullable="true" rs:writeunknown="true">
            < s:datatype dt:type="string" rs:dbtype="str" 
dt:maxLength="20"/>
        < /s:AttributeType>
        < s:AttributeType name="state" rs:number="7" 
rs:nullable="true" rs:writeunknown="true">
            < s:datatype dt:type="string" rs:dbtype="str" 
dt:maxLength="2" rs:fixedlength="true"/>
        < /s:AttributeType>
        < s:AttributeType name="zip" rs:number="8" 
rs:nullable="true" rs:writeunknown="true">
            < s:datatype dt:type="string" rs:dbtype="str" 
dt:maxLength="5" rs:fixedlength="true"/>
        < /s:AttributeType>
        < s:AttributeType name="contract" rs:number="9" 
rs:writeunknown="true">
            < s:datatype dt:type="boolean" 
dt:maxLength="2" rs:fixedlength="true" rs:maybenull="false"/>
        < /s:AttributeType>
        < s:extends type="rs:rowbase"/>
    < /s:ElementType>
< /s:Schema>
< rs:data>
    < z:row au_id="172-32-1176" au_lname="White" 
au_fname="Johnson" phone="408 496-7223" address="10932 Bigge Rd."
         city="Menlo Park" state="CA" zip="94025" 
contract="True"/>
    < z:row au_id="213-46-8915" au_lname="Green" 
au_fname="Marjorie" phone="415 986-7020" address="309 63rd St. #411"
         city="Oakland" state="CA" zip="94618" 
contract="True"/>
    < z:row au_id="238-95-7766" au_lname="Carson" 
au_fname="Cheryl" phone="415 548-7723" address="589 Darwin Ln."
         city="Berkeley" state="CA" zip="94705" 
contract="True"/>
    < z:row au_id="267-41-2394" au_lname="O'Leary" 
au_fname="Michael" phone="408 286-2428" address="22 Cleveland Av. #14"
         city="San Jose" state="CA" zip="95128" 
contract="True"/>
    < z:row au_id="274-80-9391" au_lname="Straight" 
au_fname="Dean" phone="415 834-2919" address="5420 College Av."
         city="Oakland" state="CA" zip="94609" 
contract="True"/>
    < z:row au_id="341-22-1782" au_lname="Smith" 
au_fname="Meander" phone="913 843-0462" address="10 Mississippi Dr."
         city="Lawrence" state="KS" zip="66044" 
contract="False"/>
    < z:row au_id="409-56-7008" au_lname="Bennet" 
au_fname="Abraham" phone="415 658-9932" address="6223 Bateman St."
         city="Berkeley" state="CA" zip="94705" 
contract="True"/>
    < z:row au_id="427-17-2319" au_lname="Dull" au_fname="Ann" 
phone="415 836-7128" address="3410 Blonde St." city="Palo Alto"
         state="CA" zip="94301" contract="True"/>
    < z:row au_id="472-27-2349" au_lname="Gringlesby" 
au_fname="Burt" phone="707 938-6445" address="PO Box 792" 
city="Covelo"
         state="CA" zip="95428" contract="True"/>
    < z:row au_id="486-29-1786" au_lname="Locksley" 
au_fname="Charlene" phone="415 585-4620" address="18 Broadway Av."
         city="San Francisco" state="CA" zip="94130" 
contract="True"/>
    < z:row au_id="527-72-3246" au_lname="Greene" 
au_fname="Morningstar" phone="615 297-2723" address="22 Graybar House 
Rd."
         city="Nashville" state="TN" zip="37215" 
contract="False"/>
    < z:row au_id="648-92-1872" au_lname="Blotchet-Halls" 
au_fname="Reginald" phone="503 745-6402" address="55 Hillsdale Bl."
         city="Corvallis" state="OR" zip="97330" 
contract="True"/>
    < z:row au_id="672-71-3249" au_lname="Yokomoto" 
au_fname="Akiko" phone="415 935-4228" address="3 Silver Ct."
         city="Walnut Creek" state="CA" zip="94595" 
contract="True"/>
    < z:row au_id="712-45-1867" au_lname="del Castillo" 
au_fname="Innes" phone="615 996-8275" address="2286 Cram Pl. #86"
         city="Ann Arbor" state="MI" zip="48105" 
contract="True"/>
    < z:row au_id="722-51-5454" au_lname="DeFrance" 
au_fname="Michel" phone="219 547-9982" address="3 Balding Pl."
         city="Gary" state="IN" zip="46403" contract="True"/>
    < z:row au_id="724-08-9931" au_lname="Stringer" 
au_fname="Dirk" phone="415 843-2991" address="5420 Telegraph Av."
         city="Oakland" state="CA" zip="94609" 
contract="False"/>
    < z:row au_id="724-80-9391" au_lname="MacFeather" 
au_fname="Stearns" phone="415 354-7128" address="44 Upland Hts."
         city="Oakland" state="CA" zip="94612" 
contract="True"/>
    < z:row au_id="756-30-7391" au_lname="Karsen" au_fname="Livia" 
phone="415 534-9219" address="5720 McAuley St."
         city="Oakland" state="CA" zip="94609" 
contract="True"/>
    < z:row au_id="807-91-6654" au_lname="Panteley" 
au_fname="Sylvia" phone="301 946-8853" address="1956 Arlington Pl."
         city="Rockville" state="MD" zip="20853" 
contract="True"/>
    < z:row au_id="846-92-7186" au_lname="Hunter" 
au_fname="Sheryl" phone="415 836-7128" address="3410 Blonde St."
         city="Palo Alto" state="CA" zip="94301" 
contract="True"/>
    < z:row au_id="893-72-1158" au_lname="McBadden" 
au_fname="Heather" phone="707 448-4982" address="301 Putnam"
         city="Vacaville" state="CA" zip="95688" 
contract="False"/>
    < z:row au_id="899-46-2035" au_lname="Ringer" au_fname="Anne" 
phone="801 826-0752" address="67 Seventh Av." city="Salt Lake City"
         state="UT" zip="84152" contract="True"/>
    < z:row au_id="998-72-3567" au_lname="Ringer" 
au_fname="Albert" phone="801 826-0752" address="67 Seventh Av."
         city="Salt Lake City" state="UT" zip="84152" 
contract="True"/>
< /rs:data>
< /xml>

-------------------------------------------------------------------------


위와 같이 생성이 되죠..

스트림에 기록된 XML 형식은 UTF-8 형식으로 반환됩니다. 이것은 ADO 2.1에서 유일
하게 사용되는 인코딩입니다. 

이 형식을 잠깐 살펴보면 스키마 섹션과 데이터 섹션이라는 두 개의 섹션으로 구분되
어 있음을 알 수 있습니다.

위의 스키마는 이름 공간, 스키마 섹션, 데이터 섹션의 선언을 보여 줍니다. 

스키마 정의는 XML 데이터 사양을 따르고 완전히 검증될 수 있어야 합니다
(Internet Explorer 5에서는 검증을 수행하지 않음). XML 데이터 사양을 보려면 
http://www.w3.org/TR/1998/NOTE-XML-data/ 를 참조하십시오. XML 데이터는 현
재 릴리스에서 Recordset 저장을 지원하는 유일한 스키마 형식입니다

이름 공간
ADO에서 XML 저장 형식은 다음 4개의 이름 공간을 사용합니다.

접두사  설명 
s 는 현재 Recordset의 스키마를 정의하는 요소와 속성이 포함된 XML 데이터 이름 
공간을 나타냅니다. 
dt 는 데이터 형식 정의 사양을 나타냅니다.  
rs 는 ADO Recordset 속성에 해당하는 요소와 속성이 포함된 이름 공간을 나타냅니
다.  
z 는 현재 행 집합의 스키마를 나타냅니다.  


사양에 정의된 것처럼, 클라이언트는 이러한 이름 공간에 자체 태그를 추가해서는 안
됩니다. 예를 들어, 클라이언트가 이름 공간을 urn:schemas-microsoft-
com:rowset으로 정의한 다음 rs:MyOwnTag 등을 입력해서는 안됩니다. 이름 공간
에 대한 자세한 내용은 http://www.w3.org/TR/REC-xml-names/ 를 참조하십시오.

중요 스키마 태그의 ID는 RowsetSchema이고, 현재 행 집합의 스키마를 나타내는 
데 사용되는 이름 공간은 #RowsetSchema를 가리켜야 합니다.

콜론의 오른쪽, 등호의 왼쪽에 있는 이름 공간의 접두사는 임의로 변경할 수 있습니
다.

xmlns:rs="urn:schemas-microsoft-com:rowset"
접두사 이름이 전체 XML 문서에서 일관적으로 사용되는 한 사용자는 아무 이름이나 
정의할 수 있습니다. ADO는 항상 "s", "rs", "dt", "z"를 사용하지만 이러한 접두
사 이름은 로드되는 구성 요소에 하드 코딩되지 않습니다.

================================================================

다음에는 이렇게 생성된 내용을 asp 와 통합하여 보고요..
또한 xsl 변환을 통하여 사용자에게 보다 친숙한 형식으로 변환하여 봅니다.

그럼 담번에 계속 올리겠습니다.

양이 많아서.. 저장하는데 몇번을 실패해서.. 어쩔수 없이
나눠서올립니다..

쩝... 계속 에러네여..
이것두 안올라가면 어카지..


본 문서는 MSDN 온라인 컬럼 을 참고로 제작하였습니다.
이금우

블로그코리아에 블UP하기

반응형
댓글
반응형
12-01 01:50
최근에 올라온 글
최근에 달린 댓글
Total
Today
Yesterday
«   2024/12   »
1 2 3 4 5 6 7
8 9 10 11 12 13 14
15 16 17 18 19 20 21
22 23 24 25 26 27 28
29 30 31
글 보관함