XML ( Extensible Markup Language ) - PowerPoint PPT Presentation

Loading...

PPT – XML ( Extensible Markup Language ) PowerPoint presentation | free to view - id: 6bcbd5-NDUxO



Loading


The Adobe Flash plugin is needed to view this content

Get the plugin now

View by Category
About This Presentation
Title:

XML ( Extensible Markup Language )

Description:

Title: PowerPoint Presentation Author: Samerkae Last modified by: Samerkae Created Date: 12/3/2003 8:37:18 AM Document presentation format: On-screen Show – PowerPoint PPT presentation

Number of Views:41
Avg rating:3.0/5.0
Slides: 125
Provided by: Samerkae
Category:

less

Write a Comment
User Comments (0)
Transcript and Presenter's Notes

Title: XML ( Extensible Markup Language )


1
XML ( Extensible Markup Language )
???????????????????????????????????? ???????
??????????????????????????????????? ???????? ?
?????????? ??????? ???? XML ???? ????????????????
?????????????????????????? ???????????????????????
????????? ???? XML ??????????????????????
???? ?????????????? ????????????????????????? ????
???????????????????
2
????????????????????????????????????????? so
lutions ??????????????????????????? 2 ??? -
???????????????? - ????????????????????????
???? ?????????????????????????????????????????
?? ????????? XML ???????????
3
????????????????? HTML ??? XML ????
XML ?????? HTML ????????????????? ??? HTML ???
XML ?????????????????????? ???????????????????????
??????? HTML ???? HTML ??????????????????????
??? ??????????????????????? ?????????????????? ???
? ?????? ???????? ???? XML
?????????????????????????? ????
4
???????????????? XML ?????????? Tag
???? ? ???????????? HTML ????????? tag ??? ???
tag ???? ???????? tag ?? HTML ??? tag
????????????? ???????????????????????????????
W3C ?????????????????????????????????????
????????? XML tag ????????????????????????? ??????
???? ?????????????????????? ??????????? ??????????
???????????????????
5
????????? XML ???????????????????????
?????? tag ??????? ????????????????? ??????????
XML ???????? ?????????????????????????????????????
? ??????????? ??????????????????????????? ???????
????????????????????????? XML
6
????????? XML (???) XML
??????????????? SOAP (Simple Object Access
Protocol) ????????????????? ??????????????????????
????????????????
7
??????????? tag ??? element tag
????????????????? element ??????????? ????
???????????????? element ??? body ??? ??????? tag
???? ltbodygt ??????????????????? ??????????????????
?????? element body ?????? ??? tag ??? lt/bodygt
??????? tag ?????????????? object
????????? ??????????????? ?????? element
??????? ????? object ???????
8
???????? XML lt?xml version1.0
encoding windows-874?gt ltpersondatagt ltidgt001lt/i
dgt ltfirst-namegt???????????lt/first-namegt ltlast-na
megt?????????ltlast-namegt ltaddressgt???????lt/address
gt lte-mailgttan_at_yahoo.comlt/e-mailgt lt/persondatagt
9
?????????? ????????????????????????????
???????? prolog ???????????????????? XML
declaration ??????? ???????????????? XML
??????????????????? ??????????????????????????
windows-874 ??????????????????????????????????
????????? XML ??????????? Document Elements
???? ?????????? tag ??????? tag ???
10
?????????? (???) ?????????? tag
??????????? tag ??????????? Root Tag
??????????????????? tag ???? ? ????
tag ????????????? root tag ????????????? Childs
Tag ?????????????????????????????? ??????????
XML ???????????????????????????????????????
???????????? tag ??? XML ???????? Case-Sensitive
???????????????????????????? ?????????????????????
11
???????????????????????????? XML ??????? HTML
??????? binding ??????????????? HTML
?? ????????? DSO (Data Source Object)
????? ?????????????????????????? XML ????????
XML ?????????????????? ??????????????? Data
Island ??????????????????????????? XML
????????? ??????????????????????????? ????
???????????????? ??????????????????????? XML
12
???????????????????????????? XML ???????
HTML ????? 2 ??????? - ?????????? tag
ltxmlgt.lt/xmlgt ??????? ????????????? Data Island
?????? element ??? HTML ?????????? xml -
?????????? tag lttablegt.lt/tablegt ??????? ??????
element table ??? HTML ??????????????? ???????????
??????????????????????????? XML
?????? ???????????? HTML
13
  • ????????????????? HTML ????????? XML ?????
  • 2 ?????????
  • ?????? Data Island ???????????????????
  • HTML (????????)
  • 2. ?????????????????? XML ?? HTML(.XML)
  • (????????)

14
??????????? Data Island
15
?????????????????? XML
16
?????????????????????? tag ??? HTML
??????????????? XML ?????? tag ltxmlgt ??????? tag
??????????????????????? xml ???????????? tag
table ??? xml ??? HTML ????????????????????
????????? 3 ????????? - ????????????????? 1
record - ?????????????????? record
??????????? - ???????????????? record
17
???????????????????? 1 record
??????????????????????? tag lttablegt .... lt/tablegt
??? tag ltxmlgt....lt/xmlgt ??? HTML ??????? 1
record ??????????? ??????? ???? 4
???????????????????? record ????? record ?????
(??????)
18
????????????????????????? record
19
????????????????????? record ????????
??????????????????????? tag lttablegt
???? ??????????????????????????????????? Paging
Control ??????????????????? record
???????????????????? ?????? attribute
datapagesize ??? tag lttablegt ????????? ?????
record ?????????????????????????? (???????? ???
?????????)
20
????????????????????????????? record ????????
21
??????????????????? record ????????????????????
???? ?????????????????????? ?? ?
??????????????????? ??????????????? ?????????
22
??????????????????????????? record
23
????????? XML ??????? CSS ???? CSS
(Cascading Style Sheets) ???? ???????????????????
???? DHTML (Dynamic HTML) ??????????????????????
? ???????????????????? ????????????????? ?????????
??????????????????????????????? ??????????????????
???????????? Cascading Style Sheets Positioning
(CSS-P)
24
??????????????? XML ???????? CSS
??????????? 2 ????????? - ?????? CSS
??????????????????? XML ?????? -
?????????????????? .CSS ?????????? ????
.CSS ??? ???? .xml (??????)
25
????????????????????? CSS
26
????????????????????????? .css ???? .xml
27
?????????????? CSS-P ??????????????????????
??????????????????? ??????????????????
css_positioning.css ????????????????????????????
???????? attribute href css_positioning.css
?????? .xml (??????)
28
(No Transcript)
29
????????? XML ??????? XSL(T) ?????????
???? XSL ???????????????????????????????? ????????
???? XML ???????? ???????????????? ?????? XSL
?????????????????????????? HTML ??? CSS
????????????????????????????????? ??????????
30
XSL (eXtensible Stylesheet Language)
?????????????????????????? XML ????????? ?????????
? HTML ??? CSS ?????????????? ???????????????????
XSL ??????? XML - ?????????????????? (Format
Data) ???????? ?????? XML ??????????????
- ?????????? (Transformation Data) ?????
?????? XML ????????????????????? ????????
??????
31
????????? XML ???? XSL ????????????????
?????????????? element href.xsl
???????????? xml ???????????? xsl ?????????
32
??????????????? xsl ??????? xml ????????????????
33
????????? XML ???? XSL ????? attribute
?? ??????????? ??????????? attribute
??? element ???? ? ???????????? xml
???????????? xsl ?????????
34
??????????????? xsl ??????? xml ????? attribute
35
????????? XSL ??????? CSS ??????????
CSS ????????????????????????? ???????????
????????????????????????????? ???????
???????????? xml ???????????? xsl ?????????
36
??????????????? xsl ??????? CSS
37
???????????????? XML ???????? XSL ?????????????
????????????????????????????????????
xsl ??? ???????????????????????????????????? ????
??? ???????????? xml ???????????? xsl
?????????
38
??????????????? XML ???????? XSL ?????????????
39
???????????????? XML ???????? XSL ???????????
if-then ??????????????????????? record
??????????? ??????????????????????????????????
???????????? xml ???????????? xsl ?????????
40
??????????????? XML ???????? XSL ???????????
if-then
41
???????????????? XML ???????? XSL ???????????
choose-when ???????????????????????????
? ?????????????? ?????????????????????????
??????????????? ???????????? xml
???????????? xsl ?????????
42
??????????? XML ???????? XSL ???????????
choose-when
43
???????? Hyperlink ??? E-mail Link ???? XSL
???????????? 2 ????????? -
?????????????????? (Hyperlink) - ????????
E-mail ???????????? xml ???????????? xsl
?????????
44
??????????? Hyperlink ??? E-mail
45
XML Data Schema ????????????????????????
?? XML ??? XSL ???????????????????????????????????
??????? ????????? ?????????????????????????????
DTD ????? 2 ????????? - ??????????????
DTD ????? XML - ?????????????????? .dtd
46
?????? DTD ??? XML Data Schema DTD ????????
Document Type Definition ????????????????????????
??? ??????????? element, attribute ??? entity
?????????????? ?????? XML ???????????????????
????????????? XML ????? 2 ??????? 1. DTD
(Document Type Definition) 2. XML Data Schema
47
???????????? DTD ????? XML ?????? DTD
?????? XML ????? run ????????? IE
????????????????? DTD ??????? ????????? View
source code ???????????????? DTD ???????????????
XML ??????? DTD
48
(No Transcript)
49
??? DTD ??????????????????????? element
???????? root element ??? book ?????? child
element ??? bookdata ????????? bookdata ??????
child element ??? isbn, bookname, author,
publisher, price ??? homepage
50
????????????????????????????????????? XML
???? ???????????????????????????????????? ???????
???? XML ???????????????? XML Parser
??????????????????????? 3 ??????? ?????? 1
??????????????????????????????????? element
?????????????????????? PCDATA ????? Parsed
Character Data ?????????????????? ????????????????
???? XML Parser ???? ??????????????????????????
51
????????????????????????? XML Parser
????????????? ??????????????? tag
?????????????? ??????? tag ?????????? Markup
???? ???????????? ??????????????????????????????
???? ltpublishergtInfopresslt/publishergt
??????????????????????????????????? element
??? ??????????? ???????????????????????????? ?????
????? element ??????
52
?????? 2 ?????????????????????????????????????
?????????????????? ???????? CDATA ????? ?????
Character Data ????????????????????? attribute
?????????????????????????????? ?????? attribute
???? ? ????????????????????? ?????? XML
53
?????? 3 ???????????? ????????????? ???????
entity ???????????????? (Unparsed
Entity) ????????????????????????? NDATA
???????????? ???????? CDATA ???????????????????
?????????????????????????????????????????????????
???? GIF ???? JPEG ?????? attribute ??? element
?????????????????????? ???? ltimg
srclogo.gifgt ???????? XML Parser
?????????????????????????? src ???????????????????
????????????????????? ??? ???????????????????
logo.gif ????????????????
54
???????????????????? ???? element
??????? ?????????? ??????????????? PCDATA
??? ????????? ELEMENT ??????? DTD ???????????????
?????????????????????? .dtd
???????????????????????????????? XML ???????? DTD
?????????????????? .dtd ?????? ????????? tag
?????? lt! DOCTYPE ???? root tag SYSTEM
????.dtdgt ???????????? xml ???????????? dtd
55
Entity entity ?????? XML ??????????????? ?
???????? ?????? ??????????? entity
Entity ???????????? ????????
it it Less than
gt gt Greater than
amp amp Ampersand
apos apos Apostrophe or quote
quot quot Double quote
nbsp nbsp Space 1 space
???????? Standard Entity
56
???????? entity ???????????????????
XML ???????????? xml ???????????
???????????????????????? ??????????????????????
DTD ??????????????????? entity ????????????
?????? ?????? ENTITY ??????? DTD ???? lt!ENTITY
psh ??????????.......gt lt!ENTITY dst
?????????????.......gt
57
??????????? entity ??????????????????? XML
???????????????? ?????? ?????????????? ?????????
?? ?????????????? psh dst
58
???????? entity ??????????????? ????????????
xml ???????????? dtd
??????????????????????????????????? ???????
??????????????????????? XML ????? ????????????????
?? ???????????????????? dtd ???????????
?????????????????????????? ???? dtd ????? host
????????????? ??????? ????????????? path
????????????????????
59
????????? XML ??????? JavaScript ??????
XML ??????? JavaScript ????????? ?????????
Netscape ????????????????????? DOM ?????
Document Object Model ????????? ??????????????????
?????????????
60
??????????? DOM ?????? HTML lthtmlgt ltheadgt lttit
legtNew Page 1lt/titlegt lt/headgt ltbodygt lt/bodygt
lt/htmlgt
61
???? JavaScript ?????????????????????? ??????
XML ???????? (node) ???? Root Node
????????????????? Root Element ???????????? ????
XML ????? ????????????? (Child Node) ?????????????
element ???
62
????????????? XML ?????? JavaScript
??????? HTML ?????????????????????????????
JavaScript ???????????????????? XML
????? ?????????????????????????? HTML ????? 2
????????? - ????????????????????????? -
????????????????? element
63
????????????? XML ????????????
???????????????????? XML (????????????) ??????????
?????? html ?????? JavaScript ???????????????
???????????? ltScript LanguageJavaScript
Forwindow Eventonloadgt
64
??????????????????????????????????????? ??????
?? DOM ??????? XML ??????? ???????????? ActiveX
?????????????????? ?????????????????????????? var
xmlDocs new ActiveXObject(Microsoft.XMLDOM)
65
??????????????????????????????????? ??????????
???????????????????????????????? ?????????????????
?????? xmlDocs.asyncfalse ?????????????????
async ???????????? false
66
??????????????? load ???????????????
XML ????????????????? bookdata.xml xmlDocs.load(
bookdata.xml) ????????????????????? xChild
??????????????? ???????????????? bookdata.xml
??????? ????????? childNodes xChildxmlDocs.docum
entElement.childNodes
67
??????????????????????????????????????????? ??????
??????????????????? ???????????????? ??? 0
???????????????? childNodes ?????? ?????? Data1
??? Data6 ???????????????? innerText Data1.innerT
ext xChild(0).text Data2.innerText
xChild(1).text Data3.innerText
xChild(2).text Data4.innerText
xChild(3).text Data5.innerText
xChild(4).text Data6.innerText xChild(5).text
68
????????????????? tag lttablegt ?????? tag ltspangt
??????? attribute id ??????????? ?????????????????
?????????????? ???????? ???????????????????? lttrgt
lttd width10gtltfont faceMS Sans Serif
Size2gt ???????????? 1lt/fontgtlt/tdgt lt/trgt ????
???????? .html
69
????????????? XML ???? element
???????????????????? XML ?????????????? element
??????????????????? ????????????????????? ???????
????? ??????????????????????????? ????????????????
?????????????????? ??????????????????????????????
????????? Script Language ????????????????????????
?? xmlDocs ????????????? ActiveX
70
??????????????????????????
71
??????????????????????????? ????????????????? ????
???????? ?????????? getElementsByTagName
???????????????? ????????????????????????? 1
????? ??????????? ltbooknamegt ????????????????????
ltbookgt ltbookdatagt ltisbngt974-61901-7-2gt/isbngt
ltbooknamegt??????????????????lt/booknamegt
ltauthorgt????? ??????lt/authorgt
ltpublishergtinfopresslt/publishergt
ltpricegt299lt/pricegt lthomepagegthttp//www.
infor.comlt/homepagegt lt/bookdatagt
72
??????????????????? item ????????????????? ???????
????????????? ltbooknamegt ????????????????????
? ltbooknamegt ??? ??????????? ltauthorgt
?????????????????????? ??? ??????? item(0)
???????????????????? ??????????????? text
(????????????) document.write(ltbgt???????????lt/bgt
) document.write(xmlDocs.getElementsByTagName
(bookname).item(0).text) document.write(ltb
rgt) document.write(ltbgt???????lt/bgt) document.wri
te(xmlDocs.getElementsByTagName
(author).item(0).text)
73
????????? XML ??????? XSL ???? JavaScript
???? JavaScript ???????????????? XSL
???????????????????????????????? XML ????? ?????
? ?????????????????????? XSL ?? ??????????????????
????? ???????????? xml ???????????????????????
?????? ??????? xmlDataSource.xml ???????????? xsl
74
??????? .html ??????????????????????????? XMLDOM
?????? 2 ??????????????????????? XML ??? XSL
?????? - ??????????????? xmlDocs ??????????
XML - ?????????????? xslDocs ????????
XSL ??????????????????? var xmlDocsnew
ActiveXObject(Microsoft.XMLDOM) var
xslDocsnew ActiveXObject(Microsoft.XMLDOM)
75
???????????????????????? async ????
false ??????????? load ????????????? xml
??????? ????????????????? xmlDocs xmlDocs.aysnc
false xmlDocs.load(xmlDataSource.xml) ???????
???????? xsl ?????????????????????????? xslDocs
??????????? load xslDocs.async
false xslDocs.load(xsl_For_xmlDataSource.xsl)
76
????????????????????????????????? xslDocs
??????????? transformNode ????????? ?????????
xmlDocs ??????????????????????? ??????????????
xml ???????????????????? ????????????
write document.write(xmlDocs.transformNode(xslDoc
s)) ??????????????? html
77
????????? XML ??????? ASP
????????????????????? XML ??????????????? ????????
??? ASP ?????????????????????????? ?????? Access
?????????????????????????????? ???????????? XML
?????????????????? ???????????? XML
???????????????
78
????????????? XML ??????? XSL ?????? ASP
??????????????????????????? XML ??????? XSL
???????????????????????? ????????????
xml ???????????? xsl
79
???????????????? ASP ?????????????????????? ??????
xmlDataSource.xml ??? xslFile.xsl ???????????????
??????????? ???????????? ??????? ASP
??????????????????????? 4 ??? ??????????????????
xmlDocs ????????????? ???????????????????????????
XML DOM ?????????????????? xslDocs
????????????? ??? xsl
80
???????? ASP
81
???????????????????? ????????????????? XML
DOM ?????????????????????????????? xmlDocs ???
xslDocs ????????????????????????????????
async ???? false ?????????????? ??????????? XML
????????????????? server ?? ??????????? XML ???
XSL ??????????????? ?????????????????????????????
???????????????????? XML ????????????
xmlPath ???????????? xmlPathServer.MapPath(
xmlDataSource.xml)
82
??????????????????????? XML ?????? ?????
load ????????????????????????? xmlDocs ???????????
?? xmlPath xmlDocs.load(xmlPath)
????????????????????? server ???????????????????
XML ??????????? ?????????????????????????? XSL
?????????????????????????????????? ???????? load
???? xslDocs.asyncFalse xslPathServe.MapPath
(xslFile.xsl) xslDocs.load(xslPath)
83
??????????????? ??????????????????? ????
XSL ?????????????????????????? parseError
???????????? reason ????????? ????????????????????
? If xslDocs.parseError.errorCode ltgt 0 Then
Response.Write ???????????????????????? XML
?????????
Response.Write xslDocs.parseError.reason Else
Response.Write(xmlDocs.transformNode

(xslDocs))
84
????????????????????????????????? ??????????
????? xmlDocs ?????????????????? xslDocs SET
xmlDocs Nothing SET xslDocs Nothing
85
????????????????????? XML ????????????
??????????????????????????????????????? ??????????
???????????????? XML ???????? ?????????
Recordset ???????????????? Stream ??? ADO 2.5
?????? ??????????????? 4 ??????? 1.
???????????? Stream ??? ADO ???????????
?????????????????????????????????????????
XML
86
2. ???????????? Response ??????? ASP 3.
????????????????????????????????????
????????? ?????????????????????? XML 4.
??????????? Microsoft XMLDOM ??????
??????????????????????????? ????????? XML
??????
87
????????????????????????????????????????? Stream
????????????????????? Microsoft Access
?????????????????????????????????
88
??????????
89
???????????? ASP (XMLStream.asp) ???????? asp
?????????????????? xml ?????? ????????????????????
???? view-gtsource ???????????????????? ?????????
?????? XML ?????????????????? Recordset ??? ADO
?????????? record ???? ? ???????????? query
??????????????? ????????? Stream
?????????????????????? ????????
?????????????????????????????? ?????????????
?????? view -gt source
90
?????????????????????????????? XML ??? ?????????
????????????????????????????? xsl
???????????????????? ??????????????? query
?????????????? detail ??? Access
????????? sqlMainSELECT FROM Detail ORDER BY
ID
91
??????????????????????? Recordset
?????????? reMain ??????????? Execute
??? ????????? Connection SET rsMainConn.Execute(
sqlMain) ????????????????????? Stream
??????? ???????????????????? SET
stmMainServer.CreateObject(ADODB.Stream)
92
??????????????????????????????????????????
Recordset ?????????????? Stream ?????? ?????
Save ???????????? Recordset ??? ??????????????????
?????????????????????? XML ???????????????????????
? adPersistXML rsMain.Save stmMain,adPersistXML
93
??????????????????? Stream ???????????????? ??????
??????????????????????????? ?????????? ???????????
?????????????????????????????? Text ??????????????
???? XML ????????????????????? Response
???????????????? ContentType Response.ContentType
text/xml
94
????????????????????????? ???????????? ?????????
Response ???????????? Write ?????????????????????
?????????? stream ?????? ????? Readtext
???????????? Stream ???? ????? Response.Write
stmMain.Readtext ?????????????
?????????????????????????? Stream ???????
stmMain.Close SET stmMainNothing
95
????????????????????????????????????????? Response
??????????????????????????????????????? ??
???????????????? XML ????????????????? Response
??? ASP ??????????????? (XMLResponse.asp) ???????
???? (link file.txt)
96
????????????????????????????????????????? Response
??????????????????????????????????????? ??
???????????????? XML ????????????????? Response
??? ASP ??????????????? (XMLResponse.asp) ???????
????
97
?????????????????????????????????????????? ???????
?????????????? query ?????? ?????????? ???????????
XML Data-Schema ????????? ???????????????????????
??????????????? ???? DTD ????????????????????????
???? 2 ???? ??? ??????? 1 ??????? XML
Data-Schema ??????? 2 ?????????????????????????
???? XML
98
(No Transcript)
99
(No Transcript)
100
???????????? XML Data-Schema XML
Data-Scehma ??????????????????? ??????????????????
???????????????????????????? ????????? XML
????????????? DTD ????????? ??????????????? query
????? ??????????? XML Data-Schema
??????????????????????????????? ??????????????????
?????????????
101
??????????????? ????????????????????
XML Data-Schema ?????????????????????????????? (pr
efix) ?????????????????????
???????? ???????
s ?????????????????????? ????????????? ?????????????????????????? ????????????
dt ?????????????????????????????????????? s ?????????????????????????????? ???? ???? string, int
rs ??????? 2 ?????????????????????? ???????????????? ????????????????????????????? s ???? ??????? null ??????????
z ??????????????? ???? record ???????????
102
????????
???????? ????????
s ltxml xmlnssuuidBDC6EF0-6DA3-11d1-A2A3-00AA00C14882
dt xmlnsdtuuidC2F41010-65?B3-11d1-A29F-00AA00C14882
rs xmlnsrsurnschemas-microsoft-comrowset
z XmlnszRowsetSchemagt ltsSchema idRowsetSchemagt
103
?????????????????????????? ???????????????? ??????
???????? ???????????????????????????????? ????????
?? ??????????????????????????????? ??? root
element ??????????????? element ??? ????????
??????????????????????? ? ??? ???????? ???????
element ??????????????? ????
ltsElementType namerow contenteltOnlygt
104
??? attribute content ???? ? ??????????????????
??? attribute ??????????
empty ?????????????? element ???? ? ??? ??????????????????
textOnly ????????????????????????? ? ????? ?????????? ?????????????? element
eltOnly ??????????????? element ?????????? ????? ??????????????????????? ? ???
mixed ??????????? element ????????????? ?
105
????????????????????????????????????????? ????????
????????????????????????? Access ????????????????
????????????????????????? ID (nameID)
??????????????????? Null ??????????
(rsnullabletrue) ????????????????
(dttypeint) ??????????????????????????????????
???? (rsfixedlengthtrue)
106
???????? ltsAttributeType nameID rsnumber1
rsnullabletrue rsmaydefer true
rswriteunknowntruegt ltsdatatype dttypeint
dtmaxLength4 rsprecision10
rsfixedlengthtrue/gt lt/sAttributeTypegt ??????
??????? ? ???? ltsAttributeType nameTitle
rsnumber2 rsnullabletrue rsmaydefer
true rswriteunknowntruegt ltsdatatype
dttypestring dtmaxLength200/gt lt/sAttribut
eTypegt
107
?????????????????????? ? ???????????????????? ????
????? ???????????????????? zrow ?????????? ?
???????????? record ????????? ??????????????????
attribute ??? element zrow ????????
????????????????? record ??? ?????????? 3
???????? ID, Title ??? Description
ltzrow ID'1' Title'Visual Studio 98 Service
Pack 5' URL'msdn.microsoft.com/vstudio/sp/vs6sp5/
dnldoverview.asp Description ???? Service
Pack 5 ??? Visual Studio 98 ?????????? 2 ??????
????? Visual Basic 6.0 ??? Visual Studio 98
???????'/gt
108
?????????????????????? XML ?????????? ADO
Recordset ???????????? XSL ??????? XML
?????????? ????? query ???????????????? XML
Data-Schema ????????? ???????????????????? ???????
?????????? XML ???????????????????????? ??????????
??????????????? attribute ??? element zrow
???????????????????????????? ?????????????????????
?? _at_ ???????????????? tag ???????? ????????
109
??????? asp ???????????
???????????? .xsl ?????? ??????? xml ??????
110
?????????? ?????? XML_With_XSL.asp
??? ???????????????? XSL ????????????????????? ???
???????????????????? XML ???????????? ?? query
??????????????? xslFile1.xsl Response.Write(?xml
-stylesheet typetext/xsl
hrefxslFile1.xsl?gt) ??????????
??? XSL ??????????????????????????????????????????
????? element zrow ????? ????????????????????????
??? ltxslfor-each selectxml/rsdata/zrowgt
111
???????????????????????????????????? attribute
?????????????????? _at_ ?????????? tag ???? ????
lttd width3gt ltfont name MS Sans
Serif Size2gt ltxslvalue-of
select_at_ID/gtlt/fontgt lt/tdgt
112
??????????????????????????????????????????
?????????????????????????????????????????? 2
???? ??? ?????????????????????????????????? ?????
?????? XML ????????????? ????????????? ???????????
????????????????????????????????????? ???
FileSystemObject ?????????????????? ??????????????
? ASP ????????????????????????
113
?????? ?????????????? xml ?????????????? ?????????
? FileSystemObject ???????????? ??????????????????
??????????????????? SQL ??? query
????????????????? ?????????????????? ????????????
????????????? tag ???? ? ????????? ?????? XML
??????????????? tag XML ?????????????????????????
?????????? ?????????????????? main.mdb
????? ????????? c\ ??????? XMLFileResult.xml ????
?????????????????
114
???????????? ADORecordsetToXML.asp ??????????????
????????????? Detail ?????? main.mdb ??????????
115
???????????? XMLFileResult.xml
116
(No Transcript)
117
??????? ??????????????????????????????????? ??????
??? ??????????????? Connection ???
ADO strConnProviderMicrosoft.Jet.OLEDB.4.0Da
ta Source Server.MapPath(main.mdb)
SET Conn Server.CreateObject(ADODB.Connection
) Conn.ConnectionStringstrConn Conn.Open
118
?????????????????????????? SQL ??????????????????
??????????????????? XML ???? sqlMainSELECT
FROM Detail ORDER BY ID SET rsMainConn.Execute(s
qlMain) ????????????????? Recordset ????
????????? ????????????????????? reFieldcount
???????? ????????????? rsFieldCountrsMain.Fields
.Count
119
????????????????????? FileSystemObject
??????? ??? fsoADOToXML ?????? SET
fsoADOToXMLServer.CreateObject
(Scripting.FileSystemObject) ?????????
???? fsoXMLFile ???????? ??????????? CreateTextFil
e SET fsoXMLFilefsoADOToXML.CreateTextFile

(C\XMLFileResult.xml)
120
????????????????????????????? ???????????? WriteLi
ne fsoXMLFile.WriteLine(lt?xml version1.0
encodingwindows-874?gt
) ???????? tag ???????????????????? fsoXMLFile.Wr
iteLine(ltDatabaseDetailgt) ?????????????????????
??? ?????????????????? record Do While
rsMain.EOFFalse
121
???????? tag ??? fsoXMLFile.WriteLine(ltRecordDeta
ilgt) ????????????????????????????????? For i0
To (rsFieldCount-1) ?????????????????????
FieldDBName ?????????? ???????????? Name
???????????? Fields ???? ???????????????
FieldDBName ????????? ID FieldDBNamersMain.Fields
(i).Name ???????????? tag ????
???????????????? fsoXMLFile.WriteLine(lt
FieldDBName gt)
122
??????????????????????????????????????? ?
?? ????????????????????? If IsNull(rsMain.Fields(
FieldDBName).Value) OR Trim(rsMain.Fields(Fiel
dDBName).Value) Then
xmlTagData??????????? Else
xmlTagData rsMain.Fields(FieldDBName).Value End
IF ?????????????????????? tag ???? fsoXMLFile.Wri
teLine(xmlTagData)
123
?????????? tag ??? fsoXMLFile.WriteLine(lt/
FieldDBName gt) Next ???????????????????????
????????????? tag ??? ???? lt/RecordDetailgt
fsoXMLFile.WriteLine(lt/RecordDetailgt)
rsMain.MoveNext Loop
124
?????????? tag ??? fsoXMLFile.WriteLine(lt/Dat
abaseDetailgt) ??????????????????????????????????
????? Response.Write(ltmeta http-equivContent-T
ype contenttext/html charsetwindows-874gt
) Response.Write(ltfont nameMS Sans Serif
size2 colorredgt) Response.Write(??????
???? ?????????????) Response.Write(lt/fontgt)
About PowerShow.com