Вы находитесь на странице: 1из 32

?

? ( .)

IP-


IP-?
.
, .
.
, .
.

?
IP-
MAC-
IP-
MAC-
Ethernet-

,
?
ARP


MAC- , M
. ?
.
ARP- MAC-.
, ,
.


? ( .)
NIC

10 ,
?




11 Ethernet?

IP-
MAC-

12 ? (
.)


13 FCS Ethernet?



,

14 ,
.
,
.
,
.
.
1 100 Ethernet 100BASE-T?
5




. . H1
, H2, ?
H1 H2,
.
H1 H2,
H2.
H1 H2,
.
H1 H2,
H2.
17 ?
, ISP

,
,
18

.
, 1 2?
, .
MAC-, .
IP-,
.
IP- MAC- .

19 A MAC- B, LAN.
MAC- B.
MAC-, .
?
ARP
DHCP
DNS
WINS
20 ? (
.)




21 .
.
.
.

:
7 :
1.
2.
3.
21 :

10 :

:
<xsl:template match="/">
<H2>Book Description</H2>
<SPAN STYLE="font-style:italic">Author: </SPAN>
<xsl:value-of select="BOOK/AUTHOR"/><BR/>
<SPAN STYLE="font-style:italic">Title: </SPAN>
<xsl:value-of select="BOOK/TITLE"/><BR/>
<SPAN STYLE="font-style:italic">Price: </SPAN>
<xsl:value-of select="BOOK/PRICE"/><BR/>
<SPAN STYLE="font-style:italic">Binding type: </SPAN>
<xsl:value-of select="BOOK/BINDING"/><BR/>
<SPAN STYLE="font-style:italic">Number of pages: </SPAN>
<xsl:value-of select="BOOK/PAGES"/>
</xsl:template>
XML-.

XML-, HTML-.
XML- :
<H2>Book Description</H2>
,
<SPAN STYLE="font-style:italic">Author: </SPAN>
, (Author:),
<BR/>
.
XML-
HTML-. HTML-
HTML, .
. , HTML-,
XML-, HTML-.
( , XSL- XML-.) ,
HTML-,
XML, , , .
, HTML,
<BR>, HTML-.
XML-, <BR/>.

XSL-. XSL-
xsl:value-of, :
<xsl:value-of select="BOOK/AUTHOR"/>
XSL- , HTML,
xsl:. XSL-
HTML.
XML,
.
XSL- value-of XML ,

HTML, .
XML- ,
select XSL- value-of.
value-of select "BOOK/AUTHOR",
AUTHOR XML-.
AUTHOR ,
, FIRSTNAME LASTNAME.
, XML-
( BOOK/AUTHOR ),
XML-. ( ,

.)
, , ,
select .
XSL- .

( match="/" ), ""
. (
,
.) ,
BOOK/AUTHOR AUTHOR, BOOK,
. (
select ,
.)
select XSL- value-of,

. ( ,
, select
XML-.)

XML-
( AUTHOR, TITLE, PRICE, BINDING PAGES )
. , value-of
, . ,
, XSL-
, CSS,
, .
, , XSL- ,
XML- XML-
HTML-,
, HTML-. , ,
XSL- , HTML
BODY, HTML-,
.
10.2 HTML 10.1 10.2.

. 10.2.
XML-
<AUTHOR>
<FIRSTNAME>Herman</FIRSTNAME
<LASTNAME>Melville</LASTNAME>
</AUTHOR>
XSL-
<H2>Book Description</H2>
<SPAN STYLE="font-style:italic">Author: </SPAN>
<xsl:value-of select="BOOK/AUTHOR"/><BR/>
HTML
<H2>Book Description</H2>
<SPAN STYLE="font-style:italic">Author: </SPAN>
Hermann Melville
. HTML
HTML (DHTML) Internet Explorer 5, Web,
MSDN: http://msdn.microsoft.com/workshop/author/default.asp.
HTML,
Web-, W3C: http://www.w3.org/TR/REC-html40/.

, (. 10.2), XML-
BOOK. ,
BOOK, , ,
. , , XML-,
:
<INVENTORY>
<BOOK>
<TITLE>The Adventures of Huckleberry Finn</TITLE>
<AUTHOR>
<FIRSTNAME>Mark</FIRSTNAME>
<LASTNAME>Twain</LASTNAME>
</AUTHOR>
<BINDING>mass market paperback</BINDING>
<PAGES>298</PAGES>
<PRICE>$5.49</PRICE>
</BOOK>
<BOOK>
<TITLE>The Adventures of Tom Sawyer</TITLE>
<AUTHOR>
<FIRSTNAME>Mark</FIRSTNAME>
<LASTNAME>Twain</LASTNAME>
</AUTHOR>
<BINDING>mass market paperback</BINDING>
<PAGES>205</PAGES>
<PRICE>$4.75</PRICE>
</BOOK>
<BOOK>
<TITLE>The Ambassadors</TITLE>
<AUTHOR>
<FIRSTNAME>Henry</FIRSTNAME>
<LASTNAME>James</LASTNAME>
</AUTHOR>
<BINDING>mass market paperback</BINDING>
<PAGES>305</PAGES>
<PRICE>$5.95</PRICE>
</BOOK>
</INVENTORY>
, , ,
:
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:template match="/">
<H2>Book Description</H2>
<SPAN STYLE="font-style:italic">Author: </SPAN>
<xsl:value-of select="INVENTORY/BOOK/AUTHOR"/><BR/>
<SPAN STYLE="font-style:italic">Title: </SPAN>
<xsl:value-of select="INVENTORY/BOOK/TITLE"/><BR/>
<SPAN STYLE="font-style:italic">Price: </SPAN>
<xsl:value-of select="INVENTORY/BOOK/PRICE"/><BR/>
<SPAN STYLE="font-style:italic">Binding type: </SPAN>
<xsl:value-of select="INVENTORY/BOOK/BINDING"/><BR/>
<SPAN STYLE="font-style:italic">Number of pages: </SPAN>
<xsl:value-of select="INVENTORY/BOOK/PAGES"/>
</xsl:template>
</xsl:stylesheet>

, . ,
select
, INVENTORY (, "INVENTORY/BOOK/AUTHOR" ).
, , .
, "INVENTORY/BOOK/AUTHOR" AUTHOR
BOOK.
. ,
BOOK, 10.3.

. 10.3.
, XSL for-each,
XML- . XSL- , 10.3,
. XML-,
10.4.
<?xml version="1.0"?>
<!-- File name: XslDemo02.xsl -->
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:template match="/">
<H2>Book Inventory</H2>
<xsl:for-each select="INVENTORY/BOOK">
<SPAN STYLE="font-style:italic">Title: </SPAN>
<xsl:value-of select="TITLE"/><BR />
<SPAN STYLE="font-style:italic">Author: </SPAN>
<xsl:value-of select="AUTHOR"/><BR />
<SPAN STYLE="font-style:italic">Binding type: </SPAN>
<xsl:value-of select="BINDING"/><BR />
<SPAN STYLE="font-style:italic">Number of pages: </SPAN>
<xsl:value-of select="PAGES"/><BR />
<SPAN STYLE="font-style:italic">Price: </SPAN>
<xsl:value-of select="PRICE"/><P />

</xsl:for-each>
</xsl:template>
</xsl:stylesheet>

10.3. XslDemo02.xsl (html, txt)

<?xml version="1.0"?>
<!--

File name: XslDemo.xml -->

<?xml-stylesheet type="text/xsl" href="XslDemo02.xsl"?>


<INVENTORY>
<BOOK>
<TITLE>The Adventures of Huckleberry Finn</TITLE>
<AUTHOR>
<FIRSTNAME>Mark</FIRSTNAME>
<LASTNAME>Twain</LASTNAME>
</AUTHOR>
<BINDING>mass market paperback</BINDING>
<PAGES>298</PAGES>
<PRICE>$5.49</PRICE>
</BOOK>
<BOOK>
<TITLE>The Adventures of Tom Sawyer</TITLE>
<AUTHOR>
<FIRSTNAME>Mark</FIRSTNAME>
<LASTNAME>Twain</LASTNAME>
</AUTHOR>
<BINDING>mass market paperback</BINDING>
<PAGES>205</PAGES>
<PRICE>$4.75</PRICE>
</BOOK>
<BOOK>
<TITLE>The Ambassadors</TITLE>
<AUTHOR>
<FIRSTNAME>Henry</FIRSTNAME>
<LASTNAME>James</LASTNAME>
</AUTHOR>
<BINDING>mass market paperback</BINDING>
<PAGES>305</PAGES>
<PRICE>$5.95</PRICE>
</BOOK>
<BOOK>
<TITLE>The Awakening</TITLE>
<AUTHOR>
<FIRSTNAME>Kate</FIRSTNAME>
<LASTNAME>Chopin</LASTNAME>
</AUTHOR>
<BINDING>mass market paperback</BINDING>
<PAGES>195</PAGES>
<PRICE>$4.95</PRICE>
</BOOK>
<BOOK>
<TITLE>Billy Budd</TITLE>
<AUTHOR>
<FIRSTNAME>Herman</FIRSTNAME>
<LASTNAME>Melville</LASTNAME>
</AUTHOR>
<BINDING>mass market paperback</BINDING>
<PAGES>195</PAGES>

<PRICE>$4.49</PRICE>
</BOOK>
<BOOK>
<TITLE>A Connecticut Yankee in King Arthur's Court</TITLE>
<AUTHOR>
<FIRSTNAME>Mark</FIRSTNAME>
<LASTNAME>Twain</LASTNAME>
</AUTHOR>
<BINDING>mass market paperback</BINDING>
<PAGES>385</PAGES>
<PRICE>$5.49</PRICE>
</BOOK>
<BOOK>
<TITLE>Joan of Arc</TITLE>
<AUTHOR>
<FIRSTNAME>Mark</FIRSTNAME>
<LASTNAME>Twain</LASTNAME>
</AUTHOR>
<BINDING>trade paperback</BINDING>
<PAGES>465</PAGES>
<PRICE>$6.95</PRICE>
</BOOK>
<BOOK>
<TITLE>Leaves of Grass</TITLE>
<AUTHOR>
<FIRSTNAME>Walt</FIRSTNAME>
<LASTNAME>Whitman</LASTNAME>
</AUTHOR>
<BINDING>hardcover</BINDING>
<PAGES>462</PAGES>
<PRICE>$7.75</PRICE>
</BOOK>
<BOOK>
<TITLE>The Legend of Sleepy Hollow</TITLE>
<AUTHOR>
<FIRSTNAME>Washington</FIRSTNAME>
<LASTNAME>Irving</LASTNAME>
</AUTHOR>
<BINDING>mass market paperback</BINDING>
<PAGES>98</PAGES>
<PRICE>$2.95</PRICE>
</BOOK>
<BOOK>
<TITLE>The Marble Faun</TITLE>
<AUTHOR>
<FIRSTNAME>Nathaniel</FIRSTNAME>
<LASTNAME>Hawthorne</LASTNAME>
</AUTHOR>
<BINDING>trade paperback</BINDING>
<PAGES>473</PAGES>
<PRICE>$10.95</PRICE>
</BOOK>
<BOOK>
<TITLE>Moby-Dick</TITLE>
<AUTHOR>
<FIRSTNAME>Herman</FIRSTNAME>
<LASTNAME>Melville</LASTNAME>
</AUTHOR>
<BINDING>hardcover</BINDING>

<PAGES>724</PAGES>
<PRICE>$9.95</PRICE>
</BOOK>
<BOOK>
<TITLE>Passing</TITLE>
<AUTHOR>
<FIRSTNAME>Nella</FIRSTNAME>
<LASTNAME>Larsen</LASTNAME>
</AUTHOR>
<BINDING>trade paperback</BINDING>
<PAGES>165</PAGES>
<PRICE>$5.95</PRICE>
</BOOK>
<BOOK>
<TITLE>The Portrait of a Lady</TITLE>
<AUTHOR>
<FIRSTNAME>Henry</FIRSTNAME>
<LASTNAME>James</LASTNAME>
</AUTHOR>
<BINDING>mass market paperback</BINDING>
<PAGES>256</PAGES>
<PRICE>$4.95</PRICE>
</BOOK>
<BOOK>
<TITLE>Roughing It</TITLE>
<AUTHOR>
<FIRSTNAME>Mark</FIRSTNAME>
<LASTNAME>Twain</LASTNAME>
</AUTHOR>
<BINDING>mass market paperback</BINDING>
<PAGES>324</PAGES>
<PRICE>$5.25</PRICE>
</BOOK>
<BOOK>
<TITLE>The Scarlet Letter</TITLE>
<AUTHOR>
<FIRSTNAME>Nathaniel</FIRSTNAME>
<LASTNAME>Hawthorne</LASTNAME>
</AUTHOR>
<BINDING>trade paperback</BINDING>
<PAGES>253</PAGES>
<PRICE>$4.25</PRICE>
</BOOK>
<BOOK>
<TITLE>The Turn of the Screw</TITLE>
<AUTHOR>
<FIRSTNAME>Henry</FIRSTNAME>
<LASTNAME>James</LASTNAME>
</AUTHOR>
<BINDING>trade paperback</BINDING>
<PAGES>384</PAGES>
<PRICE>$3.35</PRICE>
</BOOK>
</INVENTORY>
10.4. XslDemo.xml (html, txt)

10.3 for-each:
<xsl:for-each select="INVENTORY/BOOK">
<SPAN STYLE="font-style:italic">Title: </SPAN>

<xsl:value-of select="TITLE"/><BR />


<SPAN STYLE="font-style:italic">Author: </SPAN>
<xsl:value-of select="AUTHOR"/><BR />
<SPAN STYLE="font-style:italic">Binding type: </SPAN>
<xsl:value-of select="BINDING"/><BR />
<SPAN STYLE="font-style:italic">Number of pages: </SPAN>
<xsl:value-of select="PAGES"/><BR />
<SPAN STYLE="font-style:italic">Price: </SPAN>
<xsl:value-of select="PRICE"/><P />
</xsl:for-each>
for-each :

, for-each,
XML- , ,
select for-each.
BOOK,
INVENTORY. ,
select for-each, , ,
select value-of ;
for-each ,
select for-each ( /INVENTORY/BOOK
BOOK INVENTORY,
) :
<xsl:stylesheet xmlns:xsl=http://www.w3.org/1999/XSL/Transform>
<xsl:template match="/">

<!-- ""

, "/". -->
<xsl:for-each select="INVENTORY/BOOK">
<!-- /INVENTORY/BOOK. -->
</xsl:for-each>
</xsl:template>
</xsl:stylesheet>
, for-each
, , :
<xsl:value-of select="TITLE"/>
BOOK, ,
, .
10.4 Internet Explorer 5. (
BOOK ; ,
.)

. 10.4.


XML-

XSL- apply-templates.
XSL- , 10.5.
<?xml version="1.0"?>
<!-- File name: XslDemo03.xsl -->
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:template match="/">
<H2>Book Inventory</H2>
<xsl:apply-templates select="INVENTORY/BOOK" />
</xsl:template>
<xsl:template match="BOOK">
<SPAN STYLE="font-style:italic">Title: </SPAN>
<xsl:value-of select="TITLE"/><BR/>
<SPAN STYLE="font-style:italic">Author: </SPAN>
<xsl:value-of select="AUTHOR"/><BR/>

<SPAN STYLE="font-style:italic">Binding type: </SPAN>


<xsl:value-of select="BINDING"/><BR/>
<SPAN STYLE="font-style:italic">Number of pages: </SPAN>
<xsl:value-of select="PAGES"/><BR/>
<SPAN STYLE="font-style:italic">Price: </SPAN>
<xsl:value-of select="PRICE"/><P/>
</xsl:template>
</xsl:stylesheet>
10.5. XslDemo03.xsl (html, txt)

XML- 10.4,
XslDemo.xml; xmlstylesheet :
<?xml-stylesheet type="text/xsl" href="XslDemo03.xsl"?>
.
( match="/",
). XSL-
.
BOOK ( match="BOOK" ).
, :
<xsl:template match="/">
<H2>Book Inventory</H2>
<xsl:apply-templates select="INVENTORY/BOOK" />
</xsl:template>
XSL- apply-templates , BOOK
INVENTORY ,
BOOK . . , match "BOOK".
, BOOK:
<xsl:template match="BOOK">
<SPAN STYLE="font-style:italic">Title: </SPAN>
<xsl:value-of select="TITLE"/><BR/>
<SPAN STYLE="font-style:italic">Author: </SPAN>
<xsl:value-of select="AUTHOR"/><BR/>
<SPAN STYLE="font-style:italic">Binding type: </SPAN>
<xsl:value-of select="BINDING"/><BR/>
<SPAN STYLE="font-style:italic">Number of pages: </SPAN>
<xsl:value-of select="PAGES"/><BR/>
<SPAN STYLE="font-style:italic">Price: </SPAN>
<xsl:value-of select="PRICE"/><P/>
</xsl:template>
BOOK, BOOK
. BOOK
, , :
<xsl:value-of select="TITLE"/>
. select apply-templates,
( )
. applytemplates (
) INVENTORY, .
, select, .
BOOK BOOK,
, , 10.5.

. 10.5.

XML
XSL-
XML.
, .

, match select,
, XML-.
( match template, select
value-of, for-each apply-templates.) ,
, , , ,
.
, , ,
( [] ) . , ,
match, ,
BOOK, ( ),
BINDING, "trade paperback":
<xsl:template match="BOOK[BINDING='trade paperback']">

,
. ,
ITEM, CD,
CD:
match="ITEM[CD]"
SHIRT, COLOR,
"red":
match="SHIRT[COLOR='red']"
, , SHIRT,
COLOR, "red":
select="SHIRT[COLOR!='red']"
. ,
,
. , SHIRT COLOR,
"SHIRT[COLOR='red']" ,
COLOR "red".

,
: for-each apply-templates.
order-by , ,
, XML.
order-by ,
.
, . (
) + .
, order-by, for-each,
BOOK
, ,
:
<xsl:for-each select="INVENTORY/BOOK"
order-by="+AUTHOR/LASTNAME; +AUTHOR/FIRSTNAME">
order-by
BOOK :
<xsl:apply-templates select="INVENTORY/BOOK" order-by="-TITLE">
, order-by,
, select. , order-by="TITLE" TITLE BOOK,
INVENTORY.

XML

XSL , XML-, .
XSL
@, , , .
, BOOK
InStock, "yes". , ,
:
<xsl:for-each select="INVENTORY/BOOK[@InStock='yes']">
XSL- value-of
, . ,
value-of Born,
AUTHOR:
<xsl:value-of select="AUTHOR/@Born"/>
, 10.8,
, XML-.
XML- 10.9
.
<?xml version="1.0"?>
<!-- File name: XslDemo06.xsl -->
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:template match="/">
<H2>Books In Stock</H2>
<TABLE BORDER="1" CELLPADDING="5">
<THEAD>
<TH>Title</TH>
<TH>Author</TH>
<TH>Binding Type</TH>
<TH>Number of Pages</TH>
<TH>Price</TH>
</THEAD>
<xsl:for-each select="INVENTORY/BOOK[@InStock='yes']">
<TR ALIGN="CENTER">
<TD>
<xsl:value-of select="TITLE"/>
</TD>
<TD>
<xsl:value-of select="AUTHOR"/> <BR/>
(born <xsl:value-of select="AUTHOR/@Born"/>)
</TD>
<TD>
<xsl:value-of select="BINDING"/>
</TD>
<TD>
<xsl:value-of select="PAGES"/>
</TD>
<TD>
<xsl:value-of select="PRICE"/>
</TD>
</TR>
</xsl:for-each>
</TABLE>
</xsl:template>

</xsl:stylesheet>

10.8. XslDemo06.xsl (html, txt)

<?xml version="1.0"?>
<!-- File name: XslDemo06.xml -->
<?xml-stylesheet type="text/xsl" href="XslDemo06.xsl"?>
<INVENTORY>
<BOOK InStock="yes">
<TITLE>The Adventures of Huckleberry Finn</TITLE>
<AUTHOR Born="1835">Mark Twain</AUTHOR>
<BINDING>mass market paperback</BINDING>
<PAGES>298</PAGES>
<PRICE>$5.49</PRICE>
</BOOK>
<BOOK InStock="no">
<TITLE>Leaves of Grass</TITLE>
<AUTHOR Born="1819">Walt Whitman</AUTHOR>
<BINDING>hardcover</BINDING>
<PAGES>462</PAGES>
<PRICE>$7.75</PRICE>
</BOOK>
<BOOK InStock="yes">
<TITLE>The Marble Faun</TITLE>
<AUTHOR Born="1804">Nathaniel Hawthorne</AUTHOR>
<BINDING>trade paperback</BINDING>
<PAGES>473</PAGES>
<PRICE>$10.95</PRICE>
</BOOK>
<BOOK InStock="yes">
<TITLE>Moby-Dick</TITLE>
<AUTHOR Born="1819">Herman Melville</AUTHOR>
<BINDING>hardcover</BINDING>
<PAGES>724</PAGES>
<PRICE>$9.95</PRICE>
</BOOK>
</INVENTORY>
10.9. XslDemo06.xml (html, txt)

BOOK XML- InStock,


"yes" "no", .
AUTHOR Born, .
InStock
BOOK ,
:
<xsl:for-each select="INVENTORY/BOOK[@InStock='yes']">
<!-- BOOK -->
</xsl:for-each>
BOOK HTML-,
SPAN, .
Born AUTHOR, XSL- value-of.
:
<TD>

<xsl:value-of select="AUTHOR"/> <BR/>


(born <xsl:value-of select="AUTHOR/@Born"/>)

</TD>
10.7 Internet Explorer 5 .