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

XSLT XLink

.., ..
,

lizorkin@hotbox.ru
lisovsky@acm.org

XSLT  XML- XML-. XLink 


XML- .
XSLT XLink .
XSLT XLink
. XSLT- STX XLink- SXLink,
.
SXML  XML Infoset S-.
STX SXLink
XML .

XSLT [1]  XML- , .


XML HTML.
XML- .
() , XML
[2].
, XML , ,
, .
, XML- ,
, HTML-, .
XSLT, (World Wide Web Consortium),
.
XSL
(stylesheet), XML.
: , ,
, .
, ,
, ..
( )
(, ). ,
.
, ,
. XML Linking Language
(XLink) [3], ,
: XML
.
, XLink ,
- . ,
(, ,
), XLink
.
1

2 3 XSLT XLink . 4 ,
XSLT, STX 
XSLT . 5
XLink  SXLink. 6 XSLT
XLink .

XSLT

XSL (XSLT) 
XML. XSLT , ,
XML- , .
XSLT  ,
XML, ,
XML-.
XSLT [4], XSLT .
XSLT (well-formed)
XML- [5]. XML-, XSLT,
XML [6].
, XSLT ( ),
.
. .

, .
. : ,
, ,
.
:

 XPath, .
, ,
XPath- .
 ,
. ,
, , .
,
. XML-,
; XSLT,
.
.
,
.
,
. XML, (data-centric XML documents).
1 XSLT.
, XML-, XHTML.
xsl:stylesheet XSLT
"http://www.w3.org/1999/XSL/Transform". XSLT,
xsl:template.
1 . ,
XPath match . . 1
title, doc. ,
, ( ),
, xsl:template.
1, (
XSLT xsl:apply-templates),

<xsl:stylesheet version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:template match="doc/title">
<h1>
<xsl:apply-templates/>
</h1>
</xsl:template>
<!-- - -->
</xsl:stylesheet>
. 1: XHTML.
.
. , title, doc,
, , .

XLink

XML Linking Language (XLink)  XML.


XLink HTML, :
,
, [7].
XLink , XML-.
IETF RFC 2396 .
(well-formed) XML-,
XLink ,
XML Pointer Language (XPointer).
,
(URI).
XLink .
1. (extended link).
XLink, (inbound) (third-party) ,
.
.
XLink,  XML-,
, . ,
,
URI, (remote), XML-,
, .
, ,
, ; ,
; , ; ,
.
" " ,
(, ). ,
, ;
,
;
, ( ).

<!-- XLink. -->


<MyExtendedLink xmlns:xlink="http://www.w3.org/1999/xlink" xlink:type="extended">
<!-- . ( XLink) -->
<author xlink:type="resource" xlink:label="A">
<!-- , -->
<name>John</name>
<surname>Smith</surname>
</author>
<!-- . URI-->
<book xlink:type="locator" xlink:label="B"
xlink:href="http://library.com/book.xml"/>
<publisher xlink:type="locator" xlink:label="P"
xlink:href="http://publisher.com"/>
<!-- . "A" "B"-->
<MyArcElement xlink:type="arc" xlink:from="A" xlink:to="B"/>
<MyArcElement xlink:type="arc" xlink:from="B" xlink:to="P"/>
</MyExtendedLink>
. 2: XLink.
( ), ( ) ( ).
XLink ,
(linkbases).
, XLink- .
2 XLink.
, .
XLink, ..
.  XLink,
.
(label). .
: .
(arc). , ,
, .
2. (simple link)  , 
; , . ,
(outbound). ,
, (,
A IMG HTML).
, , -
.
,
. ,
.

. " "
" ", "", "" "".
, ,
.

<!-- XLink. -->


<MySimpleLink
xmlns:xlink="http://www.w3.org/1999/xlink"
xlink:type="simple"
xlink:href="http://library.com/book.xml#xpointer(doc/contents)">
Go to table of contents
<!--- -->
</MySimpleLink>
. 3: XLink
3. ,
A HTML. , HTML,
XLink ,
XPointer .
, XLink
, .
,
XLink.

STX: XSLT


XML/SXML-.

(Document-Style Semantics and Specication Language, DSSSL) [8];
, SXML [9, 10].
STX  XML, XSLT
, XSLT
. STX XML-.
STX  XSLT 
SXML.
STX SXSLT [11], ,
XSLT. , STX , SXSLT,
XML/SXML- XSLT.
4.1

XSLT

XSLT , , XSLT
XSL [1]. XML- XSLT
, Java
Python, , -
.
XSLT , XML
S- [12].
XML, XSLT.
XSLT  ,
. ,
"" XSLT
XML-. XSLT [13] ,
XSLT .
STX XSLT
. , XSLT ,
, , - .

XML


-
- XML

6

()


XSLT

6@
I
@

@
@
XSLT/

Figure 1: STX. STX , XSLT, ,


.
XSLT
XSLT,
, .
4.2

STX

XSLT XPath [14],


XML Infoset [15] .
STX SXML, SXML
XML S-.
SXML XPath.
SXML [12],
XML-. , , XML- SSAX
SXML SXPath, STX. SXML, XPath
XML, .
[16], ,
. STX SXML.
STX XSLT.
, , ,
XPath. STX ,
SXPath  XPath [17]. STX
SXPath ; , ;
, ,
,
. ,  .
XSLT STX.

STX.
XSLT , , 
,
[18]. STX . ,
SXPath ;
.
( stx:template), XSLT (
xsl:template). , XSLT " "
, . 1.
STX "" XSLT.

XSLT , . ,
, "" , ,
.
,
(), (XSLT).
XSLT ,
: XSLT .
XML-,
. ,
, , ,
.

XLink : SXLink

SXLink  XLink (Application Program


Interface, API) . SXLink
XLink,
, XLink.
5.1

XLink

XLink ,
.
XML- XLink - ,
.
, S-
XLink  SXML.
XML-
, SXLink.
, , XLink,
.
S-, ..
.
5.2

SXLink

SXLink SSAX,
XLink, XML-, SXML.
XLink ,
SXLink .
3, XLink
,
.

SXLink. ,
SXLink:
1. . ,
XLink , ..

, , ;
,
XPointer, ;
( ) / XLink
.
,
XLink .
, SXLink,
, XML .

2. . XLink .
( " ")
XLink,
, .
, HTML
.
3. . .
, (starting
resource) (ending resource).
,
, ,
.
SXLink
.

XSLT XLink

XSLT XLink,
XML-.
XSLT XLink
, STX SXLink.
6.1

2, XSLT
, . XSLT
XML-,
.
XLink .
XLink , [7],
:

XSLT,
XML-, ,
XML- ( ).
XSLT, XLink,
XSLT XML-.
XSLT STX SXLink,
(SXML) ( SXPath).
6.2

XSLT
XLink

XLink (view)
( ).
XLink ,
, .
XLink arcrole XLink,
.
arcrole [19],
, "- -
-". XLink [3], arcrole
, ,
.

<link-to-a-book
xmlns:xlink="http://www.w3.org/1999/xlink"
xlink:type="simple"
xlink:href="http://library.com/book.xml"
xlink:arcrole="http://library.com/transform.xsl"/>
. 4: XSLT,
( )
XLink arcrole 
XSLT. arcrole ,
.
4. XLink ,
arcrole , ,
. , HTML.
, , .
, , , XSLT,

. arcrole,
XLink.
SXLink , SXLink
XLink , , arcrole, SXLink
STX .
6.3

XSL- XML-

, XSLT,
XML-. , XSLT
XLink.
XML-, ,
, . XLink
XSLT  , .. XLink ,
 . , ,
XLink, XLink-, XSLT-.
, XSLT
XML-.
, XML Path (
XSLT). traverse (),
, XLink .
XSL-,
.
5 XSL,
, XML. traverse
, , (node) ,
XLink (book). , XML. traverse
(xsl:value-of),
(xsl:apply-templates).

XSLT XLink XML-.


XML .
XML-, ,
.

<xsl:template match="node()[traverse::book]">
...
<xsl:value-of select="traverse::book/title"/>
...
<xsl:apply-templates select="traverse::book/chapter/section"/>
...
</xsl:template>
. 5: XSL, XLink
XML- STX,
XSLT, XLink- SXLink. STX SXLink
XML . XSLT XLink
, STX SXLink
.


[1] XSL (XSLT) 1.0. W3C 16 1999.
http://www.rol.ru/news/it/helpdesk/xslt01.htm
[2] Cuneiform Digital Library Initiative to Use XML Encoding for Third Millennium Texts.
http://xml.coverpages.org/ni2001-11-06-c.html
[3] XML Linking Language (XLink) Version 1.0. W3C Recommendation 27 June 2001.
http://www.w3.org/TR/xlink/
[4] XSLT Requirements Version 2.0. W3C Working Draft, February 2001.
http://www.w3.org/TR/2001/WD-xslt20req-20010214
[5] Extensible Markup Language (XML) 1.0 (Second Edition). W3C Recommendation 6 October 2000.
http://www.w3.org/TR/REC-xml
[6] Namespaces in XML. World Wide Web Consortium 14-January-1999.
http://www.w3.org/TR/REC-xml-names/
[7] XML XLink Requirements Version 1.0. W3C Note 24-Feb-1999.
http://www.w3.org/TR/NOTE-xlink-req/
[8] Document Style Semantics and Specication Language (DSSSL). ISO/IEC 10179:1996(E).
ftp://ftp.ornl.gov/pub/sgml/WG8/DSSSL/dsssl96b.pdf
[9] Kiselyov O. XML and Scheme. Workshop on Scheme and Functional Programming 2000, Montreal, 2000.
http://www.okmij.org/ftp/Scheme/SXML-short-paper.html
[10] Oleg Kiselyov, Shriram Krishnamurthi. SXSLT: Manipulation Language for XML. Practical Aspects of
Declarative Languages, 5th International Symposium, PADL 2003.
http://link.springer.de/link/service/series/0558/bibs/2562/25620256.htm
[11] O. Kiselyov, K.Lisovsky. XML, XPath, XSLT Implementation as SXML, SXPath and SXSLT. International Lisp Conference ILC 2002, San Francisco. October, 2002.
http://www.okmij.org/ftp/papers/SXs.pdf
[12] Oleg Kiselyov. SXML, Revision 2.5. August 9, 2002.
http://okmij.org/ftp/Scheme/SXML.html
[13] D. Jacobs. Rescuing XSLT from Niche Status. http://www.xfront.com/rescuing-xslt.html
[14] XML Path (XPath) 1.0. W3C 16 1999.
http://www.xpath.info/docs/REC-xpath-19991116-ru.html

[15] XML Information Set. W3C Recommendation 24 October 2001.


http://www.w3.org/TR/xml-infoset/
[16] Kirill Lisovsky. STX: Scheme-enabled XSLT processor.
http://www.pair.com/lisovsky/transform/stx/
[17] .. , .. . XML Path (XPath)
SXPath. , 2003, 6, 4.
http://www.elbib.ru/index.phtml?page=elbib/rus/journal/2003/part4/LL
[18] M. Kay. What kind of language is XSLT? February 2001.
http://www-106.ibm.com/developerworks/xml/library/x-xslt/
[19] Resource Description Framework (RDF): Concepts and Abstract Syntax. W3C Working Draft 23 January
2003.
http://www.w3.org/TR/rdf-concepts/