XSL भाषा पर बहुत सारे दस्तावेज़ ऑनलाइन उपलब्ध हैं। यह खंड भाषा के दस्तावेज होने का दिखावा नहीं करता है, लेकिन केवल संक्षेप में, चरण दर चरण यह बताता है कि अपना खुद का XSLT टेम्पलेट कैसे बनाया जाए।
नीचे वर्णित योजना का मेरे द्वारा 3 वर्षों से अधिक समय से सफलतापूर्वक उपयोग किया जा रहा है। सबसे पहले, मैं
एक्सएसएलटी से बहुत सावधान था (विशेषकर जब मैं अन्य लोगों के स्रोतों को नष्ट कर रहा था), लेकिन एक बार मुझे एहसास हुआ कि मैं कल्पना नहीं कर सकता कि आप इसके बिना कैसे काम कर सकते हैं।
काम की मेज
परिभाषित करें कि हमें क्या काम करना है:
- XML इनपुट दस्तावेज़
- XHTML लेआउट टेम्पलेट
- एक्सएमएल के साथ एक्सएमएल ग्लूइंग के लिए एक्सएमएल पार्सर
मेरे पास सीएमएस-सिस्टम द्वारा जारी एक
एक्सएमएल इनपुट डॉक्यूमेंट है, जिसमें सामग्री के साथ प्रत्येक पृष्ठ को
एक्सएमएल-ट्री में इकट्ठा किया गया है।
XHTML लेआउट पर कोई प्रतिबंध नहीं हैं। लेआउट के लिए केवल कुछ सिफारिशें हैं, जो टेम्पलेट के गठन पर समय की बचत करेगा।
आप अंतिम दस्तावेज़ के एक पार्सर (कलेक्टर) के रूप में एक ब्राउज़र का उपयोग कर सकते हैं। आपको बस
XML दस्तावेज़ों में टेम्प्लेट फ़ाइल का पथ निर्दिष्ट करना होगा:
<?xml-stylesheet type="text/xsl" href="template.xsl" ?>
यद्यपि, जैसा कि अभ्यास से पता चला है, यह तंत्र काफी छोटा है (मुझे
IE का उपयोग करना पड़ा)। भाषा के
XML पार्सिंग टूल का उपयोग करना बेहतर है जिसमें सीएमएस सिस्टम लिखा गया है। मैं
पार्सर का उपयोग करता हूं (इस पर, वास्तव में, मेरे पास पूरी प्रणाली काम कर रही है)।
XML इनपुट दस्तावेज़
सबसे पहले, चलो इनपुट
एक्सएमएल दस्तावेज़ का पता
लगाते हैं ।
XSL का उपयोग करने के लिए आपको इसकी संरचना की पूरी समझ होनी चाहिए।
मैं निम्नलिखित योजना का उपयोग करता हूं:
<?xml version="1.0" encoding="windows-1251"?>
<lang_table>
/>
</lang_table>
<item id="0" parent_id="0" is_published="1" section="1">
/
<item id="1" parent_id="0" is_published="1" section="1">
news
ऊपर वर्णित उदाहरण सर्किट इष्टतम होने का दावा नहीं करता है। एक कारण या किसी अन्य के लिए, यह मेरे लिए सुविधाजनक है। लेकिन, पहली चीजें पहले।
<?xml version="1.0" encoding="windows-1251"?>
-
XML फ़ाइल का शीर्षलेख। फ़ाइल की शुरुआत से सख्ती से जाना चाहिए। इसमें उपयोग की गई XML भाषा का संस्करण और दस्तावेज़ की एन्कोडिंग शामिल है। मैं आमतौर पर
विंडोज़ -1251 (अब तक अधिक सुविधाजनक) में काम करता हूं, लेकिन, सिद्धांत रूप में,
यूटीएफ -8 बेहतर है।
- ( ). :
Lang - . . Id - .
<lang_table> - , .
- :
- ( ):
<item id="0" parent_id="0" is_published="1" section="1">
- . :
Id - . Parent_id - . Is_published - . Dir - uri- . . Section - . .
- .
CMS : :
Html - . , . Com - -. , CMS: , , ..
XSL- , . .
CMS , :
:
Id - .
Container - - ( ).
Sorting - .
Type - :
Com - -
Html - .
Method - .
Title - .
DTD ( ):
<!DOCTYPE site_page [
<!ENTITY nbsp " ">
<!ENTITY sect "§" >
<!ENTITY copy "©">
<!ENTITY laquo "«">
<!ENTITY reg "®">
<!ENTITY deg "°">
<!ENTITY plusmn "±">
<!ENTITY para "¶">
<!ENTITY raquo "»">
<!ENTITY times "×">
<!ENTITY bull "•">
<!ENTITY hellip "…">
<!ENTITY ndash "–">
<!ENTITY mdash "—">
<!ENTITY lsquo "'">
<!ENTITY rsquo "'">
<!ENTITY sbquo "‚">
<!ENTITY ldquo "“">
<!ENTITY rdquo "”">
<!ENTITY bdquo "„">
<!ENTITY lsaquo "‹">
<!ENTITY rsaquo "›" >
<!ENTITY euro "€">
]>
XML- . <?xml version="1.0" encoding="windows-1251"?>
.
XHML-
XSL- XHTML- ( ). XHTML-, , .
.
XHML- , , :
( ). - , . / .
HTML-:
...
...
...
...
...
XSL-
XSL- :
<xsl:stylesheet version = '1.0' encoding="UTF-8"?>
<xsl:template match="element">
</xsl:template>
</xsl:stylesheet>
: <xsl:stylesheet version = '1.0' encoding="UTF-8"?>
- XML- . UTF-8 ( , ).
<xsl:stylesheet> </xsl:stylesheet>
- XSL-.
<xsl:template match="element"> </xsl:template>
- element.
:
<xsl:template match="element"></xsl:template>
- , element . element . <xsl:template match="element" mode="mode1"></xsl:template>
- , element mode1 . element . <xsl:template name="template-name"></xsl:template>
- template-name . - XML- .
XML- (, XML-, item ), " " :
<xsl:template match="navigation/sections/item"></xsl:template>
, , .., , , , .. navigation , navigation/sections/item sections/item .
, - . , xsl- . .
xsl .
, ( ) :
template_folder - . , my_template . dtd - . . lang - ( ). mod - .
xsl/my_template , layout.xsl :
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE xsl:stylesheet SYSTEM "../dtd/entities.dtd">
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:template match="/node()">
</xsl:template>
</xsl:stylesheet>
:
<xsl:template match="/node()"> </xsl:template>
- /node() (). /node() //document , .. .
XHTML- <xsl:template match="/node()"></xsl:template>
XML- . , XSL- XML- XHTML- .
, XSL template.xsl (, template - ), :
<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:import href=" my_template /layout.xsl"/>
</xsl:stylesheet>
:
<xsl:import href="my_template/layout.xsl"/>
XSL- ( XSL- ) . .
, .. XML- .
- .
, XML- :
<item id="0" parent_id="0" is_published="1" section="1">
/
<item id="1" parent_id="0" is_published="1" section="1" hit="yes">
news
:
id document - id . hit item - , , " ".
, , :
sections - . item - .
, , item item , , :
1. xsl/my_template navigation.xsl :
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE xsl:stylesheet SYSTEM "../dtd/entities.dtd">
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:template match="sections" mode="global_menu">
</xsl:template>
</xsl:stylesheet>
2. layout.xsl :
<xsl:template match="sections" mode="global_menu">
</xsl:template>
3. … layout.xsl :
<xsl:apply-templates select="navigation/sections" mode="global_menu"/>
:
select="navigation/sections" - ( ) - . , navigation/sections .
mode="global_menu" - global_menu . , , , " ", - .
4. , layout.xsl navigation.xsl :
<xsl:import href="navigation.xsl"/>
5. , navigation.xsl , :
<xsl:template match="item" mode="global_menu">
<xsl:call-template name="href_attribute"/>
<xsl:value-of select="title"/>
</xsl:template>
:
<xsl:call-template name="href_attribute"/>
- . , .. .
<xsl:value-of select="title"/>
- - title . @ - .
6. sections :
<xsl:template match="sections" mode="global_menu">
</xsl:template>
:
<xsl:apply-templates select="item" mode="global_menu"/>
- item sections . , item item ( sections/item/item ) , .. .
item ( ) . , : <xsl:call-template name="href_attribute"/>
uri- . .
7. ,
, . item :
<xsl:template match="item" mode="global_menu">
<xsl:choose>
<xsl:when test="descendant-or-self::*/@id = /node()/@id">
<xsl:value-of select="title"/>
</xsl:when>
<xsl:otherwise>
<xsl:call-template name="href_attribute"/>
<xsl:value-of select="title"/>
</xsl:otherwise>
</xsl:choose>
</xsl:template>
:
<xsl:choose>
<xsl:when></xsl:when>
<xsl:otherwise></xsl:otherwise>
</xsl:choose>
…, , XML- . : <xsl:when test="descendant-or-self::*/@id = /node()/@id">
ID ( document ) ( item ), , .
<xsl:when></xsl:when>
, . <xsl:otherwise></xsl:otherwise>
- .
8. , href_attribute :
<xsl:template name="href_attribute">
<xsl:attribute name="href">
<xsl:text>/</xsl:text>
<xsl:for-each select="ancestor-or-self::item">
<xsl:value-of select="dir"/>
<xsl:text>/</xsl:text>
</xsl:for-each>
</xsl:attribute>
</xsl:template>
xsl:attribute . . a , , href , .. .
<xsl:for-each select="ancestor-or-self::item">
, . ancestor-or-self::item - . dir , .. -.
, - , . , .
UPD:
. , :
parser.proc.ru/iso/xslt-1.zip
( ) Apache.
XML- /xsl/document.xml
- ( ). :
Lang - . . Id - .
<lang_table> - , .
- :
- ( ):
<item id="0" parent_id="0" is_published="1" section="1">
- . :
Id - . Parent_id - . Is_published - . Dir - uri- . . Section - . .
- .
CMS : :
Html - . , . Com - -. , CMS: , , ..
XSL- , . .
CMS , :
:
Id - .
Container - - ( ).
Sorting - .
Type - :
Com - -
Html - .
Method - .
Title - .
DTD ( ):
<!DOCTYPE site_page [
<!ENTITY nbsp " ">
<!ENTITY sect "§" >
<!ENTITY copy "©">
<!ENTITY laquo "«">
<!ENTITY reg "®">
<!ENTITY deg "°">
<!ENTITY plusmn "±">
<!ENTITY para "¶">
<!ENTITY raquo "»">
<!ENTITY times "×">
<!ENTITY bull "•">
<!ENTITY hellip "…">
<!ENTITY ndash "–">
<!ENTITY mdash "—">
<!ENTITY lsquo "'">
<!ENTITY rsquo "'">
<!ENTITY sbquo "‚">
<!ENTITY ldquo "“">
<!ENTITY rdquo "”">
<!ENTITY bdquo "„">
<!ENTITY lsaquo "‹">
<!ENTITY rsaquo "›" >
<!ENTITY euro "€">
]>
XML- . <?xml version="1.0" encoding="windows-1251"?>
.
XHML-
XSL- XHTML- ( ). XHTML-, , .
.
XHML- , , :
( ). - , . / .
HTML-:
...
...
...
...
...
XSL-
XSL- :
<xsl:stylesheet version = '1.0' encoding="UTF-8"?>
<xsl:template match="element">
</xsl:template>
</xsl:stylesheet>
: <xsl:stylesheet version = '1.0' encoding="UTF-8"?>
- XML- . UTF-8 ( , ).
<xsl:stylesheet> </xsl:stylesheet>
- XSL-.
<xsl:template match="element"> </xsl:template>
- element.
:
<xsl:template match="element"></xsl:template>
- , element . element . <xsl:template match="element" mode="mode1"></xsl:template>
- , element mode1 . element . <xsl:template name="template-name"></xsl:template>
- template-name . - XML- .
XML- (, XML-, item ), " " :
<xsl:template match="navigation/sections/item"></xsl:template>
, , .., , , , .. navigation , navigation/sections/item sections/item .
, - . , xsl- . .
xsl .
, ( ) :
template_folder - . , my_template . dtd - . . lang - ( ). mod - .
xsl/my_template , layout.xsl :
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE xsl:stylesheet SYSTEM "../dtd/entities.dtd">
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:template match="/node()">
</xsl:template>
</xsl:stylesheet>
:
<xsl:template match="/node()"> </xsl:template>
- /node() (). /node() //document , .. .
XHTML- <xsl:template match="/node()"></xsl:template>
XML- . , XSL- XML- XHTML- .
, XSL template.xsl (, template - ), :
<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:import href=" my_template /layout.xsl"/>
</xsl:stylesheet>
:
<xsl:import href="my_template/layout.xsl"/>
XSL- ( XSL- ) . .
, .. XML- .
- .
, XML- :
<item id="0" parent_id="0" is_published="1" section="1">
/
<item id="1" parent_id="0" is_published="1" section="1" hit="yes">
news
:
id document - id . hit item - , , " ".
, , :
sections - . item - .
, , item item , , :
1. xsl/my_template navigation.xsl :
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE xsl:stylesheet SYSTEM "../dtd/entities.dtd">
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:template match="sections" mode="global_menu">
</xsl:template>
</xsl:stylesheet>
2. layout.xsl :
<xsl:template match="sections" mode="global_menu">
</xsl:template>
3. … layout.xsl :
<xsl:apply-templates select="navigation/sections" mode="global_menu"/>
:
select="navigation/sections" - ( ) - . , navigation/sections .
mode="global_menu" - global_menu . , , , " ", - .
4. , layout.xsl navigation.xsl :
<xsl:import href="navigation.xsl"/>
5. , navigation.xsl , :
<xsl:template match="item" mode="global_menu">
<xsl:call-template name="href_attribute"/>
<xsl:value-of select="title"/>
</xsl:template>
:
<xsl:call-template name="href_attribute"/>
- . , .. .
<xsl:value-of select="title"/>
- - title . @ - .
6. sections :
<xsl:template match="sections" mode="global_menu">
</xsl:template>
:
<xsl:apply-templates select="item" mode="global_menu"/>
- item sections . , item item ( sections/item/item ) , .. .
item ( ) . , : <xsl:call-template name="href_attribute"/>
uri- . .
7. ,
, . item :
<xsl:template match="item" mode="global_menu">
<xsl:choose>
<xsl:when test="descendant-or-self::*/@id = /node()/@id">
<xsl:value-of select="title"/>
</xsl:when>
<xsl:otherwise>
<xsl:call-template name="href_attribute"/>
<xsl:value-of select="title"/>
</xsl:otherwise>
</xsl:choose>
</xsl:template>
:
<xsl:choose>
<xsl:when></xsl:when>
<xsl:otherwise></xsl:otherwise>
</xsl:choose>
…, , XML- . : <xsl:when test="descendant-or-self::*/@id = /node()/@id">
ID ( document ) ( item ), , .
<xsl:when></xsl:when>
, . <xsl:otherwise></xsl:otherwise>
- .
8. , href_attribute :
<xsl:template name="href_attribute">
<xsl:attribute name="href">
<xsl:text>/</xsl:text>
<xsl:for-each select="ancestor-or-self::item">
<xsl:value-of select="dir"/>
<xsl:text>/</xsl:text>
</xsl:for-each>
</xsl:attribute>
</xsl:template>
xsl:attribute . . a , , href , .. .
<xsl:for-each select="ancestor-or-self::item">
, . ancestor-or-self::item - . dir , .. -.
, - , . , .
UPD:
. , :
parser.proc.ru/iso/xslt-1.zip
( ) Apache.
XML- /xsl/document.xml
- ( ). :
Lang - . . Id - .
<lang_table> - , .
- :
- ( ):
<item id="0" parent_id="0" is_published="1" section="1">
- . :
Id - . Parent_id - . Is_published - . Dir - uri- . . Section - . .
- .
CMS : :
Html - . , . Com - -. , CMS: , , ..
XSL- , . .
CMS , :
:
Id - .
Container - - ( ).
Sorting - .
Type - :
Com - -
Html - .
Method - .
Title - .
DTD ( ):
<!DOCTYPE site_page [
<!ENTITY nbsp " ">
<!ENTITY sect "§" >
<!ENTITY copy "©">
<!ENTITY laquo "«">
<!ENTITY reg "®">
<!ENTITY deg "°">
<!ENTITY plusmn "±">
<!ENTITY para "¶">
<!ENTITY raquo "»">
<!ENTITY times "×">
<!ENTITY bull "•">
<!ENTITY hellip "…">
<!ENTITY ndash "–">
<!ENTITY mdash "—">
<!ENTITY lsquo "'">
<!ENTITY rsquo "'">
<!ENTITY sbquo "‚">
<!ENTITY ldquo "“">
<!ENTITY rdquo "”">
<!ENTITY bdquo "„">
<!ENTITY lsaquo "‹">
<!ENTITY rsaquo "›" >
<!ENTITY euro "€">
]>
XML- . <?xml version="1.0" encoding="windows-1251"?>
.
XHML-
XSL- XHTML- ( ). XHTML-, , .
.
XHML- , , :
( ). - , . / .
HTML-:
...
...
...
...
...
XSL-
XSL- :
<xsl:stylesheet version = '1.0' encoding="UTF-8"?>
<xsl:template match="element">
</xsl:template>
</xsl:stylesheet>
: <xsl:stylesheet version = '1.0' encoding="UTF-8"?>
- XML- . UTF-8 ( , ).
<xsl:stylesheet> </xsl:stylesheet>
- XSL-.
<xsl:template match="element"> </xsl:template>
- element.
:
<xsl:template match="element"></xsl:template>
- , element . element . <xsl:template match="element" mode="mode1"></xsl:template>
- , element mode1 . element . <xsl:template name="template-name"></xsl:template>
- template-name . - XML- .
XML- (, XML-, item ), " " :
<xsl:template match="navigation/sections/item"></xsl:template>
, , .., , , , .. navigation , navigation/sections/item sections/item .
, - . , xsl- . .
xsl .
, ( ) :
template_folder - . , my_template . dtd - . . lang - ( ). mod - .
xsl/my_template , layout.xsl :
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE xsl:stylesheet SYSTEM "../dtd/entities.dtd">
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:template match="/node()">
</xsl:template>
</xsl:stylesheet>
:
<xsl:template match="/node()"> </xsl:template>
- /node() (). /node() //document , .. .
XHTML- <xsl:template match="/node()"></xsl:template>
XML- . , XSL- XML- XHTML- .
, XSL template.xsl (, template - ), :
<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:import href=" my_template /layout.xsl"/>
</xsl:stylesheet>
:
<xsl:import href="my_template/layout.xsl"/>
XSL- ( XSL- ) . .
, .. XML- .
- .
, XML- :
<item id="0" parent_id="0" is_published="1" section="1">
/
<item id="1" parent_id="0" is_published="1" section="1" hit="yes">
news
:
id document - id . hit item - , , " ".
, , :
sections - . item - .
, , item item , , :
1. xsl/my_template navigation.xsl :
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE xsl:stylesheet SYSTEM "../dtd/entities.dtd">
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:template match="sections" mode="global_menu">
</xsl:template>
</xsl:stylesheet>
2. layout.xsl :
<xsl:template match="sections" mode="global_menu">
</xsl:template>
3. … layout.xsl :
<xsl:apply-templates select="navigation/sections" mode="global_menu"/>
:
select="navigation/sections" - ( ) - . , navigation/sections .
mode="global_menu" - global_menu . , , , " ", - .
4. , layout.xsl navigation.xsl :
<xsl:import href="navigation.xsl"/>
5. , navigation.xsl , :
<xsl:template match="item" mode="global_menu">
<xsl:call-template name="href_attribute"/>
<xsl:value-of select="title"/>
</xsl:template>
:
<xsl:call-template name="href_attribute"/>
- . , .. .
<xsl:value-of select="title"/>
- - title . @ - .
6. sections :
<xsl:template match="sections" mode="global_menu">
</xsl:template>
:
<xsl:apply-templates select="item" mode="global_menu"/>
- item sections . , item item ( sections/item/item ) , .. .
item ( ) . , : <xsl:call-template name="href_attribute"/>
uri- . .
7. ,
, . item :
<xsl:template match="item" mode="global_menu">
<xsl:choose>
<xsl:when test="descendant-or-self::*/@id = /node()/@id">
<xsl:value-of select="title"/>
</xsl:when>
<xsl:otherwise>
<xsl:call-template name="href_attribute"/>
<xsl:value-of select="title"/>
</xsl:otherwise>
</xsl:choose>
</xsl:template>
:
<xsl:choose>
<xsl:when></xsl:when>
<xsl:otherwise></xsl:otherwise>
</xsl:choose>
…, , XML- . : <xsl:when test="descendant-or-self::*/@id = /node()/@id">
ID ( document ) ( item ), , .
<xsl:when></xsl:when>
, . <xsl:otherwise></xsl:otherwise>
- .
8. , href_attribute :
<xsl:template name="href_attribute">
<xsl:attribute name="href">
<xsl:text>/</xsl:text>
<xsl:for-each select="ancestor-or-self::item">
<xsl:value-of select="dir"/>
<xsl:text>/</xsl:text>
</xsl:for-each>
</xsl:attribute>
</xsl:template>
xsl:attribute . . a , , href , .. .
<xsl:for-each select="ancestor-or-self::item">
, . ancestor-or-self::item - . dir , .. -.
, - , . , .
UPD:
. , :
parser.proc.ru/iso/xslt-1.zip
( ) Apache.
XML- /xsl/document.xml
- ( ). :
Lang - . . Id - .
<lang_table>
- , .
- :
- ( ):
<item id="0" parent_id="0" is_published="1" section="1">
- . :
Id - . Parent_id - . Is_published - . Dir - uri- . . Section - . .
- .
CMS : :
Html - . , . Com - -. , CMS: , , ..
XSL- , . .
CMS , :
:
Id - .
Container - - ( ).
Sorting - .
Type - :
Com - -
Html - .
Method - .
Title - .
DTD ( ):
<!DOCTYPE site_page [
<!ENTITY nbsp " ">
<!ENTITY sect "§" >
<!ENTITY copy "©">
<!ENTITY laquo "«">
<!ENTITY reg "®">
<!ENTITY deg "°">
<!ENTITY plusmn "±">
<!ENTITY para "¶">
<!ENTITY raquo "»">
<!ENTITY times "×">
<!ENTITY bull "•">
<!ENTITY hellip "…">
<!ENTITY ndash "–">
<!ENTITY mdash "—">
<!ENTITY lsquo "'">
<!ENTITY rsquo "'">
<!ENTITY sbquo "‚">
<!ENTITY ldquo "“">
<!ENTITY rdquo "”">
<!ENTITY bdquo "„">
<!ENTITY lsaquo "‹">
<!ENTITY rsaquo "›" >
<!ENTITY euro "€">
]>
XML- . <?xml version="1.0" encoding="windows-1251"?>
.
XHML-
XSL- XHTML- ( ). XHTML-, , .
.
XHML- , , :
( ). - , . / .
HTML-:
...
...
...
...
...
XSL-
XSL- :
<xsl:stylesheet version = '1.0' encoding="UTF-8"?>
<xsl:template match="element">
</xsl:template>
</xsl:stylesheet>
: <xsl:stylesheet version = '1.0' encoding="UTF-8"?>
- XML- . UTF-8 ( , ).
<xsl:stylesheet> </xsl:stylesheet>
- XSL-.
<xsl:template match="element"> </xsl:template>
- element.
:
<xsl:template match="element"></xsl:template>
- , element . element . <xsl:template match="element" mode="mode1"></xsl:template>
- , element mode1 . element . <xsl:template name="template-name"></xsl:template>
- template-name . - XML- .
XML- (, XML-, item ), " " :
<xsl:template match="navigation/sections/item"></xsl:template>
, , .., , , , .. navigation , navigation/sections/item sections/item .
, - . , xsl- . .
xsl .
, ( ) :
template_folder - . , my_template . dtd - . . lang - ( ). mod - .
xsl/my_template , layout.xsl :
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE xsl:stylesheet SYSTEM "../dtd/entities.dtd">
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:template match="/node()">
</xsl:template>
</xsl:stylesheet>
:
<xsl:template match="/node()"> </xsl:template>
- /node() (). /node() //document , .. .
XHTML- <xsl:template match="/node()"></xsl:template>
XML- . , XSL- XML- XHTML- .
, XSL template.xsl (, template - ), :
<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:import href=" my_template /layout.xsl"/>
</xsl:stylesheet>
:
<xsl:import href="my_template/layout.xsl"/>
XSL- ( XSL- ) . .
, .. XML- .
- .
, XML- :
<item id="0" parent_id="0" is_published="1" section="1">
/
<item id="1" parent_id="0" is_published="1" section="1" hit="yes">
news
:
id document - id . hit item - , , " ".
, , :
sections - . item - .
, , item item , , :
1. xsl/my_template navigation.xsl :
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE xsl:stylesheet SYSTEM "../dtd/entities.dtd">
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:template match="sections" mode="global_menu">
</xsl:template>
</xsl:stylesheet>
2. layout.xsl :
<xsl:template match="sections" mode="global_menu">
</xsl:template>
3. … layout.xsl :
<xsl:apply-templates select="navigation/sections" mode="global_menu"/>
:
select="navigation/sections" - ( ) - . , navigation/sections .
mode="global_menu" - global_menu . , , , " ", - .
4. , layout.xsl navigation.xsl :
<xsl:import href="navigation.xsl"/>
5. , navigation.xsl , :
<xsl:template match="item" mode="global_menu">
<xsl:call-template name="href_attribute"/>
<xsl:value-of select="title"/>
</xsl:template>
:
<xsl:call-template name="href_attribute"/>
- . , .. .
<xsl:value-of select="title"/>
- - title . @ - .
6. sections :
<xsl:template match="sections" mode="global_menu">
</xsl:template>
:
<xsl:apply-templates select="item" mode="global_menu"/>
- item sections . , item item ( sections/item/item ) , .. .
item ( ) . , : <xsl:call-template name="href_attribute"/>
uri- . .
7. ,
, . item :
<xsl:template match="item" mode="global_menu">
<xsl:choose>
<xsl:when test="descendant-or-self::*/@id = /node()/@id">
<xsl:value-of select="title"/>
</xsl:when>
<xsl:otherwise>
<xsl:call-template name="href_attribute"/>
<xsl:value-of select="title"/>
</xsl:otherwise>
</xsl:choose>
</xsl:template>
:
<xsl:choose>
<xsl:when></xsl:when>
<xsl:otherwise></xsl:otherwise>
</xsl:choose>
…, , XML- . : <xsl:when test="descendant-or-self::*/@id = /node()/@id">
ID ( document ) ( item ), , .
<xsl:when></xsl:when>
, . <xsl:otherwise></xsl:otherwise>
- .
8. , href_attribute :
<xsl:template name="href_attribute">
<xsl:attribute name="href">
<xsl:text>/</xsl:text>
<xsl:for-each select="ancestor-or-self::item">
<xsl:value-of select="dir"/>
<xsl:text>/</xsl:text>
</xsl:for-each>
</xsl:attribute>
</xsl:template>
xsl:attribute . . a , , href , .. .
<xsl:for-each select="ancestor-or-self::item">
, . ancestor-or-self::item - . dir , .. -.
, - , . , .
UPD:
. , :
parser.proc.ru/iso/xslt-1.zip
( ) Apache.
XML- /xsl/document.xml
- ( ). :
Lang - . . Id - .
<lang_table>
- , .
- :
- ( ):
<item id="0" parent_id="0" is_published="1" section="1">
- . :
Id - . Parent_id - . Is_published - . Dir - uri- . . Section - . .
- .
CMS : :
Html - . , . Com - -. , CMS: , , ..
XSL- , . .
CMS , :
:
Id - .
Container - - ( ).
Sorting - .
Type - :
Com - -
Html - .
Method - .
Title - .
DTD ( ):
<!DOCTYPE site_page [
<!ENTITY nbsp " ">
<!ENTITY sect "§" >
<!ENTITY copy "©">
<!ENTITY laquo "«">
<!ENTITY reg "®">
<!ENTITY deg "°">
<!ENTITY plusmn "±">
<!ENTITY para "¶">
<!ENTITY raquo "»">
<!ENTITY times "×">
<!ENTITY bull "•">
<!ENTITY hellip "…">
<!ENTITY ndash "–">
<!ENTITY mdash "—">
<!ENTITY lsquo "'">
<!ENTITY rsquo "'">
<!ENTITY sbquo "‚">
<!ENTITY ldquo "“">
<!ENTITY rdquo "”">
<!ENTITY bdquo "„">
<!ENTITY lsaquo "‹">
<!ENTITY rsaquo "›" >
<!ENTITY euro "€">
]>
XML- . <?xml version="1.0" encoding="windows-1251"?>
.
XHML-
XSL- XHTML- ( ). XHTML-, , .
.
XHML- , , :
( ). - , . / .
HTML-:
...
...
...
...
...
XSL-
XSL- :
<xsl:stylesheet version = '1.0' encoding="UTF-8"?>
<xsl:template match="element">
</xsl:template>
</xsl:stylesheet>
: <xsl:stylesheet version = '1.0' encoding="UTF-8"?>
- XML- . UTF-8 ( , ).
<xsl:stylesheet> </xsl:stylesheet>
- XSL-.
<xsl:template match="element"> </xsl:template>
- element.
:
<xsl:template match="element"></xsl:template>
- , element . element . <xsl:template match="element" mode="mode1"></xsl:template>
- , element mode1 . element . <xsl:template name="template-name"></xsl:template>
- template-name . - XML- .
XML- (, XML-, item ), " " :
<xsl:template match="navigation/sections/item"></xsl:template>
, , .., , , , .. navigation , navigation/sections/item sections/item .
, - . , xsl- . .
xsl .
, ( ) :
template_folder - . , my_template . dtd - . . lang - ( ). mod - .
xsl/my_template , layout.xsl :
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE xsl:stylesheet SYSTEM "../dtd/entities.dtd">
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:template match="/node()">
</xsl:template>
</xsl:stylesheet>
:
<xsl:template match="/node()"> </xsl:template>
- /node() (). /node() //document , .. .
XHTML- <xsl:template match="/node()"></xsl:template>
XML- . , XSL- XML- XHTML- .
, XSL template.xsl (, template - ), :
<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:import href=" my_template /layout.xsl"/>
</xsl:stylesheet>
:
<xsl:import href="my_template/layout.xsl"/>
XSL- ( XSL- ) . .
, .. XML- .
- .
, XML- :
<item id="0" parent_id="0" is_published="1" section="1">
/
<item id="1" parent_id="0" is_published="1" section="1" hit="yes">
news
:
id document - id . hit item - , , " ".
, , :
sections - . item - .
, , item item , , :
1. xsl/my_template navigation.xsl :
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE xsl:stylesheet SYSTEM "../dtd/entities.dtd">
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:template match="sections" mode="global_menu">
</xsl:template>
</xsl:stylesheet>
2. layout.xsl :
<xsl:template match="sections" mode="global_menu">
</xsl:template>
3. … layout.xsl :
<xsl:apply-templates select="navigation/sections" mode="global_menu"/>
:
select="navigation/sections" - ( ) - . , navigation/sections .
mode="global_menu" - global_menu . , , , " ", - .
4. , layout.xsl navigation.xsl :
<xsl:import href="navigation.xsl"/>
5. , navigation.xsl , :
<xsl:template match="item" mode="global_menu">
<xsl:call-template name="href_attribute"/>
<xsl:value-of select="title"/>
</xsl:template>
:
<xsl:call-template name="href_attribute"/>
- . , .. .
<xsl:value-of select="title"/>
- - title . @ - .
6. sections :
<xsl:template match="sections" mode="global_menu">
</xsl:template>
:
<xsl:apply-templates select="item" mode="global_menu"/>
- item sections . , item item ( sections/item/item ) , .. .
item ( ) . , : <xsl:call-template name="href_attribute"/>
uri- . .
7. ,
, . item :
<xsl:template match="item" mode="global_menu">
<xsl:choose>
<xsl:when test="descendant-or-self::*/@id = /node()/@id">
<xsl:value-of select="title"/>
</xsl:when>
<xsl:otherwise>
<xsl:call-template name="href_attribute"/>
<xsl:value-of select="title"/>
</xsl:otherwise>
</xsl:choose>
</xsl:template>
:
<xsl:choose>
<xsl:when></xsl:when>
<xsl:otherwise></xsl:otherwise>
</xsl:choose>
…, , XML- . : <xsl:when test="descendant-or-self::*/@id = /node()/@id">
ID ( document ) ( item ), , .
<xsl:when></xsl:when>
, . <xsl:otherwise></xsl:otherwise>
- .
8. , href_attribute :
<xsl:template name="href_attribute">
<xsl:attribute name="href">
<xsl:text>/</xsl:text>
<xsl:for-each select="ancestor-or-self::item">
<xsl:value-of select="dir"/>
<xsl:text>/</xsl:text>
</xsl:for-each>
</xsl:attribute>
</xsl:template>
xsl:attribute . . a , , href , .. .
<xsl:for-each select="ancestor-or-self::item">
, . ancestor-or-self::item - . dir , .. -.
, - , . , .
UPD:
. , :
parser.proc.ru/iso/xslt-1.zip
( ) Apache.
XML- /xsl/document.xml
- ( ). :
Lang - . . Id - .
<lang_table>
- , .
- :
- ( ):
<item id="0" parent_id="0" is_published="1" section="1">
- . :
Id - . Parent_id - . Is_published - . Dir - uri- . . Section - . .
- .
CMS : :
Html - . , . Com - -. , CMS: , , ..
XSL- , . .
CMS , :
:
Id - .
Container - - ( ).
Sorting - .
Type - :
Com - -
Html - .
Method - .
Title - .
DTD ( ):
<!DOCTYPE site_page [
<!ENTITY nbsp " ">
<!ENTITY sect "§" >
<!ENTITY copy "©">
<!ENTITY laquo "«">
<!ENTITY reg "®">
<!ENTITY deg "°">
<!ENTITY plusmn "±">
<!ENTITY para "¶">
<!ENTITY raquo "»">
<!ENTITY times "×">
<!ENTITY bull "•">
<!ENTITY hellip "…">
<!ENTITY ndash "–">
<!ENTITY mdash "—">
<!ENTITY lsquo "'">
<!ENTITY rsquo "'">
<!ENTITY sbquo "‚">
<!ENTITY ldquo "“">
<!ENTITY rdquo "”">
<!ENTITY bdquo "„">
<!ENTITY lsaquo "‹">
<!ENTITY rsaquo "›" >
<!ENTITY euro "€">
]>
XML- . <?xml version="1.0" encoding="windows-1251"?>
.
XHML-
XSL- XHTML- ( ). XHTML-, , .
.
XHML- , , :
( ). - , . / .
HTML-:
...
...
...
...
...
XSL-
XSL- :
<xsl:stylesheet version = '1.0' encoding="UTF-8"?>
<xsl:template match="element">
</xsl:template>
</xsl:stylesheet>
: <xsl:stylesheet version = '1.0' encoding="UTF-8"?>
- XML- . UTF-8 ( , ).
<xsl:stylesheet> </xsl:stylesheet>
- XSL-.
<xsl:template match="element"> </xsl:template>
- element.
:
<xsl:template match="element"></xsl:template>
- , element . element . <xsl:template match="element" mode="mode1"></xsl:template>
- , element mode1 . element . <xsl:template name="template-name"></xsl:template>
- template-name . - XML- .
XML- (, XML-, item ), " " :
<xsl:template match="navigation/sections/item"></xsl:template>
, , .., , , , .. navigation , navigation/sections/item sections/item .
, - . , xsl- . .
xsl .
, ( ) :
template_folder - . , my_template . dtd - . . lang - ( ). mod - .
xsl/my_template , layout.xsl :
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE xsl:stylesheet SYSTEM "../dtd/entities.dtd">
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:template match="/node()">
</xsl:template>
</xsl:stylesheet>
:
<xsl:template match="/node()"> </xsl:template>
- /node() (). /node() //document , .. .
XHTML- <xsl:template match="/node()"></xsl:template>
XML- . , XSL- XML- XHTML- .
, XSL template.xsl (, template - ), :
<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:import href=" my_template /layout.xsl"/>
</xsl:stylesheet>
:
<xsl:import href="my_template/layout.xsl"/>
XSL- ( XSL- ) . .
, .. XML- .
- .
, XML- :
<item id="0" parent_id="0" is_published="1" section="1">
/
<item id="1" parent_id="0" is_published="1" section="1" hit="yes">
news
:
id document - id . hit item - , , " ".
, , :
sections - . item - .
, , item item , , :
1. xsl/my_template navigation.xsl :
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE xsl:stylesheet SYSTEM "../dtd/entities.dtd">
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:template match="sections" mode="global_menu">
</xsl:template>
</xsl:stylesheet>
2. layout.xsl :
<xsl:template match="sections" mode="global_menu">
</xsl:template>
3. … layout.xsl :
<xsl:apply-templates select="navigation/sections" mode="global_menu"/>
:
select="navigation/sections" - ( ) - . , navigation/sections .
mode="global_menu" - global_menu . , , , " ", - .
4. , layout.xsl navigation.xsl :
<xsl:import href="navigation.xsl"/>
5. , navigation.xsl , :
<xsl:template match="item" mode="global_menu">
<xsl:call-template name="href_attribute"/>
<xsl:value-of select="title"/>
</xsl:template>
:
<xsl:call-template name="href_attribute"/>
- . , .. .
<xsl:value-of select="title"/>
- - title . @ - .
6. sections :
<xsl:template match="sections" mode="global_menu">
</xsl:template>
:
<xsl:apply-templates select="item" mode="global_menu"/>
- item sections . , item item ( sections/item/item ) , .. .
item ( ) . , : <xsl:call-template name="href_attribute"/>
uri- . .
7. ,
, . item :
<xsl:template match="item" mode="global_menu">
<xsl:choose>
<xsl:when test="descendant-or-self::*/@id = /node()/@id">
<xsl:value-of select="title"/>
</xsl:when>
<xsl:otherwise>
<xsl:call-template name="href_attribute"/>
<xsl:value-of select="title"/>
</xsl:otherwise>
</xsl:choose>
</xsl:template>
:
<xsl:choose>
<xsl:when></xsl:when>
<xsl:otherwise></xsl:otherwise>
</xsl:choose>
…, , XML- . : <xsl:when test="descendant-or-self::*/@id = /node()/@id">
ID ( document ) ( item ), , .
<xsl:when></xsl:when>
, . <xsl:otherwise></xsl:otherwise>
- .
8. , href_attribute :
<xsl:template name="href_attribute">
<xsl:attribute name="href">
<xsl:text>/</xsl:text>
<xsl:for-each select="ancestor-or-self::item">
<xsl:value-of select="dir"/>
<xsl:text>/</xsl:text>
</xsl:for-each>
</xsl:attribute>
</xsl:template>
xsl:attribute . . a , , href , .. .
<xsl:for-each select="ancestor-or-self::item">
, . ancestor-or-self::item - . dir , .. -.
, - , . , .
UPD:
. , :
parser.proc.ru/iso/xslt-1.zip
( ) Apache.
XML- /xsl/document.xml
- ( ). :
Lang - . . Id - .
<lang_table>
- , .
- :
- ( ):
<item id="0" parent_id="0" is_published="1" section="1">
- . :
Id - . Parent_id - . Is_published - . Dir - uri- . . Section - . .
- .
CMS : :
Html - . , . Com - -. , CMS: , , ..
XSL- , . .
CMS , :
:
Id - .
Container - - ( ).
Sorting - .
Type - :
Com - -
Html - .
Method - .
Title - .
DTD ( ):
<!DOCTYPE site_page [
<!ENTITY nbsp " ">
<!ENTITY sect "§" >
<!ENTITY copy "©">
<!ENTITY laquo "«">
<!ENTITY reg "®">
<!ENTITY deg "°">
<!ENTITY plusmn "±">
<!ENTITY para "¶">
<!ENTITY raquo "»">
<!ENTITY times "×">
<!ENTITY bull "•">
<!ENTITY hellip "…">
<!ENTITY ndash "–">
<!ENTITY mdash "—">
<!ENTITY lsquo "'">
<!ENTITY rsquo "'">
<!ENTITY sbquo "‚">
<!ENTITY ldquo "“">
<!ENTITY rdquo "”">
<!ENTITY bdquo "„">
<!ENTITY lsaquo "‹">
<!ENTITY rsaquo "›" >
<!ENTITY euro "€">
]>
XML- . <?xml version="1.0" encoding="windows-1251"?>
.
XHML-
XSL- XHTML- ( ). XHTML-, , .
.
XHML- , , :
( ). - , . / .
HTML-:
...
...
...
...
...
XSL-
XSL- :
<xsl:stylesheet version = '1.0' encoding="UTF-8"?>
<xsl:template match="element">
</xsl:template>
</xsl:stylesheet>
: <xsl:stylesheet version = '1.0' encoding="UTF-8"?>
- XML- . UTF-8 ( , ).
<xsl:stylesheet> </xsl:stylesheet>
- XSL-.
<xsl:template match="element"> </xsl:template>
- element.
:
<xsl:template match="element"></xsl:template>
- , element . element . <xsl:template match="element" mode="mode1"></xsl:template>
- , element mode1 . element . <xsl:template name="template-name"></xsl:template>
- template-name . - XML- .
XML- (, XML-, item ), " " :
<xsl:template match="navigation/sections/item"></xsl:template>
, , .., , , , .. navigation , navigation/sections/item sections/item .
, - . , xsl- . .
xsl .
, ( ) :
template_folder - . , my_template . dtd - . . lang - ( ). mod - .
xsl/my_template , layout.xsl :
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE xsl:stylesheet SYSTEM "../dtd/entities.dtd">
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:template match="/node()">
</xsl:template>
</xsl:stylesheet>
:
<xsl:template match="/node()"> </xsl:template>
- /node() (). /node() //document , .. .
XHTML- <xsl:template match="/node()"></xsl:template>
XML- . , XSL- XML- XHTML- .
, XSL template.xsl (, template - ), :
<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:import href=" my_template /layout.xsl"/>
</xsl:stylesheet>
:
<xsl:import href="my_template/layout.xsl"/>
XSL- ( XSL- ) . .
, .. XML- .
- .
, XML- :
<item id="0" parent_id="0" is_published="1" section="1">
/
<item id="1" parent_id="0" is_published="1" section="1" hit="yes">
news
:
id document - id . hit item - , , " ".
, , :
sections - . item - .
, , item item , , :
1. xsl/my_template navigation.xsl :
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE xsl:stylesheet SYSTEM "../dtd/entities.dtd">
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:template match="sections" mode="global_menu">
</xsl:template>
</xsl:stylesheet>
2. layout.xsl :
<xsl:template match="sections" mode="global_menu">
</xsl:template>
3. … layout.xsl :
<xsl:apply-templates select="navigation/sections" mode="global_menu"/>
:
select="navigation/sections" - ( ) - . , navigation/sections .
mode="global_menu" - global_menu . , , , " ", - .
4. , layout.xsl navigation.xsl :
<xsl:import href="navigation.xsl"/>
5. , navigation.xsl , :
<xsl:template match="item" mode="global_menu">
<xsl:call-template name="href_attribute"/>
<xsl:value-of select="title"/>
</xsl:template>
:
<xsl:call-template name="href_attribute"/>
- . , .. .
<xsl:value-of select="title"/>
- - title . @ - .
6. sections :
<xsl:template match="sections" mode="global_menu">
</xsl:template>
:
<xsl:apply-templates select="item" mode="global_menu"/>
- item sections . , item item ( sections/item/item ) , .. .
item ( ) . , : <xsl:call-template name="href_attribute"/>
uri- . .
7. ,
, . item :
<xsl:template match="item" mode="global_menu">
<xsl:choose>
<xsl:when test="descendant-or-self::*/@id = /node()/@id">
<xsl:value-of select="title"/>
</xsl:when>
<xsl:otherwise>
<xsl:call-template name="href_attribute"/>
<xsl:value-of select="title"/>
</xsl:otherwise>
</xsl:choose>
</xsl:template>
:
<xsl:choose>
<xsl:when></xsl:when>
<xsl:otherwise></xsl:otherwise>
</xsl:choose>
…, , XML- . : <xsl:when test="descendant-or-self::*/@id = /node()/@id">
ID ( document ) ( item ), , .
<xsl:when></xsl:when>
, . <xsl:otherwise></xsl:otherwise>
- .
8. , href_attribute :
<xsl:template name="href_attribute">
<xsl:attribute name="href">
<xsl:text>/</xsl:text>
<xsl:for-each select="ancestor-or-self::item">
<xsl:value-of select="dir"/>
<xsl:text>/</xsl:text>
</xsl:for-each>
</xsl:attribute>
</xsl:template>
xsl:attribute . . a , , href , .. .
<xsl:for-each select="ancestor-or-self::item">
, . ancestor-or-self::item - . dir , .. -.
, - , . , .
UPD:
. , :
parser.proc.ru/iso/xslt-1.zip
( ) Apache.
XML- /xsl/document.xml
- ( ). :
Lang - . . Id - .
<lang_table>
- , .
- :
- ( ):
<item id="0" parent_id="0" is_published="1" section="1">
- . :
Id - . Parent_id - . Is_published - . Dir - uri- . . Section - . .
- .
CMS : :
Html - . , . Com - -. , CMS: , , ..
XSL- , . .
CMS , :
:
Id - .
Container - - ( ).
Sorting - .
Type - :
Com - -
Html - .
Method - .
Title - .
DTD ( ):
<!DOCTYPE site_page [
<!ENTITY nbsp " ">
<!ENTITY sect "§" >
<!ENTITY copy "©">
<!ENTITY laquo "«">
<!ENTITY reg "®">
<!ENTITY deg "°">
<!ENTITY plusmn "±">
<!ENTITY para "¶">
<!ENTITY raquo "»">
<!ENTITY times "×">
<!ENTITY bull "•">
<!ENTITY hellip "…">
<!ENTITY ndash "–">
<!ENTITY mdash "—">
<!ENTITY lsquo "'">
<!ENTITY rsquo "'">
<!ENTITY sbquo "‚">
<!ENTITY ldquo "“">
<!ENTITY rdquo "”">
<!ENTITY bdquo "„">
<!ENTITY lsaquo "‹">
<!ENTITY rsaquo "›" >
<!ENTITY euro "€">
]>
XML- . <?xml version="1.0" encoding="windows-1251"?>
.
XHML-
XSL- XHTML- ( ). XHTML-, , .
.
XHML- , , :
( ). - , . / .
HTML-:
...
...
...
...
...
XSL-
XSL- :
<xsl:stylesheet version = '1.0' encoding="UTF-8"?>
<xsl:template match="element">
</xsl:template>
</xsl:stylesheet>
: <xsl:stylesheet version = '1.0' encoding="UTF-8"?>
- XML- . UTF-8 ( , ).
<xsl:stylesheet> </xsl:stylesheet>
- XSL-.
<xsl:template match="element"> </xsl:template>
- element.
:
<xsl:template match="element"></xsl:template>
- , element . element . <xsl:template match="element" mode="mode1"></xsl:template>
- , element mode1 . element . <xsl:template name="template-name"></xsl:template>
- template-name . - XML- .
XML- (, XML-, item ), " " :
<xsl:template match="navigation/sections/item"></xsl:template>
, , .., , , , .. navigation , navigation/sections/item sections/item .
, - . , xsl- . .
xsl .
, ( ) :
template_folder - . , my_template . dtd - . . lang - ( ). mod - .
xsl/my_template , layout.xsl :
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE xsl:stylesheet SYSTEM "../dtd/entities.dtd">
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:template match="/node()">
</xsl:template>
</xsl:stylesheet>
:
<xsl:template match="/node()"> </xsl:template>
- /node() (). /node() //document , .. .
XHTML- <xsl:template match="/node()"></xsl:template>
XML- . , XSL- XML- XHTML- .
, XSL template.xsl (, template - ), :
<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:import href=" my_template /layout.xsl"/>
</xsl:stylesheet>
:
<xsl:import href="my_template/layout.xsl"/>
XSL- ( XSL- ) . .
, .. XML- .
- .
, XML- :
<item id="0" parent_id="0" is_published="1" section="1">
/
<item id="1" parent_id="0" is_published="1" section="1" hit="yes">
news
:
id document - id . hit item - , , " ".
, , :
sections - . item - .
, , item item , , :
1. xsl/my_template navigation.xsl :
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE xsl:stylesheet SYSTEM "../dtd/entities.dtd">
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:template match="sections" mode="global_menu">
</xsl:template>
</xsl:stylesheet>
2. layout.xsl :
<xsl:template match="sections" mode="global_menu">
</xsl:template>
3. … layout.xsl :
<xsl:apply-templates select="navigation/sections" mode="global_menu"/>
:
select="navigation/sections" - ( ) - . , navigation/sections .
mode="global_menu" - global_menu . , , , " ", - .
4. , layout.xsl navigation.xsl :
<xsl:import href="navigation.xsl"/>
5. , navigation.xsl , :
<xsl:template match="item" mode="global_menu">
<xsl:call-template name="href_attribute"/>
<xsl:value-of select="title"/>
</xsl:template>
:
<xsl:call-template name="href_attribute"/>
- . , .. .
<xsl:value-of select="title"/>
- - title . @ - .
6. sections :
<xsl:template match="sections" mode="global_menu">
</xsl:template>
:
<xsl:apply-templates select="item" mode="global_menu"/>
- item sections . , item item ( sections/item/item ) , .. .
item ( ) . , : <xsl:call-template name="href_attribute"/>
uri- . .
7. ,
, . item :
<xsl:template match="item" mode="global_menu">
<xsl:choose>
<xsl:when test="descendant-or-self::*/@id = /node()/@id">
<xsl:value-of select="title"/>
</xsl:when>
<xsl:otherwise>
<xsl:call-template name="href_attribute"/>
<xsl:value-of select="title"/>
</xsl:otherwise>
</xsl:choose>
</xsl:template>
:
<xsl:choose>
<xsl:when></xsl:when>
<xsl:otherwise></xsl:otherwise>
</xsl:choose>
…, , XML- . : <xsl:when test="descendant-or-self::*/@id = /node()/@id">
ID ( document ) ( item ), , .
<xsl:when></xsl:when>
, . <xsl:otherwise></xsl:otherwise>
- .
8. , href_attribute :
<xsl:template name="href_attribute">
<xsl:attribute name="href">
<xsl:text>/</xsl:text>
<xsl:for-each select="ancestor-or-self::item">
<xsl:value-of select="dir"/>
<xsl:text>/</xsl:text>
</xsl:for-each>
</xsl:attribute>
</xsl:template>
xsl:attribute . . a , , href , .. .
<xsl:for-each select="ancestor-or-self::item">
, . ancestor-or-self::item - . dir , .. -.
, - , . , .
UPD:
. , :
parser.proc.ru/iso/xslt-1.zip
( ) Apache.
XML- /xsl/document.xml
- ( ). :
Lang - . . Id - .
<lang_table>
- , .
- :
- ( ):
<item id="0" parent_id="0" is_published="1" section="1">
- . :
Id - . Parent_id - . Is_published - . Dir - uri- . . Section - . .
- .
CMS : :
Html - . , . Com - -. , CMS: , , ..
XSL- , . .
CMS , :
:
Id - .
Container - - ( ).
Sorting - .
Type - :
Com - -
Html - .
Method - .
Title - .
DTD ( ):
<!DOCTYPE site_page [
<!ENTITY nbsp " ">
<!ENTITY sect "§" >
<!ENTITY copy "©">
<!ENTITY laquo "«">
<!ENTITY reg "®">
<!ENTITY deg "°">
<!ENTITY plusmn "±">
<!ENTITY para "¶">
<!ENTITY raquo "»">
<!ENTITY times "×">
<!ENTITY bull "•">
<!ENTITY hellip "…">
<!ENTITY ndash "–">
<!ENTITY mdash "—">
<!ENTITY lsquo "'">
<!ENTITY rsquo "'">
<!ENTITY sbquo "‚">
<!ENTITY ldquo "“">
<!ENTITY rdquo "”">
<!ENTITY bdquo "„">
<!ENTITY lsaquo "‹">
<!ENTITY rsaquo "›" >
<!ENTITY euro "€">
]>
XML- . <?xml version="1.0" encoding="windows-1251"?>
.
XHML-
XSL- XHTML- ( ). XHTML-, , .
.
XHML- , , :
( ). - , . / .
HTML-:
...
...
...
...
...
XSL-
XSL- :
<xsl:stylesheet version = '1.0' encoding="UTF-8"?>
<xsl:template match="element">
</xsl:template>
</xsl:stylesheet>
: <xsl:stylesheet version = '1.0' encoding="UTF-8"?>
- XML- . UTF-8 ( , ).
<xsl:stylesheet> </xsl:stylesheet>
- XSL-.
<xsl:template match="element"> </xsl:template>
- element.
:
<xsl:template match="element"></xsl:template>
- , element . element . <xsl:template match="element" mode="mode1"></xsl:template>
- , element mode1 . element . <xsl:template name="template-name"></xsl:template>
- template-name . - XML- .
XML- (, XML-, item ), " " :
<xsl:template match="navigation/sections/item"></xsl:template>
, , .., , , , .. navigation , navigation/sections/item sections/item .
, - . , xsl- . .
xsl .
, ( ) :
template_folder - . , my_template . dtd - . . lang - ( ). mod - .
xsl/my_template , layout.xsl :
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE xsl:stylesheet SYSTEM "../dtd/entities.dtd">
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:template match="/node()">
</xsl:template>
</xsl:stylesheet>
:
<xsl:template match="/node()"> </xsl:template>
- /node() (). /node() //document , .. .
XHTML- <xsl:template match="/node()"></xsl:template>
XML- . , XSL- XML- XHTML- .
, XSL template.xsl (, template - ), :
<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:import href=" my_template /layout.xsl"/>
</xsl:stylesheet>
:
<xsl:import href="my_template/layout.xsl"/>
XSL- ( XSL- ) . .
, .. XML- .
- .
, XML- :
<item id="0" parent_id="0" is_published="1" section="1">
/
<item id="1" parent_id="0" is_published="1" section="1" hit="yes">
news
:
id document - id . hit item - , , " ".
, , :
sections - . item - .
, , item item , , :
1. xsl/my_template navigation.xsl :
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE xsl:stylesheet SYSTEM "../dtd/entities.dtd">
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:template match="sections" mode="global_menu">
</xsl:template>
</xsl:stylesheet>
2. layout.xsl :
<xsl:template match="sections" mode="global_menu">
</xsl:template>
3. … layout.xsl :
<xsl:apply-templates select="navigation/sections" mode="global_menu"/>
:
select="navigation/sections" - ( ) - . , navigation/sections .
mode="global_menu" - global_menu . , , , " ", - .
4. , layout.xsl navigation.xsl :
<xsl:import href="navigation.xsl"/>
5. , navigation.xsl , :
<xsl:template match="item" mode="global_menu">
<xsl:call-template name="href_attribute"/>
<xsl:value-of select="title"/>
</xsl:template>
:
<xsl:call-template name="href_attribute"/>
- . , .. .
<xsl:value-of select="title"/>
- - title . @ - .
6. sections :
<xsl:template match="sections" mode="global_menu">
</xsl:template>
:
<xsl:apply-templates select="item" mode="global_menu"/>
- item sections . , item item ( sections/item/item ) , .. .
item ( ) . , : <xsl:call-template name="href_attribute"/>
uri- . .
7. ,
, . item :
<xsl:template match="item" mode="global_menu">
<xsl:choose>
<xsl:when test="descendant-or-self::*/@id = /node()/@id">
<xsl:value-of select="title"/>
</xsl:when>
<xsl:otherwise>
<xsl:call-template name="href_attribute"/>
<xsl:value-of select="title"/>
</xsl:otherwise>
</xsl:choose>
</xsl:template>
:
<xsl:choose>
<xsl:when></xsl:when>
<xsl:otherwise></xsl:otherwise>
</xsl:choose>
…, , XML- . : <xsl:when test="descendant-or-self::*/@id = /node()/@id">
ID ( document ) ( item ), , .
<xsl:when></xsl:when>
, . <xsl:otherwise></xsl:otherwise>
- .
8. , href_attribute :
<xsl:template name="href_attribute">
<xsl:attribute name="href">
<xsl:text>/</xsl:text>
<xsl:for-each select="ancestor-or-self::item">
<xsl:value-of select="dir"/>
<xsl:text>/</xsl:text>
</xsl:for-each>
</xsl:attribute>
</xsl:template>
xsl:attribute . . a , , href , .. .
<xsl:for-each select="ancestor-or-self::item">
, . ancestor-or-self::item - . dir , .. -.
, - , . , .
UPD:
. , :
parser.proc.ru/iso/xslt-1.zip
( ) Apache.
XML- /xsl/document.xml
- ( ). :
Lang - . . Id - .
<lang_table>
- , .
- :
- ( ):
<item id="0" parent_id="0" is_published="1" section="1">
- . :
Id - . Parent_id - . Is_published - . Dir - uri- . . Section - . .
- .
CMS : :
Html - . , . Com - -. , CMS: , , ..
XSL- , . .
CMS , :
:
Id - .
Container - - ( ).
Sorting - .
Type - :
Com - -
Html - .
Method - .
Title - .
DTD ( ):
<!DOCTYPE site_page [
<!ENTITY nbsp " ">
<!ENTITY sect "§" >
<!ENTITY copy "©">
<!ENTITY laquo "«">
<!ENTITY reg "®">
<!ENTITY deg "°">
<!ENTITY plusmn "±">
<!ENTITY para "¶">
<!ENTITY raquo "»">
<!ENTITY times "×">
<!ENTITY bull "•">
<!ENTITY hellip "…">
<!ENTITY ndash "–">
<!ENTITY mdash "—">
<!ENTITY lsquo "'">
<!ENTITY rsquo "'">
<!ENTITY sbquo "‚">
<!ENTITY ldquo "“">
<!ENTITY rdquo "”">
<!ENTITY bdquo "„">
<!ENTITY lsaquo "‹">
<!ENTITY rsaquo "›" >
<!ENTITY euro "€">
]>
XML- . <?xml version="1.0" encoding="windows-1251"?>
.
XHML-
XSL- XHTML- ( ). XHTML-, , .
.
XHML- , , :
( ). - , . / .
HTML-:
...
...
...
...
...
XSL-
XSL- :
<xsl:stylesheet version = '1.0' encoding="UTF-8"?>
<xsl:template match="element">
</xsl:template>
</xsl:stylesheet>
: <xsl:stylesheet version = '1.0' encoding="UTF-8"?>
- XML- . UTF-8 ( , ).
<xsl:stylesheet> </xsl:stylesheet>
- XSL-.
<xsl:template match="element"> </xsl:template>
- element.
:
<xsl:template match="element"></xsl:template>
- , element . element . <xsl:template match="element" mode="mode1"></xsl:template>
- , element mode1 . element . <xsl:template name="template-name"></xsl:template>
- template-name . - XML- .
XML- (, XML-, item ), " " :
<xsl:template match="navigation/sections/item"></xsl:template>
, , .., , , , .. navigation , navigation/sections/item sections/item .
, - . , xsl- . .
xsl .
, ( ) :
template_folder - . , my_template . dtd - . . lang - ( ). mod - .
xsl/my_template , layout.xsl :
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE xsl:stylesheet SYSTEM "../dtd/entities.dtd">
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:template match="/node()">
</xsl:template>
</xsl:stylesheet>
:
<xsl:template match="/node()"> </xsl:template>
- /node() (). /node() //document , .. .
XHTML- <xsl:template match="/node()"></xsl:template>
XML- . , XSL- XML- XHTML- .
, XSL template.xsl (, template - ), :
<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:import href=" my_template /layout.xsl"/>
</xsl:stylesheet>
:
<xsl:import href="my_template/layout.xsl"/>
XSL- ( XSL- ) . .
, .. XML- .
- .
, XML- :
<item id="0" parent_id="0" is_published="1" section="1">
/
<item id="1" parent_id="0" is_published="1" section="1" hit="yes">
news
:
id document - id . hit item - , , " ".
, , :
sections - . item - .
, , item item , , :
1. xsl/my_template navigation.xsl :
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE xsl:stylesheet SYSTEM "../dtd/entities.dtd">
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:template match="sections" mode="global_menu">
</xsl:template>
</xsl:stylesheet>
2. layout.xsl :
<xsl:template match="sections" mode="global_menu">
</xsl:template>
3. … layout.xsl :
<xsl:apply-templates select="navigation/sections" mode="global_menu"/>
:
select="navigation/sections" - ( ) - . , navigation/sections .
mode="global_menu" - global_menu . , , , " ", - .
4. , layout.xsl navigation.xsl :
<xsl:import href="navigation.xsl"/>
5. , navigation.xsl , :
<xsl:template match="item" mode="global_menu">
<xsl:call-template name="href_attribute"/>
<xsl:value-of select="title"/>
</xsl:template>
:
<xsl:call-template name="href_attribute"/>
- . , .. .
<xsl:value-of select="title"/>
- - title . @ - .
6. sections :
<xsl:template match="sections" mode="global_menu">
</xsl:template>
:
<xsl:apply-templates select="item" mode="global_menu"/>
- item sections . , item item ( sections/item/item ) , .. .
item ( ) . , : <xsl:call-template name="href_attribute"/>
uri- . .
7. ,
, . item :
<xsl:template match="item" mode="global_menu">
<xsl:choose>
<xsl:when test="descendant-or-self::*/@id = /node()/@id">
<xsl:value-of select="title"/>
</xsl:when>
<xsl:otherwise>
<xsl:call-template name="href_attribute"/>
<xsl:value-of select="title"/>
</xsl:otherwise>
</xsl:choose>
</xsl:template>
:
<xsl:choose>
<xsl:when></xsl:when>
<xsl:otherwise></xsl:otherwise>
</xsl:choose>
…, , XML- . : <xsl:when test="descendant-or-self::*/@id = /node()/@id">
ID ( document ) ( item ), , .
<xsl:when></xsl:when>
, . <xsl:otherwise></xsl:otherwise>
- .
8. , href_attribute :
<xsl:template name="href_attribute">
<xsl:attribute name="href">
<xsl:text>/</xsl:text>
<xsl:for-each select="ancestor-or-self::item">
<xsl:value-of select="dir"/>
<xsl:text>/</xsl:text>
</xsl:for-each>
</xsl:attribute>
</xsl:template>
xsl:attribute . . a , , href , .. .
<xsl:for-each select="ancestor-or-self::item">
, . ancestor-or-self::item - . dir , .. -.
, - , . , .
UPD:
. , :
parser.proc.ru/iso/xslt-1.zip
( ) Apache.
XML- /xsl/document.xml
- ( ). :
Lang - . . Id - .
<lang_table>
- , .
- :
- ( ):
<item id="0" parent_id="0" is_published="1" section="1">
- . :
Id - . Parent_id - . Is_published - . Dir - uri- . . Section - . .
- .
CMS : :
Html - . , . Com - -. , CMS: , , ..
XSL- , . .
CMS , :
:
Id - .
Container - - ( ).
Sorting - .
Type - :
Com - -
Html - .
Method - .
Title - .
DTD ( ):
<!DOCTYPE site_page [
<!ENTITY nbsp " ">
<!ENTITY sect "§" >
<!ENTITY copy "©">
<!ENTITY laquo "«">
<!ENTITY reg "®">
<!ENTITY deg "°">
<!ENTITY plusmn "±">
<!ENTITY para "¶">
<!ENTITY raquo "»">
<!ENTITY times "×">
<!ENTITY bull "•">
<!ENTITY hellip "…">
<!ENTITY ndash "–">
<!ENTITY mdash "—">
<!ENTITY lsquo "'">
<!ENTITY rsquo "'">
<!ENTITY sbquo "‚">
<!ENTITY ldquo "“">
<!ENTITY rdquo "”">
<!ENTITY bdquo "„">
<!ENTITY lsaquo "‹">
<!ENTITY rsaquo "›" >
<!ENTITY euro "€">
]>
XML- . <?xml version="1.0" encoding="windows-1251"?>
.
XHML-
XSL- XHTML- ( ). XHTML-, , .
.
XHML- , , :
( ). - , . / .
HTML-:
...
...
...
...
...
XSL-
XSL- :
<xsl:stylesheet version = '1.0' encoding="UTF-8"?>
<xsl:template match="element">
</xsl:template>
</xsl:stylesheet>
: <xsl:stylesheet version = '1.0' encoding="UTF-8"?>
- XML- . UTF-8 ( , ).
<xsl:stylesheet> </xsl:stylesheet>
- XSL-.
<xsl:template match="element"> </xsl:template>
- element.
:
<xsl:template match="element"></xsl:template>
- , element . element . <xsl:template match="element" mode="mode1"></xsl:template>
- , element mode1 . element . <xsl:template name="template-name"></xsl:template>
- template-name . - XML- .
XML- (, XML-, item ), " " :
<xsl:template match="navigation/sections/item"></xsl:template>
, , .., , , , .. navigation , navigation/sections/item sections/item .
, - . , xsl- . .
xsl .
, ( ) :
template_folder - . , my_template . dtd - . . lang - ( ). mod - .
xsl/my_template , layout.xsl :
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE xsl:stylesheet SYSTEM "../dtd/entities.dtd">
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:template match="/node()">
</xsl:template>
</xsl:stylesheet>
:
<xsl:template match="/node()"> </xsl:template>
- /node() (). /node() //document , .. .
XHTML- <xsl:template match="/node()"></xsl:template>
XML- . , XSL- XML- XHTML- .
, XSL template.xsl (, template - ), :
<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:import href=" my_template /layout.xsl"/>
</xsl:stylesheet>
:
<xsl:import href="my_template/layout.xsl"/>
XSL- ( XSL- ) . .
, .. XML- .
- .
, XML- :
<item id="0" parent_id="0" is_published="1" section="1">
/
<item id="1" parent_id="0" is_published="1" section="1" hit="yes">
news
:
id document - id . hit item - , , " ".
, , :
sections - . item - .
, , item item , , :
1. xsl/my_template navigation.xsl :
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE xsl:stylesheet SYSTEM "../dtd/entities.dtd">
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:template match="sections" mode="global_menu">
</xsl:template>
</xsl:stylesheet>
2. layout.xsl :
<xsl:template match="sections" mode="global_menu">
</xsl:template>
3. … layout.xsl :
<xsl:apply-templates select="navigation/sections" mode="global_menu"/>
:
select="navigation/sections" - ( ) - . , navigation/sections .
mode="global_menu" - global_menu . , , , " ", - .
4. , layout.xsl navigation.xsl :
<xsl:import href="navigation.xsl"/>
5. , navigation.xsl , :
<xsl:template match="item" mode="global_menu">
<xsl:call-template name="href_attribute"/>
<xsl:value-of select="title"/>
</xsl:template>
:
<xsl:call-template name="href_attribute"/>
- . , .. .
<xsl:value-of select="title"/>
- - title . @ - .
6. sections :
<xsl:template match="sections" mode="global_menu">
</xsl:template>
:
<xsl:apply-templates select="item" mode="global_menu"/>
- item sections . , item item ( sections/item/item ) , .. .
item ( ) . , : <xsl:call-template name="href_attribute"/>
uri- . .
7. ,
, . item :
<xsl:template match="item" mode="global_menu">
<xsl:choose>
<xsl:when test="descendant-or-self::*/@id = /node()/@id">
<xsl:value-of select="title"/>
</xsl:when>
<xsl:otherwise>
<xsl:call-template name="href_attribute"/>
<xsl:value-of select="title"/>
</xsl:otherwise>
</xsl:choose>
</xsl:template>
:
<xsl:choose>
<xsl:when></xsl:when>
<xsl:otherwise></xsl:otherwise>
</xsl:choose>
…, , XML- . : <xsl:when test="descendant-or-self::*/@id = /node()/@id">
ID ( document ) ( item ), , .
<xsl:when></xsl:when>
, . <xsl:otherwise></xsl:otherwise>
- .
8. , href_attribute :
<xsl:template name="href_attribute">
<xsl:attribute name="href">
<xsl:text>/</xsl:text>
<xsl:for-each select="ancestor-or-self::item">
<xsl:value-of select="dir"/>
<xsl:text>/</xsl:text>
</xsl:for-each>
</xsl:attribute>
</xsl:template>
xsl:attribute . . a , , href , .. .
<xsl:for-each select="ancestor-or-self::item">
, . ancestor-or-self::item - . dir , .. -.
, - , . , .
UPD:
. , :
parser.proc.ru/iso/xslt-1.zip
( ) Apache.
XML- /xsl/document.xml
- ( ). :
Lang - . . Id - .
<lang_table>
- , .
- :
- ( ):
<item id="0" parent_id="0" is_published="1" section="1">
- . :
Id - . Parent_id - . Is_published - . Dir - uri- . . Section - . .
- .
CMS : :
Html - . , . Com - -. , CMS: , , ..
XSL- , . .
CMS , :
:
Id - .
Container - - ( ).
Sorting - .
Type - :
Com - -
Html - .
Method - .
Title - .
DTD ( ):
<!DOCTYPE site_page [
<!ENTITY nbsp " ">
<!ENTITY sect "§" >
<!ENTITY copy "©">
<!ENTITY laquo "«">
<!ENTITY reg "®">
<!ENTITY deg "°">
<!ENTITY plusmn "±">
<!ENTITY para "¶">
<!ENTITY raquo "»">
<!ENTITY times "×">
<!ENTITY bull "•">
<!ENTITY hellip "…">
<!ENTITY ndash "–">
<!ENTITY mdash "—">
<!ENTITY lsquo "'">
<!ENTITY rsquo "'">
<!ENTITY sbquo "‚">
<!ENTITY ldquo "“">
<!ENTITY rdquo "”">
<!ENTITY bdquo "„">
<!ENTITY lsaquo "‹">
<!ENTITY rsaquo "›" >
<!ENTITY euro "€">
]>
XML- . <?xml version="1.0" encoding="windows-1251"?>
.
XHML-
XSL- XHTML- ( ). XHTML-, , .
.
XHML- , , :
( ). - , . / .
HTML-:
...
...
...
...
...
XSL-
XSL- :
<xsl:stylesheet version = '1.0' encoding="UTF-8"?>
<xsl:template match="element">
</xsl:template>
</xsl:stylesheet>
: <xsl:stylesheet version = '1.0' encoding="UTF-8"?>
- XML- . UTF-8 ( , ).
<xsl:stylesheet> </xsl:stylesheet>
- XSL-.
<xsl:template match="element"> </xsl:template>
- element.
:
<xsl:template match="element"></xsl:template>
- , element . element . <xsl:template match="element" mode="mode1"></xsl:template>
- , element mode1 . element . <xsl:template name="template-name"></xsl:template>
- template-name . - XML- .
XML- (, XML-, item ), " " :
<xsl:template match="navigation/sections/item"></xsl:template>
, , .., , , , .. navigation , navigation/sections/item sections/item .
, - . , xsl- . .
xsl .
, ( ) :
template_folder - . , my_template . dtd - . . lang - ( ). mod - .
xsl/my_template , layout.xsl :
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE xsl:stylesheet SYSTEM "../dtd/entities.dtd">
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:template match="/node()">
</xsl:template>
</xsl:stylesheet>
:
<xsl:template match="/node()"> </xsl:template>
- /node() (). /node() //document , .. .
XHTML- <xsl:template match="/node()"></xsl:template>
XML- . , XSL- XML- XHTML- .
, XSL template.xsl (, template - ), :
<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:import href=" my_template /layout.xsl"/>
</xsl:stylesheet>
:
<xsl:import href="my_template/layout.xsl"/>
XSL- ( XSL- ) . .
, .. XML- .
- .
, XML- :
<item id="0" parent_id="0" is_published="1" section="1">
/
<item id="1" parent_id="0" is_published="1" section="1" hit="yes">
news
:
id document - id . hit item - , , " ".
, , :
sections - . item - .
, , item item , , :
1. xsl/my_template navigation.xsl :
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE xsl:stylesheet SYSTEM "../dtd/entities.dtd">
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:template match="sections" mode="global_menu">
</xsl:template>
</xsl:stylesheet>
2. layout.xsl :
<xsl:template match="sections" mode="global_menu">
</xsl:template>
3. … layout.xsl :
<xsl:apply-templates select="navigation/sections" mode="global_menu"/>
:
select="navigation/sections" - ( ) - . , navigation/sections .
mode="global_menu" - global_menu . , , , " ", - .
4. , layout.xsl navigation.xsl :
<xsl:import href="navigation.xsl"/>
5. , navigation.xsl , :
<xsl:template match="item" mode="global_menu">
<xsl:call-template name="href_attribute"/>
<xsl:value-of select="title"/>
</xsl:template>
:
<xsl:call-template name="href_attribute"/>
- . , .. .
<xsl:value-of select="title"/>
- - title . @ - .
6. sections :
<xsl:template match="sections" mode="global_menu">
</xsl:template>
:
<xsl:apply-templates select="item" mode="global_menu"/>
- item sections . , item item ( sections/item/item ) , .. .
item ( ) . , : <xsl:call-template name="href_attribute"/>
uri- . .
7. ,
, . item :
<xsl:template match="item" mode="global_menu">
<xsl:choose>
<xsl:when test="descendant-or-self::*/@id = /node()/@id">
<xsl:value-of select="title"/>
</xsl:when>
<xsl:otherwise>
<xsl:call-template name="href_attribute"/>
<xsl:value-of select="title"/>
</xsl:otherwise>
</xsl:choose>
</xsl:template>
:
<xsl:choose>
<xsl:when></xsl:when>
<xsl:otherwise></xsl:otherwise>
</xsl:choose>
…, , XML- . : <xsl:when test="descendant-or-self::*/@id = /node()/@id">
ID ( document ) ( item ), , .
<xsl:when></xsl:when>
, . <xsl:otherwise></xsl:otherwise>
- .
8. , href_attribute :
<xsl:template name="href_attribute">
<xsl:attribute name="href">
<xsl:text>/</xsl:text>
<xsl:for-each select="ancestor-or-self::item">
<xsl:value-of select="dir"/>
<xsl:text>/</xsl:text>
</xsl:for-each>
</xsl:attribute>
</xsl:template>
xsl:attribute . . a , , href , .. .
<xsl:for-each select="ancestor-or-self::item">
, . ancestor-or-self::item - . dir , .. -.
, - , . , .
UPD:
. , :
parser.proc.ru/iso/xslt-1.zip
( ) Apache.
XML- /xsl/document.xml
- ( ). :
Lang - . . Id - .
<lang_table>
- , .
- :
- ( ):
<item id="0" parent_id="0" is_published="1" section="1">
- . :
Id - . Parent_id - . Is_published - . Dir - uri- . . Section - . .
- .
CMS : :
Html - . , . Com - -. , CMS: , , ..
XSL- , . .
CMS , :
:
Id - .
Container - - ( ).
Sorting - .
Type - :
Com - -
Html - .
Method - .
Title - .
DTD ( ):
<!DOCTYPE site_page [
<!ENTITY nbsp " ">
<!ENTITY sect "§" >
<!ENTITY copy "©">
<!ENTITY laquo "«">
<!ENTITY reg "®">
<!ENTITY deg "°">
<!ENTITY plusmn "±">
<!ENTITY para "¶">
<!ENTITY raquo "»">
<!ENTITY times "×">
<!ENTITY bull "•">
<!ENTITY hellip "…">
<!ENTITY ndash "–">
<!ENTITY mdash "—">
<!ENTITY lsquo "'">
<!ENTITY rsquo "'">
<!ENTITY sbquo "‚">
<!ENTITY ldquo "“">
<!ENTITY rdquo "”">
<!ENTITY bdquo "„">
<!ENTITY lsaquo "‹">
<!ENTITY rsaquo "›" >
<!ENTITY euro "€">
]>
XML- . <?xml version="1.0" encoding="windows-1251"?>
.
XHML-
XSL- XHTML- ( ). XHTML-, , .
.
XHML- , , :
( ). - , . / .
HTML-:
...
...
...
...
...
XSL-
XSL- :
<xsl:stylesheet version = '1.0' encoding="UTF-8"?>
<xsl:template match="element">
</xsl:template>
</xsl:stylesheet>
: <xsl:stylesheet version = '1.0' encoding="UTF-8"?>
- XML- . UTF-8 ( , ).
<xsl:stylesheet> </xsl:stylesheet>
- XSL-.
<xsl:template match="element"> </xsl:template>
- element.
:
<xsl:template match="element"></xsl:template>
- , element . element . <xsl:template match="element" mode="mode1"></xsl:template>
- , element mode1 . element . <xsl:template name="template-name"></xsl:template>
- template-name . - XML- .
XML- (, XML-, item ), " " :
<xsl:template match="navigation/sections/item"></xsl:template>
, , .., , , , .. navigation , navigation/sections/item sections/item .
, - . , xsl- . .
xsl .
, ( ) :
template_folder - . , my_template . dtd - . . lang - ( ). mod - .
xsl/my_template , layout.xsl :
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE xsl:stylesheet SYSTEM "../dtd/entities.dtd">
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:template match="/node()">
</xsl:template>
</xsl:stylesheet>
:
<xsl:template match="/node()"> </xsl:template>
- /node() (). /node() //document , .. .
XHTML- <xsl:template match="/node()"></xsl:template>
XML- . , XSL- XML- XHTML- .
, XSL template.xsl (, template - ), :
<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:import href=" my_template /layout.xsl"/>
</xsl:stylesheet>
:
<xsl:import href="my_template/layout.xsl"/>
XSL- ( XSL- ) . .
, .. XML- .
- .
, XML- :
<item id="0" parent_id="0" is_published="1" section="1">
/
<item id="1" parent_id="0" is_published="1" section="1" hit="yes">
news
:
id document - id . hit item - , , " ".
, , :
sections - . item - .
, , item item , , :
1. xsl/my_template navigation.xsl :
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE xsl:stylesheet SYSTEM "../dtd/entities.dtd">
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:template match="sections" mode="global_menu">
</xsl:template>
</xsl:stylesheet>
2. layout.xsl :
<xsl:template match="sections" mode="global_menu">
</xsl:template>
3. … layout.xsl :
<xsl:apply-templates select="navigation/sections" mode="global_menu"/>
:
select="navigation/sections" - ( ) - . , navigation/sections .
mode="global_menu" - global_menu . , , , " ", - .
4. , layout.xsl navigation.xsl :
<xsl:import href="navigation.xsl"/>
5. , navigation.xsl , :
<xsl:template match="item" mode="global_menu">
<xsl:call-template name="href_attribute"/>
<xsl:value-of select="title"/>
</xsl:template>
:
<xsl:call-template name="href_attribute"/>
- . , .. .
<xsl:value-of select="title"/>
- - title . @ - .
6. sections :
<xsl:template match="sections" mode="global_menu">
</xsl:template>
:
<xsl:apply-templates select="item" mode="global_menu"/>
- item sections . , item item ( sections/item/item ) , .. .
item ( ) . , : <xsl:call-template name="href_attribute"/>
uri- . .
7. ,
, . item :
<xsl:template match="item" mode="global_menu">
<xsl:choose>
<xsl:when test="descendant-or-self::*/@id = /node()/@id">
<xsl:value-of select="title"/>
</xsl:when>
<xsl:otherwise>
<xsl:call-template name="href_attribute"/>
<xsl:value-of select="title"/>
</xsl:otherwise>
</xsl:choose>
</xsl:template>
:
<xsl:choose>
<xsl:when></xsl:when>
<xsl:otherwise></xsl:otherwise>
</xsl:choose>
…, , XML- . : <xsl:when test="descendant-or-self::*/@id = /node()/@id">
ID ( document ) ( item ), , .
<xsl:when></xsl:when>
, . <xsl:otherwise></xsl:otherwise>
- .
8. , href_attribute :
<xsl:template name="href_attribute">
<xsl:attribute name="href">
<xsl:text>/</xsl:text>
<xsl:for-each select="ancestor-or-self::item">
<xsl:value-of select="dir"/>
<xsl:text>/</xsl:text>
</xsl:for-each>
</xsl:attribute>
</xsl:template>
xsl:attribute . . a , , href , .. .
<xsl:for-each select="ancestor-or-self::item">
, . ancestor-or-self::item - . dir , .. -.
, - , . , .
UPD:
. , :
parser.proc.ru/iso/xslt-1.zip
( ) Apache.
XML- /xsl/document.xml
- ( ). :
Lang - . . Id - .
<lang_table>
- , .
- :
- ( ):
<item id="0" parent_id="0" is_published="1" section="1">
- . :
Id - . Parent_id - . Is_published - . Dir - uri- . . Section - . .
- .
CMS : :
Html - . , . Com - -. , CMS: , , ..
XSL- , . .
CMS , :
:
Id - .
Container - - ( ).
Sorting - .
Type - :
Com - -
Html - .
Method - .
Title - .
DTD ( ):
<!DOCTYPE site_page [
<!ENTITY nbsp " ">
<!ENTITY sect "§" >
<!ENTITY copy "©">
<!ENTITY laquo "«">
<!ENTITY reg "®">
<!ENTITY deg "°">
<!ENTITY plusmn "±">
<!ENTITY para "¶">
<!ENTITY raquo "»">
<!ENTITY times "×">
<!ENTITY bull "•">
<!ENTITY hellip "…">
<!ENTITY ndash "–">
<!ENTITY mdash "—">
<!ENTITY lsquo "'">
<!ENTITY rsquo "'">
<!ENTITY sbquo "‚">
<!ENTITY ldquo "“">
<!ENTITY rdquo "”">
<!ENTITY bdquo "„">
<!ENTITY lsaquo "‹">
<!ENTITY rsaquo "›" >
<!ENTITY euro "€">
]>
XML- . <?xml version="1.0" encoding="windows-1251"?>
.
XHML-
XSL- XHTML- ( ). XHTML-, , .
.
XHML- , , :
( ). - , . / .
HTML-:
...
...
...
...
...
XSL-
XSL- :
<xsl:stylesheet version = '1.0' encoding="UTF-8"?>
<xsl:template match="element">
</xsl:template>
</xsl:stylesheet>
: <xsl:stylesheet version = '1.0' encoding="UTF-8"?>
- XML- . UTF-8 ( , ).
<xsl:stylesheet> </xsl:stylesheet>
- XSL-.
<xsl:template match="element"> </xsl:template>
- element.
:
<xsl:template match="element"></xsl:template>
- , element . element . <xsl:template match="element" mode="mode1"></xsl:template>
- , element mode1 . element . <xsl:template name="template-name"></xsl:template>
- template-name . - XML- .
XML- (, XML-, item ), " " :
<xsl:template match="navigation/sections/item"></xsl:template>
, , .., , , , .. navigation , navigation/sections/item sections/item .
, - . , xsl- . .
xsl .
, ( ) :
template_folder - . , my_template . dtd - . . lang - ( ). mod - .
xsl/my_template , layout.xsl :
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE xsl:stylesheet SYSTEM "../dtd/entities.dtd">
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:template match="/node()">
</xsl:template>
</xsl:stylesheet>
:
<xsl:template match="/node()"> </xsl:template>
- /node() (). /node() //document , .. .
XHTML- <xsl:template match="/node()"></xsl:template>
XML- . , XSL- XML- XHTML- .
, XSL template.xsl (, template - ), :
<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:import href=" my_template /layout.xsl"/>
</xsl:stylesheet>
:
<xsl:import href="my_template/layout.xsl"/>
XSL- ( XSL- ) . .
, .. XML- .
- .
, XML- :
<item id="0" parent_id="0" is_published="1" section="1">
/
<item id="1" parent_id="0" is_published="1" section="1" hit="yes">
news
:
id document - id . hit item - , , " ".
, , :
sections - . item - .
, , item item , , :
1. xsl/my_template navigation.xsl :
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE xsl:stylesheet SYSTEM "../dtd/entities.dtd">
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:template match="sections" mode="global_menu">
</xsl:template>
</xsl:stylesheet>
2. layout.xsl :
<xsl:template match="sections" mode="global_menu">
</xsl:template>
3. … layout.xsl :
<xsl:apply-templates select="navigation/sections" mode="global_menu"/>
:
select="navigation/sections" - ( ) - . , navigation/sections .
mode="global_menu" - global_menu . , , , " ", - .
4. , layout.xsl navigation.xsl :
<xsl:import href="navigation.xsl"/>
5. , navigation.xsl , :
<xsl:template match="item" mode="global_menu">
<xsl:call-template name="href_attribute"/>
<xsl:value-of select="title"/>
</xsl:template>
:
<xsl:call-template name="href_attribute"/>
- . , .. .
<xsl:value-of select="title"/>
- - title . @ - .
6. sections :
<xsl:template match="sections" mode="global_menu">
</xsl:template>
:
<xsl:apply-templates select="item" mode="global_menu"/>
- item sections . , item item ( sections/item/item ) , .. .
item ( ) . , : <xsl:call-template name="href_attribute"/>
uri- . .
7. ,
, . item :
<xsl:template match="item" mode="global_menu">
<xsl:choose>
<xsl:when test="descendant-or-self::*/@id = /node()/@id">
<xsl:value-of select="title"/>
</xsl:when>
<xsl:otherwise>
<xsl:call-template name="href_attribute"/>
<xsl:value-of select="title"/>
</xsl:otherwise>
</xsl:choose>
</xsl:template>
:
<xsl:choose>
<xsl:when></xsl:when>
<xsl:otherwise></xsl:otherwise>
</xsl:choose>
…, , XML- . : <xsl:when test="descendant-or-self::*/@id = /node()/@id">
ID ( document ) ( item ), , .
<xsl:when></xsl:when>
, . <xsl:otherwise></xsl:otherwise>
- .
8. , href_attribute :
<xsl:template name="href_attribute">
<xsl:attribute name="href">
<xsl:text>/</xsl:text>
<xsl:for-each select="ancestor-or-self::item">
<xsl:value-of select="dir"/>
<xsl:text>/</xsl:text>
</xsl:for-each>
</xsl:attribute>
</xsl:template>
xsl:attribute . . a , , href , .. .
<xsl:for-each select="ancestor-or-self::item">
, . ancestor-or-self::item - . dir , .. -.
, - , . , .
UPD:
. , :
parser.proc.ru/iso/xslt-1.zip
( ) Apache.
XML- /xsl/document.xml
- ( ). :
Lang - . . Id - .
<lang_table>
- , .
- :
- ( ):
<item id="0" parent_id="0" is_published="1" section="1">
- . :
Id - . Parent_id - . Is_published - . Dir - uri- . . Section - . .
- .
CMS : :
Html - . , . Com - -. , CMS: , , ..
XSL- , . .
CMS , :
:
Id - .
Container - - ( ).
Sorting - .
Type - :
Com - -
Html - .
Method - .
Title - .
DTD ( ):
<!DOCTYPE site_page [
<!ENTITY nbsp " ">
<!ENTITY sect "§" >
<!ENTITY copy "©">
<!ENTITY laquo "«">
<!ENTITY reg "®">
<!ENTITY deg "°">
<!ENTITY plusmn "±">
<!ENTITY para "¶">
<!ENTITY raquo "»">
<!ENTITY times "×">
<!ENTITY bull "•">
<!ENTITY hellip "…">
<!ENTITY ndash "–">
<!ENTITY mdash "—">
<!ENTITY lsquo "'">
<!ENTITY rsquo "'">
<!ENTITY sbquo "‚">
<!ENTITY ldquo "“">
<!ENTITY rdquo "”">
<!ENTITY bdquo "„">
<!ENTITY lsaquo "‹">
<!ENTITY rsaquo "›" >
<!ENTITY euro "€">
]>
XML- . <?xml version="1.0" encoding="windows-1251"?>
.
XHML-
XSL- XHTML- ( ). XHTML-, , .
.
XHML- , , :
( ). - , . / .
HTML-:
...
...
...
...
...
XSL-
XSL- :
<xsl:stylesheet version = '1.0' encoding="UTF-8"?>
<xsl:template match="element">
</xsl:template>
</xsl:stylesheet>
: <xsl:stylesheet version = '1.0' encoding="UTF-8"?>
- XML- . UTF-8 ( , ).
<xsl:stylesheet> </xsl:stylesheet>
- XSL-.
<xsl:template match="element"> </xsl:template>
- element.
:
<xsl:template match="element"></xsl:template>
- , element . element . <xsl:template match="element" mode="mode1"></xsl:template>
- , element mode1 . element . <xsl:template name="template-name"></xsl:template>
- template-name . - XML- .
XML- (, XML-, item ), " " :
<xsl:template match="navigation/sections/item"></xsl:template>
, , .., , , , .. navigation , navigation/sections/item sections/item .
, - . , xsl- . .
xsl .
, ( ) :
template_folder - . , my_template . dtd - . . lang - ( ). mod - .
xsl/my_template , layout.xsl :
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE xsl:stylesheet SYSTEM "../dtd/entities.dtd">
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:template match="/node()">
</xsl:template>
</xsl:stylesheet>
:
<xsl:template match="/node()"> </xsl:template>
- /node() (). /node() //document , .. .
XHTML- <xsl:template match="/node()"></xsl:template>
XML- . , XSL- XML- XHTML- .
, XSL template.xsl (, template - ), :
<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:import href=" my_template /layout.xsl"/>
</xsl:stylesheet>
:
<xsl:import href="my_template/layout.xsl"/>
XSL- ( XSL- ) . .
, .. XML- .
- .
, XML- :
<item id="0" parent_id="0" is_published="1" section="1">
/
<item id="1" parent_id="0" is_published="1" section="1" hit="yes">
news
:
id document - id . hit item - , , " ".
, , :
sections - . item - .
, , item item , , :
1. xsl/my_template navigation.xsl :
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE xsl:stylesheet SYSTEM "../dtd/entities.dtd">
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:template match="sections" mode="global_menu">
</xsl:template>
</xsl:stylesheet>
2. layout.xsl :
<xsl:template match="sections" mode="global_menu">
</xsl:template>
3. … layout.xsl :
<xsl:apply-templates select="navigation/sections" mode="global_menu"/>
:
select="navigation/sections" - ( ) - . , navigation/sections .
mode="global_menu" - global_menu . , , , " ", - .
4. , layout.xsl navigation.xsl :
<xsl:import href="navigation.xsl"/>
5. , navigation.xsl , :
<xsl:template match="item" mode="global_menu">
<xsl:call-template name="href_attribute"/>
<xsl:value-of select="title"/>
</xsl:template>
:
<xsl:call-template name="href_attribute"/>
- . , .. .
<xsl:value-of select="title"/>
- - title . @ - .
6. sections :
<xsl:template match="sections" mode="global_menu">
</xsl:template>
:
<xsl:apply-templates select="item" mode="global_menu"/>
- item sections . , item item ( sections/item/item ) , .. .
item ( ) . , : <xsl:call-template name="href_attribute"/>
uri- . .
7. ,
, . item :
<xsl:template match="item" mode="global_menu">
<xsl:choose>
<xsl:when test="descendant-or-self::*/@id = /node()/@id">
<xsl:value-of select="title"/>
</xsl:when>
<xsl:otherwise>
<xsl:call-template name="href_attribute"/>
<xsl:value-of select="title"/>
</xsl:otherwise>
</xsl:choose>
</xsl:template>
:
<xsl:choose>
<xsl:when></xsl:when>
<xsl:otherwise></xsl:otherwise>
</xsl:choose>
…, , XML- . : <xsl:when test="descendant-or-self::*/@id = /node()/@id">
ID ( document ) ( item ), , .
<xsl:when></xsl:when>
, . <xsl:otherwise></xsl:otherwise>
- .
8. , href_attribute :
<xsl:template name="href_attribute">
<xsl:attribute name="href">
<xsl:text>/</xsl:text>
<xsl:for-each select="ancestor-or-self::item">
<xsl:value-of select="dir"/>
<xsl:text>/</xsl:text>
</xsl:for-each>
</xsl:attribute>
</xsl:template>
xsl:attribute . . a , , href , .. .
<xsl:for-each select="ancestor-or-self::item">
, . ancestor-or-self::item - . dir , .. -.
, - , . , .
UPD:
. , :
parser.proc.ru/iso/xslt-1.zip
( ) Apache.
XML- /xsl/document.xml
- ( ). :
Lang - . . Id - .
<lang_table>
- , .
- :
- ( ):
<item id="0" parent_id="0" is_published="1" section="1">
- . :
Id - . Parent_id - . Is_published - . Dir - uri- . . Section - . .
- .
CMS : :
Html - . , . Com - -. , CMS: , , ..
XSL- , . .
CMS , :
:
Id - .
Container - - ( ).
Sorting - .
Type - :
Com - -
Html - .
Method - .
Title - .
DTD ( ):
<!DOCTYPE site_page [
<!ENTITY nbsp " ">
<!ENTITY sect "§" >
<!ENTITY copy "©">
<!ENTITY laquo "«">
<!ENTITY reg "®">
<!ENTITY deg "°">
<!ENTITY plusmn "±">
<!ENTITY para "¶">
<!ENTITY raquo "»">
<!ENTITY times "×">
<!ENTITY bull "•">
<!ENTITY hellip "…">
<!ENTITY ndash "–">
<!ENTITY mdash "—">
<!ENTITY lsquo "'">
<!ENTITY rsquo "'">
<!ENTITY sbquo "‚">
<!ENTITY ldquo "“">
<!ENTITY rdquo "”">
<!ENTITY bdquo "„">
<!ENTITY lsaquo "‹">
<!ENTITY rsaquo "›" >
<!ENTITY euro "€">
]>
XML- . <?xml version="1.0" encoding="windows-1251"?>
.
XHML-
XSL- XHTML- ( ). XHTML-, , .
.
XHML- , , :
( ). - , . / .
HTML-:
...
...
...
...
...
XSL-
XSL- :
<xsl:stylesheet version = '1.0' encoding="UTF-8"?>
<xsl:template match="element">
</xsl:template>
</xsl:stylesheet>
: <xsl:stylesheet version = '1.0' encoding="UTF-8"?>
- XML- . UTF-8 ( , ).
<xsl:stylesheet> </xsl:stylesheet>
- XSL-.
<xsl:template match="element"> </xsl:template>
- element.
:
<xsl:template match="element"></xsl:template>
- , element . element . <xsl:template match="element" mode="mode1"></xsl:template>
- , element mode1 . element . <xsl:template name="template-name"></xsl:template>
- template-name . - XML- .
XML- (, XML-, item ), " " :
<xsl:template match="navigation/sections/item"></xsl:template>
, , .., , , , .. navigation , navigation/sections/item sections/item .
, - . , xsl- . .
xsl .
, ( ) :
template_folder - . , my_template . dtd - . . lang - ( ). mod - .
xsl/my_template , layout.xsl :
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE xsl:stylesheet SYSTEM "../dtd/entities.dtd">
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:template match="/node()">
</xsl:template>
</xsl:stylesheet>
:
<xsl:template match="/node()"> </xsl:template>
- /node() (). /node() //document , .. .
XHTML- <xsl:template match="/node()"></xsl:template>
XML- . , XSL- XML- XHTML- .
, XSL template.xsl (, template - ), :
<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:import href=" my_template /layout.xsl"/>
</xsl:stylesheet>
:
<xsl:import href="my_template/layout.xsl"/>
XSL- ( XSL- ) . .
, .. XML- .
- .
, XML- :
<item id="0" parent_id="0" is_published="1" section="1">
/
<item id="1" parent_id="0" is_published="1" section="1" hit="yes">
news
:
id document - id . hit item - , , " ".
, , :
sections - . item - .
, , item item , , :
1. xsl/my_template navigation.xsl :
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE xsl:stylesheet SYSTEM "../dtd/entities.dtd">
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:template match="sections" mode="global_menu">
</xsl:template>
</xsl:stylesheet>
2. layout.xsl :
<xsl:template match="sections" mode="global_menu">
</xsl:template>
3. … layout.xsl :
<xsl:apply-templates select="navigation/sections" mode="global_menu"/>
:
select="navigation/sections" - ( ) - . , navigation/sections .
mode="global_menu" - global_menu . , , , " ", - .
4. , layout.xsl navigation.xsl :
<xsl:import href="navigation.xsl"/>
5. , navigation.xsl , :
<xsl:template match="item" mode="global_menu">
<xsl:call-template name="href_attribute"/>
<xsl:value-of select="title"/>
</xsl:template>
:
<xsl:call-template name="href_attribute"/>
- . , .. .
<xsl:value-of select="title"/>
- - title . @ - .
6. sections :
<xsl:template match="sections" mode="global_menu">
</xsl:template>
:
<xsl:apply-templates select="item" mode="global_menu"/>
- item sections . , item item ( sections/item/item ) , .. .
item ( ) . , : <xsl:call-template name="href_attribute"/>
uri- . .
7. ,
, . item :
<xsl:template match="item" mode="global_menu">
<xsl:choose>
<xsl:when test="descendant-or-self::*/@id = /node()/@id">
<xsl:value-of select="title"/>
</xsl:when>
<xsl:otherwise>
<xsl:call-template name="href_attribute"/>
<xsl:value-of select="title"/>
</xsl:otherwise>
</xsl:choose>
</xsl:template>
:
<xsl:choose>
<xsl:when></xsl:when>
<xsl:otherwise></xsl:otherwise>
</xsl:choose>
…, , XML- . : <xsl:when test="descendant-or-self::*/@id = /node()/@id">
ID ( document ) ( item ), , .
<xsl:when></xsl:when>
, . <xsl:otherwise></xsl:otherwise>
- .
8. , href_attribute :
<xsl:template name="href_attribute">
<xsl:attribute name="href">
<xsl:text>/</xsl:text>
<xsl:for-each select="ancestor-or-self::item">
<xsl:value-of select="dir"/>
<xsl:text>/</xsl:text>
</xsl:for-each>
</xsl:attribute>
</xsl:template>
xsl:attribute . . a , , href , .. .
<xsl:for-each select="ancestor-or-self::item">
, . ancestor-or-self::item - . dir , .. -.
, - , . , .
UPD:
. , :
parser.proc.ru/iso/xslt-1.zip
( ) Apache.
XML- /xsl/document.xml
- ( ). :
Lang - . . Id - .
<lang_table>
- , .
- :
- ( ):
<item id="0" parent_id="0" is_published="1" section="1">
- . :
Id - . Parent_id - . Is_published - . Dir - uri- . . Section - . .
- .
CMS : :
Html - . , . Com - -. , CMS: , , ..
XSL- , . .
CMS , :
:
Id - .
Container - - ( ).
Sorting - .
Type - :
Com - -
Html - .
Method - .
Title - .
DTD ( ):
<!DOCTYPE site_page [
<!ENTITY nbsp " ">
<!ENTITY sect "§" >
<!ENTITY copy "©">
<!ENTITY laquo "«">
<!ENTITY reg "®">
<!ENTITY deg "°">
<!ENTITY plusmn "±">
<!ENTITY para "¶">
<!ENTITY raquo "»">
<!ENTITY times "×">
<!ENTITY bull "•">
<!ENTITY hellip "…">
<!ENTITY ndash "–">
<!ENTITY mdash "—">
<!ENTITY lsquo "'">
<!ENTITY rsquo "'">
<!ENTITY sbquo "‚">
<!ENTITY ldquo "“">
<!ENTITY rdquo "”">
<!ENTITY bdquo "„">
<!ENTITY lsaquo "‹">
<!ENTITY rsaquo "›" >
<!ENTITY euro "€">
]>
XML- . <?xml version="1.0" encoding="windows-1251"?>
.
XHML-
XSL- XHTML- ( ). XHTML-, , .
.
XHML- , , :
( ). - , . / .
HTML-:
...
...
...
...
...
XSL-
XSL- :
<xsl:stylesheet version = '1.0' encoding="UTF-8"?>
<xsl:template match="element">
</xsl:template>
</xsl:stylesheet>
: <xsl:stylesheet version = '1.0' encoding="UTF-8"?>
- XML- . UTF-8 ( , ).
<xsl:stylesheet> </xsl:stylesheet>
- XSL-.
<xsl:template match="element"> </xsl:template>
- element.
:
<xsl:template match="element"></xsl:template>
- , element . element . <xsl:template match="element" mode="mode1"></xsl:template>
- , element mode1 . element . <xsl:template name="template-name"></xsl:template>
- template-name . - XML- .
XML- (, XML-, item ), " " :
<xsl:template match="navigation/sections/item"></xsl:template>
, , .., , , , .. navigation , navigation/sections/item sections/item .
, - . , xsl- . .
xsl .
, ( ) :
template_folder - . , my_template . dtd - . . lang - ( ). mod - .
xsl/my_template , layout.xsl :
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE xsl:stylesheet SYSTEM "../dtd/entities.dtd">
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:template match="/node()">
</xsl:template>
</xsl:stylesheet>
:
<xsl:template match="/node()"> </xsl:template>
- /node() (). /node() //document , .. .
XHTML- <xsl:template match="/node()"></xsl:template>
XML- . , XSL- XML- XHTML- .
, XSL template.xsl (, template - ), :
<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:import href=" my_template /layout.xsl"/>
</xsl:stylesheet>
:
<xsl:import href="my_template/layout.xsl"/>
XSL- ( XSL- ) . .
, .. XML- .
- .
, XML- :
<item id="0" parent_id="0" is_published="1" section="1">
/
<item id="1" parent_id="0" is_published="1" section="1" hit="yes">
news
:
id document - id . hit item - , , " ".
, , :
sections - . item - .
, , item item , , :
1. xsl/my_template navigation.xsl :
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE xsl:stylesheet SYSTEM "../dtd/entities.dtd">
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:template match="sections" mode="global_menu">
</xsl:template>
</xsl:stylesheet>
2. layout.xsl :
<xsl:template match="sections" mode="global_menu">
</xsl:template>
3. … layout.xsl :
<xsl:apply-templates select="navigation/sections" mode="global_menu"/>
:
select="navigation/sections" - ( ) - . , navigation/sections .
mode="global_menu" - global_menu . , , , " ", - .
4. , layout.xsl navigation.xsl :
<xsl:import href="navigation.xsl"/>
5. , navigation.xsl , :
<xsl:template match="item" mode="global_menu">
<xsl:call-template name="href_attribute"/>
<xsl:value-of select="title"/>
</xsl:template>
:
<xsl:call-template name="href_attribute"/>
- . , .. .
<xsl:value-of select="title"/>
- - title . @ - .
6. sections :
<xsl:template match="sections" mode="global_menu">
</xsl:template>
:
<xsl:apply-templates select="item" mode="global_menu"/>
- item sections . , item item ( sections/item/item ) , .. .
item ( ) . , : <xsl:call-template name="href_attribute"/>
uri- . .
7. ,
, . item :
<xsl:template match="item" mode="global_menu">
<xsl:choose>
<xsl:when test="descendant-or-self::*/@id = /node()/@id">
<xsl:value-of select="title"/>
</xsl:when>
<xsl:otherwise>
<xsl:call-template name="href_attribute"/>
<xsl:value-of select="title"/>
</xsl:otherwise>
</xsl:choose>
</xsl:template>
:
<xsl:choose>
<xsl:when></xsl:when>
<xsl:otherwise></xsl:otherwise>
</xsl:choose>
…, , XML- . : <xsl:when test="descendant-or-self::*/@id = /node()/@id">
ID ( document ) ( item ), , .
<xsl:when></xsl:when>
, . <xsl:otherwise></xsl:otherwise>
- .
8. , href_attribute :
<xsl:template name="href_attribute">
<xsl:attribute name="href">
<xsl:text>/</xsl:text>
<xsl:for-each select="ancestor-or-self::item">
<xsl:value-of select="dir"/>
<xsl:text>/</xsl:text>
</xsl:for-each>
</xsl:attribute>
</xsl:template>
xsl:attribute . . a , , href , .. .
<xsl:for-each select="ancestor-or-self::item">
, . ancestor-or-self::item - . dir , .. -.
, - , . , .
UPD:
. , :
parser.proc.ru/iso/xslt-1.zip
( ) Apache.
XML- /xsl/document.xml
- ( ). :
Lang - . . Id - .
<lang_table>
- , .
- :
- ( ):
<item id="0" parent_id="0" is_published="1" section="1">
- . :
Id - . Parent_id - . Is_published - . Dir - uri- . . Section - . .
- .
CMS : :
Html - . , . Com - -. , CMS: , , ..
XSL- , . .
CMS , :
:
Id - .
Container - - ( ).
Sorting - .
Type - :
Com - -
Html - .
Method - .
Title - .
DTD ( ):
<!DOCTYPE site_page [
<!ENTITY nbsp " ">
<!ENTITY sect "§" >
<!ENTITY copy "©">
<!ENTITY laquo "«">
<!ENTITY reg "®">
<!ENTITY deg "°">
<!ENTITY plusmn "±">
<!ENTITY para "¶">
<!ENTITY raquo "»">
<!ENTITY times "×">
<!ENTITY bull "•">
<!ENTITY hellip "…">
<!ENTITY ndash "–">
<!ENTITY mdash "—">
<!ENTITY lsquo "'">
<!ENTITY rsquo "'">
<!ENTITY sbquo "‚">
<!ENTITY ldquo "“">
<!ENTITY rdquo "”">
<!ENTITY bdquo "„">
<!ENTITY lsaquo "‹">
<!ENTITY rsaquo "›" >
<!ENTITY euro "€">
]>
XML- . <?xml version="1.0" encoding="windows-1251"?>
.
XHML-
XSL- XHTML- ( ). XHTML-, , .
.
XHML- , , :
( ). - , . / .
HTML-:
...
...
...
...
...
XSL-
XSL- :
<xsl:stylesheet version = '1.0' encoding="UTF-8"?>
<xsl:template match="element">
</xsl:template>
</xsl:stylesheet>
: <xsl:stylesheet version = '1.0' encoding="UTF-8"?>
- XML- . UTF-8 ( , ).
<xsl:stylesheet> </xsl:stylesheet>
- XSL-.
<xsl:template match="element"> </xsl:template>
- element.
:
<xsl:template match="element"></xsl:template>
- , element . element . <xsl:template match="element" mode="mode1"></xsl:template>
- , element mode1 . element . <xsl:template name="template-name"></xsl:template>
- template-name . - XML- .
XML- (, XML-, item ), " " :
<xsl:template match="navigation/sections/item"></xsl:template>
, , .., , , , .. navigation , navigation/sections/item sections/item .
, - . , xsl- . .
xsl .
, ( ) :
template_folder - . , my_template . dtd - . . lang - ( ). mod - .
xsl/my_template , layout.xsl :
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE xsl:stylesheet SYSTEM "../dtd/entities.dtd">
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:template match="/node()">
</xsl:template>
</xsl:stylesheet>
:
<xsl:template match="/node()"> </xsl:template>
- /node() (). /node() //document , .. .
XHTML- <xsl:template match="/node()"></xsl:template>
XML- . , XSL- XML- XHTML- .
, XSL template.xsl (, template - ), :
<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:import href=" my_template /layout.xsl"/>
</xsl:stylesheet>
:
<xsl:import href="my_template/layout.xsl"/>
XSL- ( XSL- ) . .
, .. XML- .
- .
, XML- :
<item id="0" parent_id="0" is_published="1" section="1">
/
<item id="1" parent_id="0" is_published="1" section="1" hit="yes">
news
:
id document - id . hit item - , , " ".
, , :
sections - . item - .
, , item item , , :
1. xsl/my_template navigation.xsl :
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE xsl:stylesheet SYSTEM "../dtd/entities.dtd">
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:template match="sections" mode="global_menu">
</xsl:template>
</xsl:stylesheet>
2. layout.xsl :
<xsl:template match="sections" mode="global_menu">
</xsl:template>
3. … layout.xsl :
<xsl:apply-templates select="navigation/sections" mode="global_menu"/>
:
select="navigation/sections" - ( ) - . , navigation/sections .
mode="global_menu" - global_menu . , , , " ", - .
4. , layout.xsl navigation.xsl :
<xsl:import href="navigation.xsl"/>
5. , navigation.xsl , :
<xsl:template match="item" mode="global_menu">
<xsl:call-template name="href_attribute"/>
<xsl:value-of select="title"/>
</xsl:template>
:
<xsl:call-template name="href_attribute"/>
- . , .. .
<xsl:value-of select="title"/>
- - title . @ - .
6. sections :
<xsl:template match="sections" mode="global_menu">
</xsl:template>
:
<xsl:apply-templates select="item" mode="global_menu"/>
- item sections . , item item ( sections/item/item ) , .. .
item ( ) . , : <xsl:call-template name="href_attribute"/>
uri- . .
7. ,
, . item :
<xsl:template match="item" mode="global_menu">
<xsl:choose>
<xsl:when test="descendant-or-self::*/@id = /node()/@id">
<xsl:value-of select="title"/>
</xsl:when>
<xsl:otherwise>
<xsl:call-template name="href_attribute"/>
<xsl:value-of select="title"/>
</xsl:otherwise>
</xsl:choose>
</xsl:template>
:
<xsl:choose>
<xsl:when></xsl:when>
<xsl:otherwise></xsl:otherwise>
</xsl:choose>
…, , XML- . : <xsl:when test="descendant-or-self::*/@id = /node()/@id">
ID ( document ) ( item ), , .
<xsl:when></xsl:when>
, . <xsl:otherwise></xsl:otherwise>
- .
8. , href_attribute :
<xsl:template name="href_attribute">
<xsl:attribute name="href">
<xsl:text>/</xsl:text>
<xsl:for-each select="ancestor-or-self::item">
<xsl:value-of select="dir"/>
<xsl:text>/</xsl:text>
</xsl:for-each>
</xsl:attribute>
</xsl:template>
xsl:attribute . . a , , href , .. .
<xsl:for-each select="ancestor-or-self::item">
, . ancestor-or-self::item - . dir , .. -.
, - , . , .
UPD:
. , :
parser.proc.ru/iso/xslt-1.zip
( ) Apache.
XML- /xsl/document.xml
- ( ). :
Lang - . . Id - .
<lang_table>
- , .
- :
- ( ):
<item id="0" parent_id="0" is_published="1" section="1">
- . :
Id - . Parent_id - . Is_published - . Dir - uri- . . Section - . .
- .
CMS : :
Html - . , . Com - -. , CMS: , , ..
XSL- , . .
CMS , :
:
Id - .
Container - - ( ).
Sorting - .
Type - :
Com - -
Html - .
Method - .
Title - .
DTD ( ):
<!DOCTYPE site_page [
<!ENTITY nbsp " ">
<!ENTITY sect "§" >
<!ENTITY copy "©">
<!ENTITY laquo "«">
<!ENTITY reg "®">
<!ENTITY deg "°">
<!ENTITY plusmn "±">
<!ENTITY para "¶">
<!ENTITY raquo "»">
<!ENTITY times "×">
<!ENTITY bull "•">
<!ENTITY hellip "…">
<!ENTITY ndash "–">
<!ENTITY mdash "—">
<!ENTITY lsquo "'">
<!ENTITY rsquo "'">
<!ENTITY sbquo "‚">
<!ENTITY ldquo "“">
<!ENTITY rdquo "”">
<!ENTITY bdquo "„">
<!ENTITY lsaquo "‹">
<!ENTITY rsaquo "›" >
<!ENTITY euro "€">
]>
XML- . <?xml version="1.0" encoding="windows-1251"?>
.
XHML-
XSL- XHTML- ( ). XHTML-, , .
.
XHML- , , :
( ). - , . / .
HTML-:
...
...
...
...
...
XSL-
XSL- :
<xsl:stylesheet version = '1.0' encoding="UTF-8"?>
<xsl:template match="element">
</xsl:template>
</xsl:stylesheet>
: <xsl:stylesheet version = '1.0' encoding="UTF-8"?>
- XML- . UTF-8 ( , ).
<xsl:stylesheet> </xsl:stylesheet>
- XSL-.
<xsl:template match="element"> </xsl:template>
- element.
:
<xsl:template match="element"></xsl:template>
- , element . element . <xsl:template match="element" mode="mode1"></xsl:template>
- , element mode1 . element . <xsl:template name="template-name"></xsl:template>
- template-name . - XML- .
XML- (, XML-, item ), " " :
<xsl:template match="navigation/sections/item"></xsl:template>
, , .., , , , .. navigation , navigation/sections/item sections/item .
, - . , xsl- . .
xsl .
, ( ) :
template_folder - . , my_template . dtd - . . lang - ( ). mod - .
xsl/my_template , layout.xsl :
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE xsl:stylesheet SYSTEM "../dtd/entities.dtd">
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:template match="/node()">
</xsl:template>
</xsl:stylesheet>
:
<xsl:template match="/node()"> </xsl:template>
- /node() (). /node() //document , .. .
XHTML- <xsl:template match="/node()"></xsl:template>
XML- . , XSL- XML- XHTML- .
, XSL template.xsl (, template - ), :
<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:import href=" my_template /layout.xsl"/>
</xsl:stylesheet>
:
<xsl:import href="my_template/layout.xsl"/>
XSL- ( XSL- ) . .
, .. XML- .
- .
, XML- :
<item id="0" parent_id="0" is_published="1" section="1">
/
<item id="1" parent_id="0" is_published="1" section="1" hit="yes">
news
:
id document - id . hit item - , , " ".
, , :
sections - . item - .
, , item item , , :
1. xsl/my_template navigation.xsl :
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE xsl:stylesheet SYSTEM "../dtd/entities.dtd">
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:template match="sections" mode="global_menu">
</xsl:template>
</xsl:stylesheet>
2. layout.xsl :
<xsl:template match="sections" mode="global_menu">
</xsl:template>
3. … layout.xsl :
<xsl:apply-templates select="navigation/sections" mode="global_menu"/>
:
select="navigation/sections" - ( ) - . , navigation/sections .
mode="global_menu" - global_menu . , , , " ", - .
4. , layout.xsl navigation.xsl :
<xsl:import href="navigation.xsl"/>
5. , navigation.xsl , :
<xsl:template match="item" mode="global_menu">
<xsl:call-template name="href_attribute"/>
<xsl:value-of select="title"/>
</xsl:template>
:
<xsl:call-template name="href_attribute"/>
- . , .. .
<xsl:value-of select="title"/>
- - title . @ - .
6. sections :
<xsl:template match="sections" mode="global_menu">
</xsl:template>
:
<xsl:apply-templates select="item" mode="global_menu"/>
- item sections . , item item ( sections/item/item ) , .. .
item ( ) . , : <xsl:call-template name="href_attribute"/>
uri- . .
7. ,
, . item :
<xsl:template match="item" mode="global_menu">
<xsl:choose>
<xsl:when test="descendant-or-self::*/@id = /node()/@id">
<xsl:value-of select="title"/>
</xsl:when>
<xsl:otherwise>
<xsl:call-template name="href_attribute"/>
<xsl:value-of select="title"/>
</xsl:otherwise>
</xsl:choose>
</xsl:template>
:
<xsl:choose>
<xsl:when></xsl:when>
<xsl:otherwise></xsl:otherwise>
</xsl:choose>
…, , XML- . : <xsl:when test="descendant-or-self::*/@id = /node()/@id">
ID ( document ) ( item ), , .
<xsl:when></xsl:when>
, . <xsl:otherwise></xsl:otherwise>
- .
8. , href_attribute :
<xsl:template name="href_attribute">
<xsl:attribute name="href">
<xsl:text>/</xsl:text>
<xsl:for-each select="ancestor-or-self::item">
<xsl:value-of select="dir"/>
<xsl:text>/</xsl:text>
</xsl:for-each>
</xsl:attribute>
</xsl:template>
xsl:attribute . . a , , href , .. .
<xsl:for-each select="ancestor-or-self::item">
, . ancestor-or-self::item - . dir , .. -.
, - , . , .
UPD:
. , :
parser.proc.ru/iso/xslt-1.zip
( ) Apache.
XML- /xsl/document.xml
- ( ). :
Lang - . . Id - .
<lang_table>
- , .
- :
- ( ):
<item id="0" parent_id="0" is_published="1" section="1">
- . :
Id - . Parent_id - . Is_published - . Dir - uri- . . Section - . .
- .
CMS : :
Html - . , . Com - -. , CMS: , , ..
XSL- , . .
CMS , :
:
Id - .
Container - - ( ).
Sorting - .
Type - :
Com - -
Html - .
Method - .
Title - .
DTD ( ):
<!DOCTYPE site_page [
<!ENTITY nbsp " ">
<!ENTITY sect "§" >
<!ENTITY copy "©">
<!ENTITY laquo "«">
<!ENTITY reg "®">
<!ENTITY deg "°">
<!ENTITY plusmn "±">
<!ENTITY para "¶">
<!ENTITY raquo "»">
<!ENTITY times "×">
<!ENTITY bull "•">
<!ENTITY hellip "…">
<!ENTITY ndash "–">
<!ENTITY mdash "—">
<!ENTITY lsquo "'">
<!ENTITY rsquo "'">
<!ENTITY sbquo "‚">
<!ENTITY ldquo "“">
<!ENTITY rdquo "”">
<!ENTITY bdquo "„">
<!ENTITY lsaquo "‹">
<!ENTITY rsaquo "›" >
<!ENTITY euro "€">
]>
XML- . <?xml version="1.0" encoding="windows-1251"?>
.
XHML-
XSL- XHTML- ( ). XHTML-, , .
.
XHML- , , :
( ). - , . / .
HTML-:
...
...
...
...
...
XSL-
XSL- :
<xsl:stylesheet version = '1.0' encoding="UTF-8"?>
<xsl:template match="element">
</xsl:template>
</xsl:stylesheet>
: <xsl:stylesheet version = '1.0' encoding="UTF-8"?>
- XML- . UTF-8 ( , ).
<xsl:stylesheet> </xsl:stylesheet>
- XSL-.
<xsl:template match="element"> </xsl:template>
- element.
:
<xsl:template match="element"></xsl:template>
- , element . element . <xsl:template match="element" mode="mode1"></xsl:template>
- , element mode1 . element . <xsl:template name="template-name"></xsl:template>
- template-name . - XML- .
XML- (, XML-, item ), " " :
<xsl:template match="navigation/sections/item"></xsl:template>
, , .., , , , .. navigation , navigation/sections/item sections/item .
, - . , xsl- . .
xsl .
, ( ) :
template_folder - . , my_template . dtd - . . lang - ( ). mod - .
xsl/my_template , layout.xsl :
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE xsl:stylesheet SYSTEM "../dtd/entities.dtd">
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:template match="/node()">
</xsl:template>
</xsl:stylesheet>
:
<xsl:template match="/node()"> </xsl:template>
- /node() (). /node() //document , .. .
XHTML- <xsl:template match="/node()"></xsl:template>
XML- . , XSL- XML- XHTML- .
, XSL template.xsl (, template - ), :
<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:import href=" my_template /layout.xsl"/>
</xsl:stylesheet>
:
<xsl:import href="my_template/layout.xsl"/>
XSL- ( XSL- ) . .
, .. XML- .
- .
, XML- :
<item id="0" parent_id="0" is_published="1" section="1">
/
<item id="1" parent_id="0" is_published="1" section="1" hit="yes">
news
:
id document - id . hit item - , , " ".
, , :
sections - . item - .
, , item item , , :
1. xsl/my_template navigation.xsl :
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE xsl:stylesheet SYSTEM "../dtd/entities.dtd">
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:template match="sections" mode="global_menu">
</xsl:template>
</xsl:stylesheet>
2. layout.xsl :
<xsl:template match="sections" mode="global_menu">
</xsl:template>
3. … layout.xsl :
<xsl:apply-templates select="navigation/sections" mode="global_menu"/>
:
select="navigation/sections" - ( ) - . , navigation/sections .
mode="global_menu" - global_menu . , , , " ", - .
4. , layout.xsl navigation.xsl :
<xsl:import href="navigation.xsl"/>
5. , navigation.xsl , :
<xsl:template match="item" mode="global_menu">
<xsl:call-template name="href_attribute"/>
<xsl:value-of select="title"/>
</xsl:template>
:
<xsl:call-template name="href_attribute"/>
- . , .. .
<xsl:value-of select="title"/>
- - title . @ - .
6. sections :
<xsl:template match="sections" mode="global_menu">
</xsl:template>
:
<xsl:apply-templates select="item" mode="global_menu"/>
- item sections . , item item ( sections/item/item ) , .. .
item ( ) . , : <xsl:call-template name="href_attribute"/>
uri- . .
7. ,
, . item :
<xsl:template match="item" mode="global_menu">
<xsl:choose>
<xsl:when test="descendant-or-self::*/@id = /node()/@id">
<xsl:value-of select="title"/>
</xsl:when>
<xsl:otherwise>
<xsl:call-template name="href_attribute"/>
<xsl:value-of select="title"/>
</xsl:otherwise>
</xsl:choose>
</xsl:template>
:
<xsl:choose>
<xsl:when></xsl:when>
<xsl:otherwise></xsl:otherwise>
</xsl:choose>
…, , XML- . : <xsl:when test="descendant-or-self::*/@id = /node()/@id">
ID ( document ) ( item ), , .
<xsl:when></xsl:when>
, . <xsl:otherwise></xsl:otherwise>
- .
8. , href_attribute :
<xsl:template name="href_attribute">
<xsl:attribute name="href">
<xsl:text>/</xsl:text>
<xsl:for-each select="ancestor-or-self::item">
<xsl:value-of select="dir"/>
<xsl:text>/</xsl:text>
</xsl:for-each>
</xsl:attribute>
</xsl:template>
xsl:attribute . . a , , href , .. .
<xsl:for-each select="ancestor-or-self::item">
, . ancestor-or-self::item - . dir , .. -.
, - , . , .
UPD:
. , :
parser.proc.ru/iso/xslt-1.zip
( ) Apache.
XML- /xsl/document.xml
- ( ). :
Lang - . . Id - .
<lang_table>
- , .
- :
- ( ):
<item id="0" parent_id="0" is_published="1" section="1">
- . :
Id - . Parent_id - . Is_published - . Dir - uri- . . Section - . .
- .
CMS : :
Html - . , . Com - -. , CMS: , , ..
XSL- , . .
CMS , :
:
Id - .
Container - - ( ).
Sorting - .
Type - :
Com - -
Html - .
Method - .
Title - .
DTD ( ):
<!DOCTYPE site_page [
<!ENTITY nbsp " ">
<!ENTITY sect "§" >
<!ENTITY copy "©">
<!ENTITY laquo "«">
<!ENTITY reg "®">
<!ENTITY deg "°">
<!ENTITY plusmn "±">
<!ENTITY para "¶">
<!ENTITY raquo "»">
<!ENTITY times "×">
<!ENTITY bull "•">
<!ENTITY hellip "…">
<!ENTITY ndash "–">
<!ENTITY mdash "—">
<!ENTITY lsquo "'">
<!ENTITY rsquo "'">
<!ENTITY sbquo "‚">
<!ENTITY ldquo "“">
<!ENTITY rdquo "”">
<!ENTITY bdquo "„">
<!ENTITY lsaquo "‹">
<!ENTITY rsaquo "›" >
<!ENTITY euro "€">
]>
XML- . <?xml version="1.0" encoding="windows-1251"?>
.
XHML-
XSL- XHTML- ( ). XHTML-, , .
.
XHML- , , :
( ). - , . / .
HTML-:
...
...
...
...
...
XSL-
XSL- :
<xsl:stylesheet version = '1.0' encoding="UTF-8"?>
<xsl:template match="element">
</xsl:template>
</xsl:stylesheet>
: <xsl:stylesheet version = '1.0' encoding="UTF-8"?>
- XML- . UTF-8 ( , ).
<xsl:stylesheet> </xsl:stylesheet>
- XSL-.
<xsl:template match="element"> </xsl:template>
- element.
:
<xsl:template match="element"></xsl:template>
- , element . element . <xsl:template match="element" mode="mode1"></xsl:template>
- , element mode1 . element . <xsl:template name="template-name"></xsl:template>
- template-name . - XML- .
XML- (, XML-, item ), " " :
<xsl:template match="navigation/sections/item"></xsl:template>
, , .., , , , .. navigation , navigation/sections/item sections/item .
, - . , xsl- . .
xsl .
, ( ) :
template_folder - . , my_template . dtd - . . lang - ( ). mod - .
xsl/my_template , layout.xsl :
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE xsl:stylesheet SYSTEM "../dtd/entities.dtd">
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:template match="/node()">
</xsl:template>
</xsl:stylesheet>
:
<xsl:template match="/node()"> </xsl:template>
- /node() (). /node() //document , .. .
XHTML- <xsl:template match="/node()"></xsl:template>
XML- . , XSL- XML- XHTML- .
, XSL template.xsl (, template - ), :
<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:import href=" my_template /layout.xsl"/>
</xsl:stylesheet>
:
<xsl:import href="my_template/layout.xsl"/>
XSL- ( XSL- ) . .
, .. XML- .
- .
, XML- :
<item id="0" parent_id="0" is_published="1" section="1">
/
<item id="1" parent_id="0" is_published="1" section="1" hit="yes">
news
:
id document - id . hit item - , , " ".
, , :
sections - . item - .
, , item item , , :
1. xsl/my_template navigation.xsl :
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE xsl:stylesheet SYSTEM "../dtd/entities.dtd">
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:template match="sections" mode="global_menu">
</xsl:template>
</xsl:stylesheet>
2. layout.xsl :
<xsl:template match="sections" mode="global_menu">
</xsl:template>
3. … layout.xsl :
<xsl:apply-templates select="navigation/sections" mode="global_menu"/>
:
select="navigation/sections" - ( ) - . , navigation/sections .
mode="global_menu" - global_menu . , , , " ", - .
4. , layout.xsl navigation.xsl :
<xsl:import href="navigation.xsl"/>
5. , navigation.xsl , :
<xsl:template match="item" mode="global_menu">
<xsl:call-template name="href_attribute"/>
<xsl:value-of select="title"/>
</xsl:template>
:
<xsl:call-template name="href_attribute"/>
- . , .. .
<xsl:value-of select="title"/>
- - title . @ - .
6. sections :
<xsl:template match="sections" mode="global_menu">
</xsl:template>
:
<xsl:apply-templates select="item" mode="global_menu"/>
- item sections . , item item ( sections/item/item ) , .. .
item ( ) . , : <xsl:call-template name="href_attribute"/>
uri- . .
7. ,
, . item :
<xsl:template match="item" mode="global_menu">
<xsl:choose>
<xsl:when test="descendant-or-self::*/@id = /node()/@id">
<xsl:value-of select="title"/>
</xsl:when>
<xsl:otherwise>
<xsl:call-template name="href_attribute"/>
<xsl:value-of select="title"/>
</xsl:otherwise>
</xsl:choose>
</xsl:template>
:
<xsl:choose>
<xsl:when></xsl:when>
<xsl:otherwise></xsl:otherwise>
</xsl:choose>
…, , XML- . : <xsl:when test="descendant-or-self::*/@id = /node()/@id">
ID ( document ) ( item ), , .
<xsl:when></xsl:when>
, . <xsl:otherwise></xsl:otherwise>
- .
8. , href_attribute :
<xsl:template name="href_attribute">
<xsl:attribute name="href">
<xsl:text>/</xsl:text>
<xsl:for-each select="ancestor-or-self::item">
<xsl:value-of select="dir"/>
<xsl:text>/</xsl:text>
</xsl:for-each>
</xsl:attribute>
</xsl:template>
xsl:attribute . . a , , href , .. .
<xsl:for-each select="ancestor-or-self::item">
, . ancestor-or-self::item - . dir , .. -.
, - , . , .
UPD:
. , :
parser.proc.ru/iso/xslt-1.zip
( ) Apache.
XML- /xsl/document.xml
- ( ). :
Lang - . . Id - .
<lang_table>
- , .
- :
- ( ):
<item id="0" parent_id="0" is_published="1" section="1">
- . :
Id - . Parent_id - . Is_published - . Dir - uri- . . Section - . .
- .
CMS : :
Html - . , . Com - -. , CMS: , , ..
XSL- , . .
CMS , :
:
Id - .
Container - - ( ).
Sorting - .
Type - :
Com - -
Html - .
Method - .
Title - .
DTD ( ):
<!DOCTYPE site_page [
<!ENTITY nbsp " ">
<!ENTITY sect "§" >
<!ENTITY copy "©">
<!ENTITY laquo "«">
<!ENTITY reg "®">
<!ENTITY deg "°">
<!ENTITY plusmn "±">
<!ENTITY para "¶">
<!ENTITY raquo "»">
<!ENTITY times "×">
<!ENTITY bull "•">
<!ENTITY hellip "…">
<!ENTITY ndash "–">
<!ENTITY mdash "—">
<!ENTITY lsquo "'">
<!ENTITY rsquo "'">
<!ENTITY sbquo "‚">
<!ENTITY ldquo "“">
<!ENTITY rdquo "”">
<!ENTITY bdquo "„">
<!ENTITY lsaquo "‹">
<!ENTITY rsaquo "›" >
<!ENTITY euro "€">
]>
XML- . <?xml version="1.0" encoding="windows-1251"?>
.
XHML-
XSL- XHTML- ( ). XHTML-, , .
.
XHML- , , :
( ). - , . / .
HTML-:
...
...
...
...
...
XSL-
XSL- :
<xsl:stylesheet version = '1.0' encoding="UTF-8"?>
<xsl:template match="element">
</xsl:template>
</xsl:stylesheet>
: <xsl:stylesheet version = '1.0' encoding="UTF-8"?>
- XML- . UTF-8 ( , ).
<xsl:stylesheet> </xsl:stylesheet>
- XSL-.
<xsl:template match="element"> </xsl:template>
- element.
:
<xsl:template match="element"></xsl:template>
- , element . element . <xsl:template match="element" mode="mode1"></xsl:template>
- , element mode1 . element . <xsl:template name="template-name"></xsl:template>
- template-name . - XML- .
XML- (, XML-, item ), " " :
<xsl:template match="navigation/sections/item"></xsl:template>
, , .., , , , .. navigation , navigation/sections/item sections/item .
, - . , xsl- . .
xsl .
, ( ) :
template_folder - . , my_template . dtd - . . lang - ( ). mod - .
xsl/my_template , layout.xsl :
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE xsl:stylesheet SYSTEM "../dtd/entities.dtd">
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:template match="/node()">
</xsl:template>
</xsl:stylesheet>
:
<xsl:template match="/node()"> </xsl:template>
- /node() (). /node() //document , .. .
XHTML- <xsl:template match="/node()"></xsl:template>
XML- . , XSL- XML- XHTML- .
, XSL template.xsl (, template - ), :
<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:import href=" my_template /layout.xsl"/>
</xsl:stylesheet>
:
<xsl:import href="my_template/layout.xsl"/>
XSL- ( XSL- ) . .
, .. XML- .
- .
, XML- :
<item id="0" parent_id="0" is_published="1" section="1">
/
<item id="1" parent_id="0" is_published="1" section="1" hit="yes">
news
:
id document - id . hit item - , , " ".
, , :
sections - . item - .
, , item item , , :
1. xsl/my_template navigation.xsl :
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE xsl:stylesheet SYSTEM "../dtd/entities.dtd">
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:template match="sections" mode="global_menu">
</xsl:template>
</xsl:stylesheet>
2. layout.xsl :
<xsl:template match="sections" mode="global_menu">
</xsl:template>
3. … layout.xsl :
<xsl:apply-templates select="navigation/sections" mode="global_menu"/>
:
select="navigation/sections" - ( ) - . , navigation/sections .
mode="global_menu" - global_menu . , , , " ", - .
4. , layout.xsl navigation.xsl :
<xsl:import href="navigation.xsl"/>
5. , navigation.xsl , :
<xsl:template match="item" mode="global_menu">
<xsl:call-template name="href_attribute"/>
<xsl:value-of select="title"/>
</xsl:template>
:
<xsl:call-template name="href_attribute"/>
- . , .. .
<xsl:value-of select="title"/>
- - title . @ - .
6. sections :
<xsl:template match="sections" mode="global_menu">
</xsl:template>
:
<xsl:apply-templates select="item" mode="global_menu"/>
- item sections . , item item ( sections/item/item ) , .. .
item ( ) . , : <xsl:call-template name="href_attribute"/>
uri- . .
7. ,
, . item :
<xsl:template match="item" mode="global_menu">
<xsl:choose>
<xsl:when test="descendant-or-self::*/@id = /node()/@id">
<xsl:value-of select="title"/>
</xsl:when>
<xsl:otherwise>
<xsl:call-template name="href_attribute"/>
<xsl:value-of select="title"/>
</xsl:otherwise>
</xsl:choose>
</xsl:template>
:
<xsl:choose>
<xsl:when></xsl:when>
<xsl:otherwise></xsl:otherwise>
</xsl:choose>
…, , XML- . : <xsl:when test="descendant-or-self::*/@id = /node()/@id">
ID ( document ) ( item ), , .
<xsl:when></xsl:when>
, . <xsl:otherwise></xsl:otherwise>
- .
8. , href_attribute :
<xsl:template name="href_attribute">
<xsl:attribute name="href">
<xsl:text>/</xsl:text>
<xsl:for-each select="ancestor-or-self::item">
<xsl:value-of select="dir"/>
<xsl:text>/</xsl:text>
</xsl:for-each>
</xsl:attribute>
</xsl:template>
xsl:attribute . . a , , href , .. .
<xsl:for-each select="ancestor-or-self::item">
, . ancestor-or-self::item - . dir , .. -.
, - , . , .
UPD:
. , :
parser.proc.ru/iso/xslt-1.zip
( ) Apache.
XML- /xsl/document.xml
- ( ). :
Lang - . . Id - .
<lang_table>
- , .
- :
- ( ):
<item id="0" parent_id="0" is_published="1" section="1">
- . :
Id - . Parent_id - . Is_published - . Dir - uri- . . Section - . .
- .
CMS : :
Html - . , . Com - -. , CMS: , , ..
XSL- , . .
CMS , :
:
Id - .
Container - - ( ).
Sorting - .
Type - :
Com - -
Html - .
Method - .
Title - .
DTD ( ):
<!DOCTYPE site_page [
<!ENTITY nbsp " ">
<!ENTITY sect "§" >
<!ENTITY copy "©">
<!ENTITY laquo "«">
<!ENTITY reg "®">
<!ENTITY deg "°">
<!ENTITY plusmn "±">
<!ENTITY para "¶">
<!ENTITY raquo "»">
<!ENTITY times "×">
<!ENTITY bull "•">
<!ENTITY hellip "…">
<!ENTITY ndash "–">
<!ENTITY mdash "—">
<!ENTITY lsquo "'">
<!ENTITY rsquo "'">
<!ENTITY sbquo "‚">
<!ENTITY ldquo "“">
<!ENTITY rdquo "”">
<!ENTITY bdquo "„">
<!ENTITY lsaquo "‹">
<!ENTITY rsaquo "›" >
<!ENTITY euro "€">
]>
XML- . <?xml version="1.0" encoding="windows-1251"?>
.
XHML-
XSL- XHTML- ( ). XHTML-, , .
.
XHML- , , :
( ). - , . / .
HTML-:
...
...
...
...
...
XSL-
XSL- :
<xsl:stylesheet version = '1.0' encoding="UTF-8"?>
<xsl:template match="element">
</xsl:template>
</xsl:stylesheet>
: <xsl:stylesheet version = '1.0' encoding="UTF-8"?>
- XML- . UTF-8 ( , ).
<xsl:stylesheet> </xsl:stylesheet>
- XSL-.
<xsl:template match="element"> </xsl:template>
- element.
:
<xsl:template match="element"></xsl:template>
- , element . element . <xsl:template match="element" mode="mode1"></xsl:template>
- , element mode1 . element . <xsl:template name="template-name"></xsl:template>
- template-name . - XML- .
XML- (, XML-, item ), " " :
<xsl:template match="navigation/sections/item"></xsl:template>
, , .., , , , .. navigation , navigation/sections/item sections/item .
, - . , xsl- . .
xsl .
, ( ) :
template_folder - . , my_template . dtd - . . lang - ( ). mod - .
xsl/my_template , layout.xsl :
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE xsl:stylesheet SYSTEM "../dtd/entities.dtd">
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:template match="/node()">
</xsl:template>
</xsl:stylesheet>
:
<xsl:template match="/node()"> </xsl:template>
- /node() (). /node() //document , .. .
XHTML- <xsl:template match="/node()"></xsl:template>
XML- . , XSL- XML- XHTML- .
, XSL template.xsl (, template - ), :
<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:import href=" my_template /layout.xsl"/>
</xsl:stylesheet>
:
<xsl:import href="my_template/layout.xsl"/>
XSL- ( XSL- ) . .
, .. XML- .
- .
, XML- :
<item id="0" parent_id="0" is_published="1" section="1">
/
<item id="1" parent_id="0" is_published="1" section="1" hit="yes">
news
:
id document - id . hit item - , , " ".
, , :
sections - . item - .
, , item item , , :
1. xsl/my_template navigation.xsl :
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE xsl:stylesheet SYSTEM "../dtd/entities.dtd">
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:template match="sections" mode="global_menu">
</xsl:template>
</xsl:stylesheet>
2. layout.xsl :
<xsl:template match="sections" mode="global_menu">
</xsl:template>
3. … layout.xsl :
<xsl:apply-templates select="navigation/sections" mode="global_menu"/>
:
select="navigation/sections" - ( ) - . , navigation/sections .
mode="global_menu" - global_menu . , , , " ", - .
4. , layout.xsl navigation.xsl :
<xsl:import href="navigation.xsl"/>
5. , navigation.xsl , :
<xsl:template match="item" mode="global_menu">
<xsl:call-template name="href_attribute"/>
<xsl:value-of select="title"/>
</xsl:template>
:
<xsl:call-template name="href_attribute"/>
- . , .. .
<xsl:value-of select="title"/>
- - title . @ - .
6. sections :
<xsl:template match="sections" mode="global_menu">
</xsl:template>
:
<xsl:apply-templates select="item" mode="global_menu"/>
- item sections . , item item ( sections/item/item ) , .. .
item ( ) . , : <xsl:call-template name="href_attribute"/>
uri- . .
7. ,
, . item :
<xsl:template match="item" mode="global_menu">
<xsl:choose>
<xsl:when test="descendant-or-self::*/@id = /node()/@id">
<xsl:value-of select="title"/>
</xsl:when>
<xsl:otherwise>
<xsl:call-template name="href_attribute"/>
<xsl:value-of select="title"/>
</xsl:otherwise>
</xsl:choose>
</xsl:template>
:
<xsl:choose>
<xsl:when></xsl:when>
<xsl:otherwise></xsl:otherwise>
</xsl:choose>
…, , XML- . : <xsl:when test="descendant-or-self::*/@id = /node()/@id">
ID ( document ) ( item ), , .
<xsl:when></xsl:when>
, . <xsl:otherwise></xsl:otherwise>
- .
8. , href_attribute :
<xsl:template name="href_attribute">
<xsl:attribute name="href">
<xsl:text>/</xsl:text>
<xsl:for-each select="ancestor-or-self::item">
<xsl:value-of select="dir"/>
<xsl:text>/</xsl:text>
</xsl:for-each>
</xsl:attribute>
</xsl:template>
xsl:attribute . . a , , href , .. .
<xsl:for-each select="ancestor-or-self::item">
, . ancestor-or-self::item - . dir , .. -.
, - , . , .
UPD:
. , :
parser.proc.ru/iso/xslt-1.zip
( ) Apache.
XML- /xsl/document.xml
- ( ). :
Lang - . . Id - .
<lang_table>
- , .
- :
- ( ):
<item id="0" parent_id="0" is_published="1" section="1">
- . :
Id - . Parent_id - . Is_published - . Dir - uri- . . Section - . .
- .
CMS : :
Html - . , . Com - -. , CMS: , , ..
XSL- , . .
CMS , :
:
Id - .
Container - - ( ).
Sorting - .
Type - :
Com - -
Html - .
Method - .
Title - .
DTD ( ):
<!DOCTYPE site_page [
<!ENTITY nbsp " ">
<!ENTITY sect "§" >
<!ENTITY copy "©">
<!ENTITY laquo "«">
<!ENTITY reg "®">
<!ENTITY deg "°">
<!ENTITY plusmn "±">
<!ENTITY para "¶">
<!ENTITY raquo "»">
<!ENTITY times "×">
<!ENTITY bull "•">
<!ENTITY hellip "…">
<!ENTITY ndash "–">
<!ENTITY mdash "—">
<!ENTITY lsquo "'">
<!ENTITY rsquo "'">
<!ENTITY sbquo "‚">
<!ENTITY ldquo "“">
<!ENTITY rdquo "”">
<!ENTITY bdquo "„">
<!ENTITY lsaquo "‹">
<!ENTITY rsaquo "›" >
<!ENTITY euro "€">
]>
XML- . <?xml version="1.0" encoding="windows-1251"?>
.
XHML-
XSL- XHTML- ( ). XHTML-, , .
.
XHML- , , :
( ). - , . / .
HTML-:
...
...
...
...
...
XSL-
XSL- :
<xsl:stylesheet version = '1.0' encoding="UTF-8"?>
<xsl:template match="element">
</xsl:template>
</xsl:stylesheet>
: <xsl:stylesheet version = '1.0' encoding="UTF-8"?>
- XML- . UTF-8 ( , ).
<xsl:stylesheet> </xsl:stylesheet>
- XSL-.
<xsl:template match="element"> </xsl:template>
- element.
:
<xsl:template match="element"></xsl:template>
- , element . element . <xsl:template match="element" mode="mode1"></xsl:template>
- , element mode1 . element . <xsl:template name="template-name"></xsl:template>
- template-name . - XML- .
XML- (, XML-, item ), " " :
<xsl:template match="navigation/sections/item"></xsl:template>
, , .., , , , .. navigation , navigation/sections/item sections/item .
, - . , xsl- . .
xsl .
, ( ) :
template_folder - . , my_template . dtd - . . lang - ( ). mod - .
xsl/my_template , layout.xsl :
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE xsl:stylesheet SYSTEM "../dtd/entities.dtd">
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:template match="/node()">
</xsl:template>
</xsl:stylesheet>
:
<xsl:template match="/node()"> </xsl:template>
- /node() (). /node() //document , .. .
XHTML- <xsl:template match="/node()"></xsl:template>
XML- . , XSL- XML- XHTML- .
, XSL template.xsl (, template - ), :
<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:import href=" my_template /layout.xsl"/>
</xsl:stylesheet>
:
<xsl:import href="my_template/layout.xsl"/>
XSL- ( XSL- ) . .
, .. XML- .
- .
, XML- :
<item id="0" parent_id="0" is_published="1" section="1">
/
<item id="1" parent_id="0" is_published="1" section="1" hit="yes">
news
:
id document - id . hit item - , , " ".
, , :
sections - . item - .
, , item item , , :
1. xsl/my_template navigation.xsl :
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE xsl:stylesheet SYSTEM "../dtd/entities.dtd">
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:template match="sections" mode="global_menu">
</xsl:template>
</xsl:stylesheet>
2. layout.xsl :
<xsl:template match="sections" mode="global_menu">
</xsl:template>
3. … layout.xsl :
<xsl:apply-templates select="navigation/sections" mode="global_menu"/>
:
select="navigation/sections" - ( ) - . , navigation/sections .
mode="global_menu" - global_menu . , , , " ", - .
4. , layout.xsl navigation.xsl :
<xsl:import href="navigation.xsl"/>
5. , navigation.xsl , :
<xsl:template match="item" mode="global_menu">
<xsl:call-template name="href_attribute"/>
<xsl:value-of select="title"/>
</xsl:template>
:
<xsl:call-template name="href_attribute"/>
- . , .. .
<xsl:value-of select="title"/>
- - title . @ - .
6. sections :
<xsl:template match="sections" mode="global_menu">
</xsl:template>
:
<xsl:apply-templates select="item" mode="global_menu"/>
- item sections . , item item ( sections/item/item ) , .. .
item ( ) . , : <xsl:call-template name="href_attribute"/>
uri- . .
7. ,
, . item :
<xsl:template match="item" mode="global_menu">
<xsl:choose>
<xsl:when test="descendant-or-self::*/@id = /node()/@id">
<xsl:value-of select="title"/>
</xsl:when>
<xsl:otherwise>
<xsl:call-template name="href_attribute"/>
<xsl:value-of select="title"/>
</xsl:otherwise>
</xsl:choose>
</xsl:template>
:
<xsl:choose>
<xsl:when></xsl:when>
<xsl:otherwise></xsl:otherwise>
</xsl:choose>
…, , XML- . : <xsl:when test="descendant-or-self::*/@id = /node()/@id">
ID ( document ) ( item ), , .
<xsl:when></xsl:when>
, . <xsl:otherwise></xsl:otherwise>
- .
8. , href_attribute :
<xsl:template name="href_attribute">
<xsl:attribute name="href">
<xsl:text>/</xsl:text>
<xsl:for-each select="ancestor-or-self::item">
<xsl:value-of select="dir"/>
<xsl:text>/</xsl:text>
</xsl:for-each>
</xsl:attribute>
</xsl:template>
xsl:attribute . . a , , href , .. .
<xsl:for-each select="ancestor-or-self::item">
, . ancestor-or-self::item - . dir , .. -.
, - , . , .
UPD:
. , :
parser.proc.ru/iso/xslt-1.zip
( ) Apache.
XML- /xsl/document.xml
- ( ). :
Lang - . . Id - .
<lang_table>
- , .
- :
- ( ):
<item id="0" parent_id="0" is_published="1" section="1">
- . :
Id - . Parent_id - . Is_published - . Dir - uri- . . Section - . .
- .
CMS : :
Html - . , . Com - -. , CMS: , , ..
XSL- , . .
CMS , :
:
Id - .
Container - - ( ).
Sorting - .
Type - :
Com - -
Html - .
Method - .
Title - .
DTD ( ):
<!DOCTYPE site_page [
<!ENTITY nbsp " ">
<!ENTITY sect "§" >
<!ENTITY copy "©">
<!ENTITY laquo "«">
<!ENTITY reg "®">
<!ENTITY deg "°">
<!ENTITY plusmn "±">
<!ENTITY para "¶">
<!ENTITY raquo "»">
<!ENTITY times "×">
<!ENTITY bull "•">
<!ENTITY hellip "…">
<!ENTITY ndash "–">
<!ENTITY mdash "—">
<!ENTITY lsquo "'">
<!ENTITY rsquo "'">
<!ENTITY sbquo "‚">
<!ENTITY ldquo "“">
<!ENTITY rdquo "”">
<!ENTITY bdquo "„">
<!ENTITY lsaquo "‹">
<!ENTITY rsaquo "›" >
<!ENTITY euro "€">
]>
XML- . <?xml version="1.0" encoding="windows-1251"?>
.
XHML-
XSL- XHTML- ( ). XHTML-, , .
.
XHML- , , :
( ). - , . / .
HTML-:
...
...
...
...
...
XSL-
XSL- :
<xsl:stylesheet version = '1.0' encoding="UTF-8"?>
<xsl:template match="element">
</xsl:template>
</xsl:stylesheet>
: <xsl:stylesheet version = '1.0' encoding="UTF-8"?>
- XML- . UTF-8 ( , ).
<xsl:stylesheet> </xsl:stylesheet>
- XSL-.
<xsl:template match="element"> </xsl:template>
- element.
:
<xsl:template match="element"></xsl:template>
- , element . element . <xsl:template match="element" mode="mode1"></xsl:template>
- , element mode1 . element . <xsl:template name="template-name"></xsl:template>
- template-name . - XML- .
XML- (, XML-, item ), " " :
<xsl:template match="navigation/sections/item"></xsl:template>
, , .., , , , .. navigation , navigation/sections/item sections/item .
, - . , xsl- . .
xsl .
, ( ) :
template_folder - . , my_template . dtd - . . lang - ( ). mod - .
xsl/my_template , layout.xsl :
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE xsl:stylesheet SYSTEM "../dtd/entities.dtd">
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:template match="/node()">
</xsl:template>
</xsl:stylesheet>
:
<xsl:template match="/node()"> </xsl:template>
- /node() (). /node() //document , .. .
XHTML- <xsl:template match="/node()"></xsl:template>
XML- . , XSL- XML- XHTML- .
, XSL template.xsl (, template - ), :
<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:import href=" my_template /layout.xsl"/>
</xsl:stylesheet>
:
<xsl:import href="my_template/layout.xsl"/>
XSL- ( XSL- ) . .
, .. XML- .
- .
, XML- :
<item id="0" parent_id="0" is_published="1" section="1">
/
<item id="1" parent_id="0" is_published="1" section="1" hit="yes">
news
:
id document - id . hit item - , , " ".
, , :
sections - . item - .
, , item item , , :
1. xsl/my_template navigation.xsl :
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE xsl:stylesheet SYSTEM "../dtd/entities.dtd">
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:template match="sections" mode="global_menu">
</xsl:template>
</xsl:stylesheet>
2. layout.xsl :
<xsl:template match="sections" mode="global_menu">
</xsl:template>
3. … layout.xsl :
<xsl:apply-templates select="navigation/sections" mode="global_menu"/>
:
select="navigation/sections" - ( ) - . , navigation/sections .
mode="global_menu" - global_menu . , , , " ", - .
4. , layout.xsl navigation.xsl :
<xsl:import href="navigation.xsl"/>
5. , navigation.xsl , :
<xsl:template match="item" mode="global_menu">
<xsl:call-template name="href_attribute"/>
<xsl:value-of select="title"/>
</xsl:template>
:
<xsl:call-template name="href_attribute"/>
- . , .. .
<xsl:value-of select="title"/>
- - title . @ - .
6. sections :
<xsl:template match="sections" mode="global_menu">
</xsl:template>
:
<xsl:apply-templates select="item" mode="global_menu"/>
- item sections . , item item ( sections/item/item ) , .. .
item ( ) . , : <xsl:call-template name="href_attribute"/>
uri- . .
7. ,
, . item :
<xsl:template match="item" mode="global_menu">
<xsl:choose>
<xsl:when test="descendant-or-self::*/@id = /node()/@id">
<xsl:value-of select="title"/>
</xsl:when>
<xsl:otherwise>
<xsl:call-template name="href_attribute"/>
<xsl:value-of select="title"/>
</xsl:otherwise>
</xsl:choose>
</xsl:template>
:
<xsl:choose>
<xsl:when></xsl:when>
<xsl:otherwise></xsl:otherwise>
</xsl:choose>
…, , XML- . : <xsl:when test="descendant-or-self::*/@id = /node()/@id">
ID ( document ) ( item ), , .
<xsl:when></xsl:when>
, . <xsl:otherwise></xsl:otherwise>
- .
8. , href_attribute :
<xsl:template name="href_attribute">
<xsl:attribute name="href">
<xsl:text>/</xsl:text>
<xsl:for-each select="ancestor-or-self::item">
<xsl:value-of select="dir"/>
<xsl:text>/</xsl:text>
</xsl:for-each>
</xsl:attribute>
</xsl:template>
xsl:attribute . . a , , href , .. .
<xsl:for-each select="ancestor-or-self::item">
, . ancestor-or-self::item - . dir , .. -.
, - , . , .
UPD:
. , :
parser.proc.ru/iso/xslt-1.zip
( ) Apache.
XML- /xsl/document.xml
- ( ). :
Lang - . . Id - .
<lang_table>
- , .
- :
- ( ):
<item id="0" parent_id="0" is_published="1" section="1">
- . :
Id - . Parent_id - . Is_published - . Dir - uri- . . Section - . .
- .
CMS : :
Html - . , . Com - -. , CMS: , , ..
XSL- , . .
CMS , :
:
Id - .
Container - - ( ).
Sorting - .
Type - :
Com - -
Html - .
Method - .
Title - .
DTD ( ):
<!DOCTYPE site_page [
<!ENTITY nbsp " ">
<!ENTITY sect "§" >
<!ENTITY copy "©">
<!ENTITY laquo "«">
<!ENTITY reg "®">
<!ENTITY deg "°">
<!ENTITY plusmn "±">
<!ENTITY para "¶">
<!ENTITY raquo "»">
<!ENTITY times "×">
<!ENTITY bull "•">
<!ENTITY hellip "…">
<!ENTITY ndash "–">
<!ENTITY mdash "—">
<!ENTITY lsquo "'">
<!ENTITY rsquo "'">
<!ENTITY sbquo "‚">
<!ENTITY ldquo "“">
<!ENTITY rdquo "”">
<!ENTITY bdquo "„">
<!ENTITY lsaquo "‹">
<!ENTITY rsaquo "›" >
<!ENTITY euro "€">
]>
XML- . <?xml version="1.0" encoding="windows-1251"?>
.
XHML-
XSL- XHTML- ( ). XHTML-, , .
.
XHML- , , :
( ). - , . / .
HTML-:
...
...
...
...
...
XSL-
XSL- :
<xsl:stylesheet version = '1.0' encoding="UTF-8"?>
<xsl:template match="element">
</xsl:template>
</xsl:stylesheet>
: <xsl:stylesheet version = '1.0' encoding="UTF-8"?>
- XML- . UTF-8 ( , ).
<xsl:stylesheet> </xsl:stylesheet>
- XSL-.
<xsl:template match="element"> </xsl:template>
- element.
:
<xsl:template match="element"></xsl:template>
- , element . element . <xsl:template match="element" mode="mode1"></xsl:template>
- , element mode1 . element . <xsl:template name="template-name"></xsl:template>
- template-name . - XML- .
XML- (, XML-, item ), " " :
<xsl:template match="navigation/sections/item"></xsl:template>
, , .., , , , .. navigation , navigation/sections/item sections/item .
, - . , xsl- . .
xsl .
, ( ) :
template_folder - . , my_template . dtd - . . lang - ( ). mod - .
xsl/my_template , layout.xsl :
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE xsl:stylesheet SYSTEM "../dtd/entities.dtd">
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:template match="/node()">
</xsl:template>
</xsl:stylesheet>
:
<xsl:template match="/node()"> </xsl:template>
- /node() (). /node() //document , .. .
XHTML- <xsl:template match="/node()"></xsl:template>
XML- . , XSL- XML- XHTML- .
, XSL template.xsl (, template - ), :
<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:import href=" my_template /layout.xsl"/>
</xsl:stylesheet>
:
<xsl:import href="my_template/layout.xsl"/>
XSL- ( XSL- ) . .
, .. XML- .
- .
, XML- :
<item id="0" parent_id="0" is_published="1" section="1">
/
<item id="1" parent_id="0" is_published="1" section="1" hit="yes">
news
:
id document - id . hit item - , , " ".
, , :
sections - . item - .
, , item item , , :
1. xsl/my_template navigation.xsl :
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE xsl:stylesheet SYSTEM "../dtd/entities.dtd">
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:template match="sections" mode="global_menu">
</xsl:template>
</xsl:stylesheet>
2. layout.xsl :
<xsl:template match="sections" mode="global_menu">
</xsl:template>
3. … layout.xsl :
<xsl:apply-templates select="navigation/sections" mode="global_menu"/>
:
select="navigation/sections" - ( ) - . , navigation/sections .
mode="global_menu" - global_menu . , , , " ", - .
4. , layout.xsl navigation.xsl :
<xsl:import href="navigation.xsl"/>
5. , navigation.xsl , :
<xsl:template match="item" mode="global_menu">
<xsl:call-template name="href_attribute"/>
<xsl:value-of select="title"/>
</xsl:template>
:
<xsl:call-template name="href_attribute"/>
- . , .. .
<xsl:value-of select="title"/>
- - title . @ - .
6. sections :
<xsl:template match="sections" mode="global_menu">
</xsl:template>
:
<xsl:apply-templates select="item" mode="global_menu"/>
- item sections . , item item ( sections/item/item ) , .. .
item ( ) . , : <xsl:call-template name="href_attribute"/>
uri- . .
7. ,
, . item :
<xsl:template match="item" mode="global_menu">
<xsl:choose>
<xsl:when test="descendant-or-self::*/@id = /node()/@id">
<xsl:value-of select="title"/>
</xsl:when>
<xsl:otherwise>
<xsl:call-template name="href_attribute"/>
<xsl:value-of select="title"/>
</xsl:otherwise>
</xsl:choose>
</xsl:template>
:
<xsl:choose>
<xsl:when></xsl:when>
<xsl:otherwise></xsl:otherwise>
</xsl:choose>
…, , XML- . : <xsl:when test="descendant-or-self::*/@id = /node()/@id">
ID ( document ) ( item ), , .
<xsl:when></xsl:when>
, . <xsl:otherwise></xsl:otherwise>
- .
8. , href_attribute :
<xsl:template name="href_attribute">
<xsl:attribute name="href">
<xsl:text>/</xsl:text>
<xsl:for-each select="ancestor-or-self::item">
<xsl:value-of select="dir"/>
<xsl:text>/</xsl:text>
</xsl:for-each>
</xsl:attribute>
</xsl:template>
xsl:attribute . . a , , href , .. .
<xsl:for-each select="ancestor-or-self::item">
, . ancestor-or-self::item - . dir , .. -.
, - , . , .
UPD:
. , :
parser.proc.ru/iso/xslt-1.zip
( ) Apache.
XML- /xsl/document.xml
- ( ). :
Lang - . . Id - .
<lang_table>
- , .
- :
- ( ):
<item id="0" parent_id="0" is_published="1" section="1">
- . :
Id - . Parent_id - . Is_published - . Dir - uri- . . Section - . .
- .
CMS : :
Html - . , . Com - -. , CMS: , , ..
XSL- , . .
CMS , :
:
Id - .
Container - - ( ).
Sorting - .
Type - :
Com - -
Html - .
Method - .
Title - .
DTD ( ):
<!DOCTYPE site_page [
<!ENTITY nbsp " ">
<!ENTITY sect "§" >
<!ENTITY copy "©">
<!ENTITY laquo "«">
<!ENTITY reg "®">
<!ENTITY deg "°">
<!ENTITY plusmn "±">
<!ENTITY para "¶">
<!ENTITY raquo "»">
<!ENTITY times "×">
<!ENTITY bull "•">
<!ENTITY hellip "…">
<!ENTITY ndash "–">
<!ENTITY mdash "—">
<!ENTITY lsquo "'">
<!ENTITY rsquo "'">
<!ENTITY sbquo "‚">
<!ENTITY ldquo "“">
<!ENTITY rdquo "”">
<!ENTITY bdquo "„">
<!ENTITY lsaquo "‹">
<!ENTITY rsaquo "›" >
<!ENTITY euro "€">
]>
XML- . <?xml version="1.0" encoding="windows-1251"?>
.
XHML-
XSL- XHTML- ( ). XHTML-, , .
.
XHML- , , :
( ). - , . / .
HTML-:
...
...
...
...
...
XSL-
XSL- :
<xsl:stylesheet version = '1.0' encoding="UTF-8"?>
<xsl:template match="element">
</xsl:template>
</xsl:stylesheet>
: <xsl:stylesheet version = '1.0' encoding="UTF-8"?>
- XML- . UTF-8 ( , ).
<xsl:stylesheet> </xsl:stylesheet>
- XSL-.
<xsl:template match="element"> </xsl:template>
- element.
:
<xsl:template match="element"></xsl:template>
- , element . element . <xsl:template match="element" mode="mode1"></xsl:template>
- , element mode1 . element . <xsl:template name="template-name"></xsl:template>
- template-name . - XML- .
XML- (, XML-, item ), " " :
<xsl:template match="navigation/sections/item"></xsl:template>
, , .., , , , .. navigation , navigation/sections/item sections/item .
, - . , xsl- . .
xsl .
, ( ) :
template_folder - . , my_template . dtd - . . lang - ( ). mod - .
xsl/my_template , layout.xsl :
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE xsl:stylesheet SYSTEM "../dtd/entities.dtd">
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:template match="/node()">
</xsl:template>
</xsl:stylesheet>
:
<xsl:template match="/node()"> </xsl:template>
- /node() (). /node() //document , .. .
XHTML- <xsl:template match="/node()"></xsl:template>
XML- . , XSL- XML- XHTML- .
, XSL template.xsl (, template - ), :
<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:import href=" my_template /layout.xsl"/>
</xsl:stylesheet>
:
<xsl:import href="my_template/layout.xsl"/>
XSL- ( XSL- ) . .
, .. XML- .
- .
, XML- :
<item id="0" parent_id="0" is_published="1" section="1">
/
<item id="1" parent_id="0" is_published="1" section="1" hit="yes">
news
:
id document - id . hit item - , , " ".
, , :
sections - . item - .
, , item item , , :
1. xsl/my_template navigation.xsl :
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE xsl:stylesheet SYSTEM "../dtd/entities.dtd">
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:template match="sections" mode="global_menu">
</xsl:template>
</xsl:stylesheet>
2. layout.xsl :
<xsl:template match="sections" mode="global_menu">
</xsl:template>
3. … layout.xsl :
<xsl:apply-templates select="navigation/sections" mode="global_menu"/>
:
select="navigation/sections" - ( ) - . , navigation/sections .
mode="global_menu" - global_menu . , , , " ", - .
4. , layout.xsl navigation.xsl :
<xsl:import href="navigation.xsl"/>
5. , navigation.xsl , :
<xsl:template match="item" mode="global_menu">
<xsl:call-template name="href_attribute"/>
<xsl:value-of select="title"/>
</xsl:template>
:
<xsl:call-template name="href_attribute"/>
- . , .. .
<xsl:value-of select="title"/>
- - title . @ - .
6. sections :
<xsl:template match="sections" mode="global_menu">
</xsl:template>
:
<xsl:apply-templates select="item" mode="global_menu"/>
- item sections . , item item ( sections/item/item ) , .. .
item ( ) . , : <xsl:call-template name="href_attribute"/>
uri- . .
7. ,
, . item :
<xsl:template match="item" mode="global_menu">
<xsl:choose>
<xsl:when test="descendant-or-self::*/@id = /node()/@id">
<xsl:value-of select="title"/>
</xsl:when>
<xsl:otherwise>
<xsl:call-template name="href_attribute"/>
<xsl:value-of select="title"/>
</xsl:otherwise>
</xsl:choose>
</xsl:template>
:
<xsl:choose>
<xsl:when></xsl:when>
<xsl:otherwise></xsl:otherwise>
</xsl:choose>
…, , XML- . : <xsl:when test="descendant-or-self::*/@id = /node()/@id">
ID ( document ) ( item ), , .
<xsl:when></xsl:when>
, . <xsl:otherwise></xsl:otherwise>
- .
8. , href_attribute :
<xsl:template name="href_attribute">
<xsl:attribute name="href">
<xsl:text>/</xsl:text>
<xsl:for-each select="ancestor-or-self::item">
<xsl:value-of select="dir"/>
<xsl:text>/</xsl:text>
</xsl:for-each>
</xsl:attribute>
</xsl:template>
xsl:attribute . . a , , href , .. .
<xsl:for-each select="ancestor-or-self::item">
, . ancestor-or-self::item - . dir , .. -.
, - , . , .
UPD:
. , :
parser.proc.ru/iso/xslt-1.zip
( ) Apache.
XML- /xsl/document.xml
- ( ). :
Lang - . . Id - .
<lang_table>
- , .
- :
- ( ):
<item id="0" parent_id="0" is_published="1" section="1">
- . :
Id - . Parent_id - . Is_published - . Dir - uri- . . Section - . .
- .
CMS : :
Html - . , . Com - -. , CMS: , , ..
XSL- , . .
CMS , :
:
Id - .
Container - - ( ).
Sorting - .
Type - :
Com - -
Html - .
Method - .
Title - .
DTD ( ):
<!DOCTYPE site_page [
<!ENTITY nbsp " ">
<!ENTITY sect "§" >
<!ENTITY copy "©">
<!ENTITY laquo "«">
<!ENTITY reg "®">
<!ENTITY deg "°">
<!ENTITY plusmn "±">
<!ENTITY para "¶">
<!ENTITY raquo "»">
<!ENTITY times "×">
<!ENTITY bull "•">
<!ENTITY hellip "…">
<!ENTITY ndash "–">
<!ENTITY mdash "—">
<!ENTITY lsquo "'">
<!ENTITY rsquo "'">
<!ENTITY sbquo "‚">
<!ENTITY ldquo "“">
<!ENTITY rdquo "”">
<!ENTITY bdquo "„">
<!ENTITY lsaquo "‹">
<!ENTITY rsaquo "›" >
<!ENTITY euro "€">
]>
XML- . <?xml version="1.0" encoding="windows-1251"?>
.
XHML-
XSL- XHTML- ( ). XHTML-, , .
.
XHML- , , :
( ). - , . / .
HTML-:
...
...
...
...
...
XSL-
XSL- :
<xsl:stylesheet version = '1.0' encoding="UTF-8"?>
<xsl:template match="element">
</xsl:template>
</xsl:stylesheet>
: <xsl:stylesheet version = '1.0' encoding="UTF-8"?>
- XML- . UTF-8 ( , ).
<xsl:stylesheet> </xsl:stylesheet>
- XSL-.
<xsl:template match="element"> </xsl:template>
- element.
:
<xsl:template match="element"></xsl:template>
- , element . element . <xsl:template match="element" mode="mode1"></xsl:template>
- , element mode1 . element . <xsl:template name="template-name"></xsl:template>
- template-name . - XML- .
XML- (, XML-, item ), " " :
<xsl:template match="navigation/sections/item"></xsl:template>
, , .., , , , .. navigation , navigation/sections/item sections/item .
, - . , xsl- . .
xsl .
, ( ) :
template_folder - . , my_template . dtd - . . lang - ( ). mod - .
xsl/my_template , layout.xsl :
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE xsl:stylesheet SYSTEM "../dtd/entities.dtd">
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:template match="/node()">
</xsl:template>
</xsl:stylesheet>
:
<xsl:template match="/node()"> </xsl:template>
- /node() (). /node() //document , .. .
XHTML- <xsl:template match="/node()"></xsl:template>
XML- . , XSL- XML- XHTML- .
, XSL template.xsl (, template - ), :
<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:import href=" my_template /layout.xsl"/>
</xsl:stylesheet>
:
<xsl:import href="my_template/layout.xsl"/>
XSL- ( XSL- ) . .
, .. XML- .
- .
, XML- :
<item id="0" parent_id="0" is_published="1" section="1">
/
<item id="1" parent_id="0" is_published="1" section="1" hit="yes">
news
:
id document - id . hit item - , , " ".
, , :
sections - . item - .
, , item item , , :
1. xsl/my_template navigation.xsl :
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE xsl:stylesheet SYSTEM "../dtd/entities.dtd">
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:template match="sections" mode="global_menu">
</xsl:template>
</xsl:stylesheet>
2. layout.xsl :
<xsl:template match="sections" mode="global_menu">
</xsl:template>
3. … layout.xsl :
<xsl:apply-templates select="navigation/sections" mode="global_menu"/>
:
select="navigation/sections" - ( ) - . , navigation/sections .
mode="global_menu" - global_menu . , , , " ", - .
4. , layout.xsl navigation.xsl :
<xsl:import href="navigation.xsl"/>
5. , navigation.xsl , :
<xsl:template match="item" mode="global_menu">
<xsl:call-template name="href_attribute"/>
<xsl:value-of select="title"/>
</xsl:template>
:
<xsl:call-template name="href_attribute"/>
- . , .. .
<xsl:value-of select="title"/>
- - title . @ - .
6. sections :
<xsl:template match="sections" mode="global_menu">
</xsl:template>
:
<xsl:apply-templates select="item" mode="global_menu"/>
- item sections . , item item ( sections/item/item ) , .. .
item ( ) . , : <xsl:call-template name="href_attribute"/>
uri- . .
7. ,
, . item :
<xsl:template match="item" mode="global_menu">
<xsl:choose>
<xsl:when test="descendant-or-self::*/@id = /node()/@id">
<xsl:value-of select="title"/>
</xsl:when>
<xsl:otherwise>
<xsl:call-template name="href_attribute"/>
<xsl:value-of select="title"/>
</xsl:otherwise>
</xsl:choose>
</xsl:template>
:
<xsl:choose>
<xsl:when></xsl:when>
<xsl:otherwise></xsl:otherwise>
</xsl:choose>
…, , XML- . : <xsl:when test="descendant-or-self::*/@id = /node()/@id">
ID ( document ) ( item ), , .
<xsl:when></xsl:when>
, . <xsl:otherwise></xsl:otherwise>
- .
8. , href_attribute :
<xsl:template name="href_attribute">
<xsl:attribute name="href">
<xsl:text>/</xsl:text>
<xsl:for-each select="ancestor-or-self::item">
<xsl:value-of select="dir"/>
<xsl:text>/</xsl:text>
</xsl:for-each>
</xsl:attribute>
</xsl:template>
xsl:attribute . . a , , href , .. .
<xsl:for-each select="ancestor-or-self::item">
, . ancestor-or-self::item - . dir , .. -.
, - , . , .
UPD:
. , :
parser.proc.ru/iso/xslt-1.zip
( ) Apache.
XML- /xsl/document.xml
- ( ). :
Lang - . . Id - .
<lang_table>
- , .
- :
- ( ):
<item id="0" parent_id="0" is_published="1" section="1">
- . :
Id - . Parent_id - . Is_published - . Dir - uri- . . Section - . .
- .
CMS : :
Html - . , . Com - -. , CMS: , , ..
XSL- , . .
CMS , :
:
Id - .
Container - - ( ).
Sorting - .
Type - :
Com - -
Html - .
Method - .
Title - .
DTD ( ):
<!DOCTYPE site_page [
<!ENTITY nbsp " ">
<!ENTITY sect "§" >
<!ENTITY copy "©">
<!ENTITY laquo "«">
<!ENTITY reg "®">
<!ENTITY deg "°">
<!ENTITY plusmn "±">
<!ENTITY para "¶">
<!ENTITY raquo "»">
<!ENTITY times "×">
<!ENTITY bull "•">
<!ENTITY hellip "…">
<!ENTITY ndash "–">
<!ENTITY mdash "—">
<!ENTITY lsquo "'">
<!ENTITY rsquo "'">
<!ENTITY sbquo "‚">
<!ENTITY ldquo "“">
<!ENTITY rdquo "”">
<!ENTITY bdquo "„">
<!ENTITY lsaquo "‹">
<!ENTITY rsaquo "›" >
<!ENTITY euro "€">
]>
XML- . <?xml version="1.0" encoding="windows-1251"?>
.
XHML-
XSL- XHTML- ( ). XHTML-, , .
.
XHML- , , :
( ). - , . / .
HTML-:
...
...
...
...
...
XSL-
XSL- :
<xsl:stylesheet version = '1.0' encoding="UTF-8"?>
<xsl:template match="element">
</xsl:template>
</xsl:stylesheet>
: <xsl:stylesheet version = '1.0' encoding="UTF-8"?>
- XML- . UTF-8 ( , ).
<xsl:stylesheet> </xsl:stylesheet>
- XSL-.
<xsl:template match="element"> </xsl:template>
- element.
:
<xsl:template match="element"></xsl:template>
- , element . element . <xsl:template match="element" mode="mode1"></xsl:template>
- , element mode1 . element . <xsl:template name="template-name"></xsl:template>
- template-name . - XML- .
XML- (, XML-, item ), " " :
<xsl:template match="navigation/sections/item"></xsl:template>
, , .., , , , .. navigation , navigation/sections/item sections/item .
, - . , xsl- . .
xsl .
, ( ) :
template_folder - . , my_template . dtd - . . lang - ( ). mod - .
xsl/my_template , layout.xsl :
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE xsl:stylesheet SYSTEM "../dtd/entities.dtd">
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:template match="/node()">
</xsl:template>
</xsl:stylesheet>
:
<xsl:template match="/node()"> </xsl:template>
- /node() (). /node() //document , .. .
XHTML- <xsl:template match="/node()"></xsl:template>
XML- . , XSL- XML- XHTML- .
, XSL template.xsl (, template - ), :
<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:import href=" my_template /layout.xsl"/>
</xsl:stylesheet>
:
<xsl:import href="my_template/layout.xsl"/>
XSL- ( XSL- ) . .
, .. XML- .
- .
, XML- :
<item id="0" parent_id="0" is_published="1" section="1">
/
<item id="1" parent_id="0" is_published="1" section="1" hit="yes">
news
:
id document - id . hit item - , , " ".
, , :
sections - . item - .
, , item item , , :
1. xsl/my_template navigation.xsl :
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE xsl:stylesheet SYSTEM "../dtd/entities.dtd">
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:template match="sections" mode="global_menu">
</xsl:template>
</xsl:stylesheet>
2. layout.xsl :
<xsl:template match="sections" mode="global_menu">
</xsl:template>
3. … layout.xsl :
<xsl:apply-templates select="navigation/sections" mode="global_menu"/>
:
select="navigation/sections" - ( ) - . , navigation/sections .
mode="global_menu" - global_menu . , , , " ", - .
4. , layout.xsl navigation.xsl :
<xsl:import href="navigation.xsl"/>
5. , navigation.xsl , :
<xsl:template match="item" mode="global_menu">
<xsl:call-template name="href_attribute"/>
<xsl:value-of select="title"/>
</xsl:template>
:
<xsl:call-template name="href_attribute"/>
- . , .. .
<xsl:value-of select="title"/>
- - title . @ - .
6. sections :
<xsl:template match="sections" mode="global_menu">
</xsl:template>
:
<xsl:apply-templates select="item" mode="global_menu"/>
- item sections . , item item ( sections/item/item ) , .. .
item ( ) . , : <xsl:call-template name="href_attribute"/>
uri- . .
7. ,
, . item :
<xsl:template match="item" mode="global_menu">
<xsl:choose>
<xsl:when test="descendant-or-self::*/@id = /node()/@id">
<xsl:value-of select="title"/>
</xsl:when>
<xsl:otherwise>
<xsl:call-template name="href_attribute"/>
<xsl:value-of select="title"/>
</xsl:otherwise>
</xsl:choose>
</xsl:template>
:
<xsl:choose>
<xsl:when></xsl:when>
<xsl:otherwise></xsl:otherwise>
</xsl:choose>
…, , XML- . : <xsl:when test="descendant-or-self::*/@id = /node()/@id">
ID ( document ) ( item ), , .
<xsl:when></xsl:when>
, . <xsl:otherwise></xsl:otherwise>
- .
8. , href_attribute :
<xsl:template name="href_attribute">
<xsl:attribute name="href">
<xsl:text>/</xsl:text>
<xsl:for-each select="ancestor-or-self::item">
<xsl:value-of select="dir"/>
<xsl:text>/</xsl:text>
</xsl:for-each>
</xsl:attribute>
</xsl:template>
xsl:attribute . . a , , href , .. .
<xsl:for-each select="ancestor-or-self::item">
, . ancestor-or-self::item - . dir , .. -.
, - , . , .
UPD:
. , :
parser.proc.ru/iso/xslt-1.zip
( ) Apache.
XML- /xsl/document.xml
- ( ). :
Lang - . . Id - .
<lang_table>
- , .
- :
- ( ):
<item id="0" parent_id="0" is_published="1" section="1">
- . :
Id - . Parent_id - . Is_published - . Dir - uri- . . Section - . .
- .
CMS : :
Html - . , . Com - -. , CMS: , , ..
XSL- , . .
CMS , :
:
Id - .
Container - - ( ).
Sorting - .
Type - :
Com - -
Html - .
Method - .
Title - .
DTD ( ):
<!DOCTYPE site_page [
<!ENTITY nbsp " ">
<!ENTITY sect "§" >
<!ENTITY copy "©">
<!ENTITY laquo "«">
<!ENTITY reg "®">
<!ENTITY deg "°">
<!ENTITY plusmn "±">
<!ENTITY para "¶">
<!ENTITY raquo "»">
<!ENTITY times "×">
<!ENTITY bull "•">
<!ENTITY hellip "…">
<!ENTITY ndash "–">
<!ENTITY mdash "—">
<!ENTITY lsquo "'">
<!ENTITY rsquo "'">
<!ENTITY sbquo "‚">
<!ENTITY ldquo "“">
<!ENTITY rdquo "”">
<!ENTITY bdquo "„">
<!ENTITY lsaquo "‹">
<!ENTITY rsaquo "›" >
<!ENTITY euro "€">
]>
XML- . <?xml version="1.0" encoding="windows-1251"?>
.
XHML-
XSL- XHTML- ( ). XHTML-, , .
.
XHML- , , :
( ). - , . / .
HTML-:
...
...
...
...
...
XSL-
XSL- :
<xsl:stylesheet version = '1.0' encoding="UTF-8"?>
<xsl:template match="element">
</xsl:template>
</xsl:stylesheet>
: <xsl:stylesheet version = '1.0' encoding="UTF-8"?>
- XML- . UTF-8 ( , ).
<xsl:stylesheet> </xsl:stylesheet>
- XSL-.
<xsl:template match="element"> </xsl:template>
- element.
:
<xsl:template match="element"></xsl:template>
- , element . element . <xsl:template match="element" mode="mode1"></xsl:template>
- , element mode1 . element . <xsl:template name="template-name"></xsl:template>
- template-name . - XML- .
XML- (, XML-, item ), " " :
<xsl:template match="navigation/sections/item"></xsl:template>
, , .., , , , .. navigation , navigation/sections/item sections/item .
, - . , xsl- . .
xsl .
, ( ) :
template_folder - . , my_template . dtd - . . lang - ( ). mod - .
xsl/my_template , layout.xsl :
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE xsl:stylesheet SYSTEM "../dtd/entities.dtd">
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:template match="/node()">
</xsl:template>
</xsl:stylesheet>
:
<xsl:template match="/node()"> </xsl:template>
- /node() (). /node() //document , .. .
XHTML- <xsl:template match="/node()"></xsl:template>
XML- . , XSL- XML- XHTML- .
, XSL template.xsl (, template - ), :
<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:import href=" my_template /layout.xsl"/>
</xsl:stylesheet>
:
<xsl:import href="my_template/layout.xsl"/>
XSL- ( XSL- ) . .
, .. XML- .
- .
, XML- :
<item id="0" parent_id="0" is_published="1" section="1">
/
<item id="1" parent_id="0" is_published="1" section="1" hit="yes">
news
:
id document - id . hit item - , , " ".
, , :
sections - . item - .
, , item item , , :
1. xsl/my_template navigation.xsl :
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE xsl:stylesheet SYSTEM "../dtd/entities.dtd">
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:template match="sections" mode="global_menu">
</xsl:template>
</xsl:stylesheet>
2. layout.xsl :
<xsl:template match="sections" mode="global_menu">
</xsl:template>
3. … layout.xsl :
<xsl:apply-templates select="navigation/sections" mode="global_menu"/>
:
select="navigation/sections" - ( ) - . , navigation/sections .
mode="global_menu" - global_menu . , , , " ", - .
4. , layout.xsl navigation.xsl :
<xsl:import href="navigation.xsl"/>
5. , navigation.xsl , :
<xsl:template match="item" mode="global_menu">
<xsl:call-template name="href_attribute"/>
<xsl:value-of select="title"/>
</xsl:template>
:
<xsl:call-template name="href_attribute"/>
- . , .. .
<xsl:value-of select="title"/>
- - title . @ - .
6. sections :
<xsl:template match="sections" mode="global_menu">
</xsl:template>
:
<xsl:apply-templates select="item" mode="global_menu"/>
- item sections . , item item ( sections/item/item ) , .. .
item ( ) . , : <xsl:call-template name="href_attribute"/>
uri- . .
7. ,
, . item :
<xsl:template match="item" mode="global_menu">
<xsl:choose>
<xsl:when test="descendant-or-self::*/@id = /node()/@id">
<xsl:value-of select="title"/>
</xsl:when>
<xsl:otherwise>
<xsl:call-template name="href_attribute"/>
<xsl:value-of select="title"/>
</xsl:otherwise>
</xsl:choose>
</xsl:template>
:
<xsl:choose>
<xsl:when></xsl:when>
<xsl:otherwise></xsl:otherwise>
</xsl:choose>
…, , XML- . : <xsl:when test="descendant-or-self::*/@id = /node()/@id">
ID ( document ) ( item ), , .
<xsl:when></xsl:when>
, . <xsl:otherwise></xsl:otherwise>
- .
8. , href_attribute :
<xsl:template name="href_attribute">
<xsl:attribute name="href">
<xsl:text>/</xsl:text>
<xsl:for-each select="ancestor-or-self::item">
<xsl:value-of select="dir"/>
<xsl:text>/</xsl:text>
</xsl:for-each>
</xsl:attribute>
</xsl:template>
xsl:attribute . . a , , href , .. .
<xsl:for-each select="ancestor-or-self::item">
, . ancestor-or-self::item - . dir , .. -.
, - , . , .
UPD:
. , :
parser.proc.ru/iso/xslt-1.zip
( ) Apache.
XML- /xsl/document.xml
- ( ). :
Lang - . . Id - .
<lang_table>
- , .
- :
- ( ):
<item id="0" parent_id="0" is_published="1" section="1">
- . :
Id - . Parent_id - . Is_published - . Dir - uri- . . Section - . .
- .
CMS : :
Html - . , . Com - -. , CMS: , , ..
XSL- , . .
CMS , :
:
Id - .
Container - - ( ).
Sorting - .
Type - :
Com - -
Html - .
Method - .
Title - .
DTD ( ):
<!DOCTYPE site_page [
<!ENTITY nbsp " ">
<!ENTITY sect "§" >
<!ENTITY copy "©">
<!ENTITY laquo "«">
<!ENTITY reg "®">
<!ENTITY deg "°">
<!ENTITY plusmn "±">
<!ENTITY para "¶">
<!ENTITY raquo "»">
<!ENTITY times "×">
<!ENTITY bull "•">
<!ENTITY hellip "…">
<!ENTITY ndash "–">
<!ENTITY mdash "—">
<!ENTITY lsquo "'">
<!ENTITY rsquo "'">
<!ENTITY sbquo "‚">
<!ENTITY ldquo "“">
<!ENTITY rdquo "”">
<!ENTITY bdquo "„">
<!ENTITY lsaquo "‹">
<!ENTITY rsaquo "›" >
<!ENTITY euro "€">
]>
XML- . <?xml version="1.0" encoding="windows-1251"?>
.
XHML-
XSL- XHTML- ( ). XHTML-, , .
.
XHML- , , :
( ). - , . / .
HTML-:
...
...
...
...
...
XSL-
XSL- :
<xsl:stylesheet version = '1.0' encoding="UTF-8"?>
<xsl:template match="element">
</xsl:template>
</xsl:stylesheet>
: <xsl:stylesheet version = '1.0' encoding="UTF-8"?>
- XML- . UTF-8 ( , ).
<xsl:stylesheet> </xsl:stylesheet>
- XSL-.
<xsl:template match="element"> </xsl:template>
- element.
:
<xsl:template match="element"></xsl:template>
- , element . element . <xsl:template match="element" mode="mode1"></xsl:template>
- , element mode1 . element . <xsl:template name="template-name"></xsl:template>
- template-name . - XML- .
XML- (, XML-, item ), " " :
<xsl:template match="navigation/sections/item"></xsl:template>
, , .., , , , .. navigation , navigation/sections/item sections/item .
, - . , xsl- . .
xsl .
, ( ) :
template_folder - . , my_template . dtd - . . lang - ( ). mod - .
xsl/my_template , layout.xsl :
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE xsl:stylesheet SYSTEM "../dtd/entities.dtd">
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:template match="/node()">
</xsl:template>
</xsl:stylesheet>
:
<xsl:template match="/node()"> </xsl:template>
- /node() (). /node() //document , .. .
XHTML- <xsl:template match="/node()"></xsl:template>
XML- . , XSL- XML- XHTML- .
, XSL template.xsl (, template - ), :
<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:import href=" my_template /layout.xsl"/>
</xsl:stylesheet>
:
<xsl:import href="my_template/layout.xsl"/>
XSL- ( XSL- ) . .
, .. XML- .
- .
, XML- :
<item id="0" parent_id="0" is_published="1" section="1">
/
<item id="1" parent_id="0" is_published="1" section="1" hit="yes">
news
:
id document - id . hit item - , , " ".
, , :
sections - . item - .
, , item item , , :
1. xsl/my_template navigation.xsl :
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE xsl:stylesheet SYSTEM "../dtd/entities.dtd">
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:template match="sections" mode="global_menu">
</xsl:template>
</xsl:stylesheet>
2. layout.xsl :
<xsl:template match="sections" mode="global_menu">
</xsl:template>
3. … layout.xsl :
<xsl:apply-templates select="navigation/sections" mode="global_menu"/>
:
select="navigation/sections" - ( ) - . , navigation/sections .
mode="global_menu" - global_menu . , , , " ", - .
4. , layout.xsl navigation.xsl :
<xsl:import href="navigation.xsl"/>
5. , navigation.xsl , :
<xsl:template match="item" mode="global_menu">
<xsl:call-template name="href_attribute"/>
<xsl:value-of select="title"/>
</xsl:template>
:
<xsl:call-template name="href_attribute"/>
- . , .. .
<xsl:value-of select="title"/>
- - title . @ - .
6. sections :
<xsl:template match="sections" mode="global_menu">
</xsl:template>
:
<xsl:apply-templates select="item" mode="global_menu"/>
- item sections . , item item ( sections/item/item ) , .. .
item ( ) . , : <xsl:call-template name="href_attribute"/>
uri- . .
7. ,
, . item :
<xsl:template match="item" mode="global_menu">
<xsl:choose>
<xsl:when test="descendant-or-self::*/@id = /node()/@id">
<xsl:value-of select="title"/>
</xsl:when>
<xsl:otherwise>
<xsl:call-template name="href_attribute"/>
<xsl:value-of select="title"/>
</xsl:otherwise>
</xsl:choose>
</xsl:template>
:
<xsl:choose>
<xsl:when></xsl:when>
<xsl:otherwise></xsl:otherwise>
</xsl:choose>
…, , XML- . : <xsl:when test="descendant-or-self::*/@id = /node()/@id">
ID ( document ) ( item ), , .
<xsl:when></xsl:when>
, . <xsl:otherwise></xsl:otherwise>
- .
8. , href_attribute :
<xsl:template name="href_attribute">
<xsl:attribute name="href">
<xsl:text>/</xsl:text>
<xsl:for-each select="ancestor-or-self::item">
<xsl:value-of select="dir"/>
<xsl:text>/</xsl:text>
</xsl:for-each>
</xsl:attribute>
</xsl:template>
xsl:attribute . . a , , href , .. .
<xsl:for-each select="ancestor-or-self::item">
, . ancestor-or-self::item - . dir , .. -.
, - , . , .
UPD:
. , :
parser.proc.ru/iso/xslt-1.zip
( ) Apache.
XML- /xsl/document.xml
- ( ). :
Lang - . . Id - .
<lang_table>
- , .
- :
- ( ):
<item id="0" parent_id="0" is_published="1" section="1">
- . :
Id - . Parent_id - . Is_published - . Dir - uri- . . Section - . .
- .
CMS : :
Html - . , . Com - -. , CMS: , , ..
XSL- , . .
CMS , :
:
Id - .
Container - - ( ).
Sorting - .
Type - :
Com - -
Html - .
Method - .
Title - .
DTD ( ):
<!DOCTYPE site_page [
<!ENTITY nbsp " ">
<!ENTITY sect "§" >
<!ENTITY copy "©">
<!ENTITY laquo "«">
<!ENTITY reg "®">
<!ENTITY deg "°">
<!ENTITY plusmn "±">
<!ENTITY para "¶">
<!ENTITY raquo "»">
<!ENTITY times "×">
<!ENTITY bull "•">
<!ENTITY hellip "…">
<!ENTITY ndash "–">
<!ENTITY mdash "—">
<!ENTITY lsquo "'">
<!ENTITY rsquo "'">
<!ENTITY sbquo "‚">
<!ENTITY ldquo "“">
<!ENTITY rdquo "”">
<!ENTITY bdquo "„">
<!ENTITY lsaquo "‹">
<!ENTITY rsaquo "›" >
<!ENTITY euro "€">
]>
XML- . <?xml version="1.0" encoding="windows-1251"?>
.
XHML-
XSL- XHTML- ( ). XHTML-, , .
.
XHML- , , :
( ). - , . / .
HTML-:
...
...
...
...
...
XSL-
XSL- :
<xsl:stylesheet version = '1.0' encoding="UTF-8"?>
<xsl:template match="element">
</xsl:template>
</xsl:stylesheet>
: <xsl:stylesheet version = '1.0' encoding="UTF-8"?>
- XML- . UTF-8 ( , ).
<xsl:stylesheet> </xsl:stylesheet>
- XSL-.
<xsl:template match="element"> </xsl:template>
- element.
:
<xsl:template match="element"></xsl:template>
- , element . element . <xsl:template match="element" mode="mode1"></xsl:template>
- , element mode1 . element . <xsl:template name="template-name"></xsl:template>
- template-name . - XML- .
XML- (, XML-, item ), " " :
<xsl:template match="navigation/sections/item"></xsl:template>
, , .., , , , .. navigation , navigation/sections/item sections/item .
, - . , xsl- . .
xsl .
, ( ) :
template_folder - . , my_template . dtd - . . lang - ( ). mod - .
xsl/my_template , layout.xsl :
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE xsl:stylesheet SYSTEM "../dtd/entities.dtd">
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:template match="/node()">
</xsl:template>
</xsl:stylesheet>
:
<xsl:template match="/node()"> </xsl:template>
- /node() (). /node() //document , .. .
XHTML- <xsl:template match="/node()"></xsl:template>
XML- . , XSL- XML- XHTML- .
, XSL template.xsl (, template - ), :
<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:import href=" my_template /layout.xsl"/>
</xsl:stylesheet>
:
<xsl:import href="my_template/layout.xsl"/>
XSL- ( XSL- ) . .
, .. XML- .
- .
, XML- :
<item id="0" parent_id="0" is_published="1" section="1">
/
<item id="1" parent_id="0" is_published="1" section="1" hit="yes">
news
:
id document - id . hit item - , , " ".
, , :
sections - . item - .
, , item item , , :
1. xsl/my_template navigation.xsl :
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE xsl:stylesheet SYSTEM "../dtd/entities.dtd">
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:template match="sections" mode="global_menu">
</xsl:template>
</xsl:stylesheet>
2. layout.xsl :
<xsl:template match="sections" mode="global_menu">
</xsl:template>
3. … layout.xsl :
<xsl:apply-templates select="navigation/sections" mode="global_menu"/>
:
select="navigation/sections" - ( ) - . , navigation/sections .
mode="global_menu" - global_menu . , , , " ", - .
4. , layout.xsl navigation.xsl :
<xsl:import href="navigation.xsl"/>
5. , navigation.xsl , :
<xsl:template match="item" mode="global_menu">
<xsl:call-template name="href_attribute"/>
<xsl:value-of select="title"/>
</xsl:template>
:
<xsl:call-template name="href_attribute"/>
- . , .. .
<xsl:value-of select="title"/>
- - title . @ - .
6. sections :
<xsl:template match="sections" mode="global_menu">
</xsl:template>
:
<xsl:apply-templates select="item" mode="global_menu"/>
- item sections . , item item ( sections/item/item ) , .. .
item ( ) . , : <xsl:call-template name="href_attribute"/>
uri- . .
7. ,
, . item :
<xsl:template match="item" mode="global_menu">
<xsl:choose>
<xsl:when test="descendant-or-self::*/@id = /node()/@id">
<xsl:value-of select="title"/>
</xsl:when>
<xsl:otherwise>
<xsl:call-template name="href_attribute"/>
<xsl:value-of select="title"/>
</xsl:otherwise>
</xsl:choose>
</xsl:template>
:
<xsl:choose>
<xsl:when></xsl:when>
<xsl:otherwise></xsl:otherwise>
</xsl:choose>
…, , XML- . : <xsl:when test="descendant-or-self::*/@id = /node()/@id">
ID ( document ) ( item ), , .
<xsl:when></xsl:when>
, . <xsl:otherwise></xsl:otherwise>
- .
8. , href_attribute :
<xsl:template name="href_attribute">
<xsl:attribute name="href">
<xsl:text>/</xsl:text>
<xsl:for-each select="ancestor-or-self::item">
<xsl:value-of select="dir"/>
<xsl:text>/</xsl:text>
</xsl:for-each>
</xsl:attribute>
</xsl:template>
xsl:attribute . . a , , href , .. .
<xsl:for-each select="ancestor-or-self::item">
, . ancestor-or-self::item - . dir , .. -.
, - , . , .
UPD:
. , :
parser.proc.ru/iso/xslt-1.zip
( ) Apache.
XML- /xsl/document.xml
- ( ). :
Lang - . . Id - .
<lang_table>
- , .
- :
- ( ):
<item id="0" parent_id="0" is_published="1" section="1">
- . :
Id - . Parent_id - . Is_published - . Dir - uri- . . Section - . .
- .
CMS : :
Html - . , . Com - -. , CMS: , , ..
XSL- , . .
CMS , :
:
Id - .
Container - - ( ).
Sorting - .
Type - :
Com - -
Html - .
Method - .
Title - .
DTD ( ):
<!DOCTYPE site_page [
<!ENTITY nbsp " ">
<!ENTITY sect "§" >
<!ENTITY copy "©">
<!ENTITY laquo "«">
<!ENTITY reg "®">
<!ENTITY deg "°">
<!ENTITY plusmn "±">
<!ENTITY para "¶">
<!ENTITY raquo "»">
<!ENTITY times "×">
<!ENTITY bull "•">
<!ENTITY hellip "…">
<!ENTITY ndash "–">
<!ENTITY mdash "—">
<!ENTITY lsquo "'">
<!ENTITY rsquo "'">
<!ENTITY sbquo "‚">
<!ENTITY ldquo "“">
<!ENTITY rdquo "”">
<!ENTITY bdquo "„">
<!ENTITY lsaquo "‹">
<!ENTITY rsaquo "›" >
<!ENTITY euro "€">
]>
XML- . <?xml version="1.0" encoding="windows-1251"?>
.
XHML-
XSL- XHTML- ( ). XHTML-, , .
.
XHML- , , :
( ). - , . / .
HTML-:
...
...
...
...
...
XSL-
XSL- :
<xsl:stylesheet version = '1.0' encoding="UTF-8"?>
<xsl:template match="element">
</xsl:template>
</xsl:stylesheet>
: <xsl:stylesheet version = '1.0' encoding="UTF-8"?>
- XML- . UTF-8 ( , ).
<xsl:stylesheet> </xsl:stylesheet>
- XSL-.
<xsl:template match="element"> </xsl:template>
- element.
:
<xsl:template match="element"></xsl:template>
- , element . element . <xsl:template match="element" mode="mode1"></xsl:template>
- , element mode1 . element . <xsl:template name="template-name"></xsl:template>
- template-name . - XML- .
XML- (, XML-, item ), " " :
<xsl:template match="navigation/sections/item"></xsl:template>
, , .., , , , .. navigation , navigation/sections/item sections/item .
, - . , xsl- . .
xsl .
, ( ) :
template_folder - . , my_template . dtd - . . lang - ( ). mod - .
xsl/my_template , layout.xsl :
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE xsl:stylesheet SYSTEM "../dtd/entities.dtd">
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:template match="/node()">
</xsl:template>
</xsl:stylesheet>
:
<xsl:template match="/node()"> </xsl:template>
- /node() (). /node() //document , .. .
XHTML- <xsl:template match="/node()"></xsl:template>
XML- . , XSL- XML- XHTML- .
, XSL template.xsl (, template - ), :
<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:import href=" my_template /layout.xsl"/>
</xsl:stylesheet>
:
<xsl:import href="my_template/layout.xsl"/>
XSL- ( XSL- ) . .
, .. XML- .
- .
, XML- :
<item id="0" parent_id="0" is_published="1" section="1">
/
<item id="1" parent_id="0" is_published="1" section="1" hit="yes">
news
:
id document - id . hit item - , , " ".
, , :
sections - . item - .
, , item item , , :
1. xsl/my_template navigation.xsl :
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE xsl:stylesheet SYSTEM "../dtd/entities.dtd">
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:template match="sections" mode="global_menu">
</xsl:template>
</xsl:stylesheet>
2. layout.xsl :
<xsl:template match="sections" mode="global_menu">
</xsl:template>
3. … layout.xsl :
<xsl:apply-templates select="navigation/sections" mode="global_menu"/>
:
select="navigation/sections" - ( ) - . , navigation/sections .
mode="global_menu" - global_menu . , , , " ", - .
4. , layout.xsl navigation.xsl :
<xsl:import href="navigation.xsl"/>
5. , navigation.xsl , :
<xsl:template match="item" mode="global_menu">
<xsl:call-template name="href_attribute"/>
<xsl:value-of select="title"/>
</xsl:template>
:
<xsl:call-template name="href_attribute"/>
- . , .. .
<xsl:value-of select="title"/>
- - title . @ - .
6. sections :
<xsl:template match="sections" mode="global_menu">
</xsl:template>
:
<xsl:apply-templates select="item" mode="global_menu"/>
- item sections . , item item ( sections/item/item ) , .. .
item ( ) . , : <xsl:call-template name="href_attribute"/>
uri- . .
7. ,
, . item :
<xsl:template match="item" mode="global_menu">
<xsl:choose>
<xsl:when test="descendant-or-self::*/@id = /node()/@id">
<xsl:value-of select="title"/>
</xsl:when>
<xsl:otherwise>
<xsl:call-template name="href_attribute"/>
<xsl:value-of select="title"/>
</xsl:otherwise>
</xsl:choose>
</xsl:template>
:
<xsl:choose>
<xsl:when></xsl:when>
<xsl:otherwise></xsl:otherwise>
</xsl:choose>
…, , XML- . : <xsl:when test="descendant-or-self::*/@id = /node()/@id">
ID ( document ) ( item ), , .
<xsl:when></xsl:when>
, . <xsl:otherwise></xsl:otherwise>
- .
8. , href_attribute :
<xsl:template name="href_attribute">
<xsl:attribute name="href">
<xsl:text>/</xsl:text>
<xsl:for-each select="ancestor-or-self::item">
<xsl:value-of select="dir"/>
<xsl:text>/</xsl:text>
</xsl:for-each>
</xsl:attribute>
</xsl:template>
xsl:attribute . . a , , href , .. .
<xsl:for-each select="ancestor-or-self::item">
, . ancestor-or-self::item - . dir , .. -.
, - , . , .
UPD:
. , :
parser.proc.ru/iso/xslt-1.zip
( ) Apache.
XML- /xsl/document.xml
- ( ). :
Lang - . . Id - .
<lang_table>
- , .
- :
- ( ):
<item id="0" parent_id="0" is_published="1" section="1">
- . :
Id - . Parent_id - . Is_published - . Dir - uri- . . Section - . .
- .
CMS : :
Html - . , . Com - -. , CMS: , , ..
XSL- , . .
CMS , :
:
Id - .
Container - - ( ).
Sorting - .
Type - :
Com - -
Html - .
Method - .
Title - .
DTD ( ):
<!DOCTYPE site_page [
<!ENTITY nbsp " ">
<!ENTITY sect "§" >
<!ENTITY copy "©">
<!ENTITY laquo "«">
<!ENTITY reg "®">
<!ENTITY deg "°">
<!ENTITY plusmn "±">
<!ENTITY para "¶">
<!ENTITY raquo "»">
<!ENTITY times "×">
<!ENTITY bull "•">
<!ENTITY hellip "…">
<!ENTITY ndash "–">
<!ENTITY mdash "—">
<!ENTITY lsquo "'">
<!ENTITY rsquo "'">
<!ENTITY sbquo "‚">
<!ENTITY ldquo "“">
<!ENTITY rdquo "”">
<!ENTITY bdquo "„">
<!ENTITY lsaquo "‹">
<!ENTITY rsaquo "›" >
<!ENTITY euro "€">
]>
XML- . <?xml version="1.0" encoding="windows-1251"?>
.
XHML-
XSL- XHTML- ( ). XHTML-, , .
.
XHML- , , :
( ). - , . / .
HTML-:
...
...
...
...
...
XSL-
XSL- :
<xsl:stylesheet version = '1.0' encoding="UTF-8"?>
<xsl:template match="element">
</xsl:template>
</xsl:stylesheet>
: <xsl:stylesheet version = '1.0' encoding="UTF-8"?>
- XML- . UTF-8 ( , ).
<xsl:stylesheet> </xsl:stylesheet>
- XSL-.
<xsl:template match="element"> </xsl:template>
- element.
:
<xsl:template match="element"></xsl:template>
- , element . element . <xsl:template match="element" mode="mode1"></xsl:template>
- , element mode1 . element . <xsl:template name="template-name"></xsl:template>
- template-name . - XML- .
XML- (, XML-, item ), " " :
<xsl:template match="navigation/sections/item"></xsl:template>
, , .., , , , .. navigation , navigation/sections/item sections/item .
, - . , xsl- . .
xsl .
, ( ) :
template_folder - . , my_template . dtd - . . lang - ( ). mod - .
xsl/my_template , layout.xsl :
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE xsl:stylesheet SYSTEM "../dtd/entities.dtd">
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:template match="/node()">
</xsl:template>
</xsl:stylesheet>
:
<xsl:template match="/node()"> </xsl:template>
- /node() (). /node() //document , .. .
XHTML- <xsl:template match="/node()"></xsl:template>
XML- . , XSL- XML- XHTML- .
, XSL template.xsl (, template - ), :
<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:import href=" my_template /layout.xsl"/>
</xsl:stylesheet>
:
<xsl:import href="my_template/layout.xsl"/>
XSL- ( XSL- ) . .
, .. XML- .
- .
, XML- :
<item id="0" parent_id="0" is_published="1" section="1">
/
<item id="1" parent_id="0" is_published="1" section="1" hit="yes">
news
:
id document - id . hit item - , , " ".
, , :
sections - . item - .
, , item item , , :
1. xsl/my_template navigation.xsl :
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE xsl:stylesheet SYSTEM "../dtd/entities.dtd">
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:template match="sections" mode="global_menu">
</xsl:template>
</xsl:stylesheet>
2. layout.xsl :
<xsl:template match="sections" mode="global_menu">
</xsl:template>
3. … layout.xsl :
<xsl:apply-templates select="navigation/sections" mode="global_menu"/>
:
select="navigation/sections" - ( ) - . , navigation/sections .
mode="global_menu" - global_menu . , , , " ", - .
4. , layout.xsl navigation.xsl :
<xsl:import href="navigation.xsl"/>
5. , navigation.xsl , :
<xsl:template match="item" mode="global_menu">
<xsl:call-template name="href_attribute"/>
<xsl:value-of select="title"/>
</xsl:template>
:
<xsl:call-template name="href_attribute"/>
- . , .. .
<xsl:value-of select="title"/>
- - title . @ - .
6. sections :
<xsl:template match="sections" mode="global_menu">
</xsl:template>
:
<xsl:apply-templates select="item" mode="global_menu"/>
- item sections . , item item ( sections/item/item ) , .. .
item ( ) . , : <xsl:call-template name="href_attribute"/>
uri- . .
7. ,
, . item :
<xsl:template match="item" mode="global_menu">
<xsl:choose>
<xsl:when test="descendant-or-self::*/@id = /node()/@id">
<xsl:value-of select="title"/>
</xsl:when>
<xsl:otherwise>
<xsl:call-template name="href_attribute"/>
<xsl:value-of select="title"/>
</xsl:otherwise>
</xsl:choose>
</xsl:template>
:
<xsl:choose>
<xsl:when></xsl:when>
<xsl:otherwise></xsl:otherwise>
</xsl:choose>
…, , XML- . : <xsl:when test="descendant-or-self::*/@id = /node()/@id">
ID ( document ) ( item ), , .
<xsl:when></xsl:when>
, . <xsl:otherwise></xsl:otherwise>
- .
8. , href_attribute :
<xsl:template name="href_attribute">
<xsl:attribute name="href">
<xsl:text>/</xsl:text>
<xsl:for-each select="ancestor-or-self::item">
<xsl:value-of select="dir"/>
<xsl:text>/</xsl:text>
</xsl:for-each>
</xsl:attribute>
</xsl:template>
xsl:attribute . . a , , href , .. .
<xsl:for-each select="ancestor-or-self::item">
, . ancestor-or-self::item - . dir , .. -.
, - , . , .
UPD:
. , :
parser.proc.ru/iso/xslt-1.zip
( ) Apache.
XML- /xsl/document.xml
- ( ). :
Lang - . . Id - .
<lang_table>
- , .
- :
- ( ):
<item id="0" parent_id="0" is_published="1" section="1">
- . :
Id - . Parent_id - . Is_published - . Dir - uri- . . Section - . .
- .
CMS : :
Html - . , . Com - -. , CMS: , , ..
XSL- , . .
CMS , :
:
Id - .
Container - - ( ).
Sorting - .
Type - :
Com - -
Html - .
Method - .
Title - .
DTD ( ):
<!DOCTYPE site_page [
<!ENTITY nbsp " ">
<!ENTITY sect "§" >
<!ENTITY copy "©">
<!ENTITY laquo "«">
<!ENTITY reg "®">
<!ENTITY deg "°">
<!ENTITY plusmn "±">
<!ENTITY para "¶">
<!ENTITY raquo "»">
<!ENTITY times "×">
<!ENTITY bull "•">
<!ENTITY hellip "…">
<!ENTITY ndash "–">
<!ENTITY mdash "—">
<!ENTITY lsquo "'">
<!ENTITY rsquo "'">
<!ENTITY sbquo "‚">
<!ENTITY ldquo "“">
<!ENTITY rdquo "”">
<!ENTITY bdquo "„">
<!ENTITY lsaquo "‹">
<!ENTITY rsaquo "›" >
<!ENTITY euro "€">
]>
XML- . <?xml version="1.0" encoding="windows-1251"?>
.
XHML-
XSL- XHTML- ( ). XHTML-, , .
.
XHML- , , :
( ). - , . / .
HTML-:
...
...
...
...
...
XSL-
XSL- :
<xsl:stylesheet version = '1.0' encoding="UTF-8"?>
<xsl:template match="element">
</xsl:template>
</xsl:stylesheet>
: <xsl:stylesheet version = '1.0' encoding="UTF-8"?>
- XML- . UTF-8 ( , ).
<xsl:stylesheet> </xsl:stylesheet>
- XSL-.
<xsl:template match="element"> </xsl:template>
- element.
:
<xsl:template match="element"></xsl:template>
- , element . element . <xsl:template match="element" mode="mode1"></xsl:template>
- , element mode1 . element . <xsl:template name="template-name"></xsl:template>
- template-name . - XML- .
XML- (, XML-, item ), " " :
<xsl:template match="navigation/sections/item"></xsl:template>
, , .., , , , .. navigation , navigation/sections/item sections/item .
, - . , xsl- . .
xsl .
, ( ) :
template_folder - . , my_template . dtd - . . lang - ( ). mod - .
xsl/my_template , layout.xsl :
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE xsl:stylesheet SYSTEM "../dtd/entities.dtd">
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:template match="/node()">
</xsl:template>
</xsl:stylesheet>
:
<xsl:template match="/node()"> </xsl:template>
- /node() (). /node() //document , .. .
XHTML- <xsl:template match="/node()"></xsl:template>
XML- . , XSL- XML- XHTML- .
, XSL template.xsl (, template - ), :
<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:import href=" my_template /layout.xsl"/>
</xsl:stylesheet>
:
<xsl:import href="my_template/layout.xsl"/>
XSL- ( XSL- ) . .
, .. XML- .
- .
, XML- :
<item id="0" parent_id="0" is_published="1" section="1">
/
<item id="1" parent_id="0" is_published="1" section="1" hit="yes">
news
:
id document - id . hit item - , , " ".
, , :
sections - . item - .
, , item item , , :
1. xsl/my_template navigation.xsl :
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE xsl:stylesheet SYSTEM "../dtd/entities.dtd">
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:template match="sections" mode="global_menu">
</xsl:template>
</xsl:stylesheet>
2. layout.xsl :
<xsl:template match="sections" mode="global_menu">
</xsl:template>
3. … layout.xsl :
<xsl:apply-templates select="navigation/sections" mode="global_menu"/>
:
select="navigation/sections" - ( ) - . , navigation/sections .
mode="global_menu" - global_menu . , , , " ", - .
4. , layout.xsl navigation.xsl :
<xsl:import href="navigation.xsl"/>
5. , navigation.xsl , :
<xsl:template match="item" mode="global_menu">
<xsl:call-template name="href_attribute"/>
<xsl:value-of select="title"/>
</xsl:template>
:
<xsl:call-template name="href_attribute"/>
- . , .. .
<xsl:value-of select="title"/>
- - title . @ - .
6. sections :
<xsl:template match="sections" mode="global_menu">
</xsl:template>
:
<xsl:apply-templates select="item" mode="global_menu"/>
- item sections . , item item ( sections/item/item ) , .. .
item ( ) . , : <xsl:call-template name="href_attribute"/>
uri- . .
7. ,
, . item :
<xsl:template match="item" mode="global_menu">
<xsl:choose>
<xsl:when test="descendant-or-self::*/@id = /node()/@id">
<xsl:value-of select="title"/>
</xsl:when>
<xsl:otherwise>
<xsl:call-template name="href_attribute"/>
<xsl:value-of select="title"/>
</xsl:otherwise>
</xsl:choose>
</xsl:template>
:
<xsl:choose>
<xsl:when></xsl:when>
<xsl:otherwise></xsl:otherwise>
</xsl:choose>
…, , XML- . : <xsl:when test="descendant-or-self::*/@id = /node()/@id">
ID ( document ) ( item ), , .
<xsl:when></xsl:when>
, . <xsl:otherwise></xsl:otherwise>
- .
8. , href_attribute :
<xsl:template name="href_attribute">
<xsl:attribute name="href">
<xsl:text>/</xsl:text>
<xsl:for-each select="ancestor-or-self::item">
<xsl:value-of select="dir"/>
<xsl:text>/</xsl:text>
</xsl:for-each>
</xsl:attribute>
</xsl:template>
xsl:attribute . . a , , href , .. .
<xsl:for-each select="ancestor-or-self::item">
, . ancestor-or-self::item - . dir , .. -.
, - , . , .
UPD:
. , :
parser.proc.ru/iso/xslt-1.zip
( ) Apache.
XML- /xsl/document.xml
- ( ). :
Lang - . . Id - .
<lang_table>
- , .
- :
- ( ):
<item id="0" parent_id="0" is_published="1" section="1">
- . :
Id - . Parent_id - . Is_published - . Dir - uri- . . Section - . .
- .
CMS : :
Html - . , . Com - -. , CMS: , , ..
XSL- , . .
CMS , :
:
Id - .
Container - - ( ).
Sorting - .
Type - :
Com - -
Html - .
Method - .
Title - .
DTD ( ):
<!DOCTYPE site_page [
<!ENTITY nbsp " ">
<!ENTITY sect "§" >
<!ENTITY copy "©">
<!ENTITY laquo "«">
<!ENTITY reg "®">
<!ENTITY deg "°">
<!ENTITY plusmn "±">
<!ENTITY para "¶">
<!ENTITY raquo "»">
<!ENTITY times "×">
<!ENTITY bull "•">
<!ENTITY hellip "…">
<!ENTITY ndash "–">
<!ENTITY mdash "—">
<!ENTITY lsquo "'">
<!ENTITY rsquo "'">
<!ENTITY sbquo "‚">
<!ENTITY ldquo "“">
<!ENTITY rdquo "”">
<!ENTITY bdquo "„">
<!ENTITY lsaquo "‹">
<!ENTITY rsaquo "›" >
<!ENTITY euro "€">
]>
XML- . <?xml version="1.0" encoding="windows-1251"?>
.
XHML-
XSL- XHTML- ( ). XHTML-, , .
.
XHML- , , :
( ). - , . / .
HTML-:
...
...
...
...
...
XSL-
XSL- :
<xsl:stylesheet version = '1.0' encoding="UTF-8"?>
<xsl:template match="element">
</xsl:template>
</xsl:stylesheet>
: <xsl:stylesheet version = '1.0' encoding="UTF-8"?>
- XML- . UTF-8 ( , ).
<xsl:stylesheet> </xsl:stylesheet>
- XSL-.
<xsl:template match="element"> </xsl:template>
- element.
:
<xsl:template match="element"></xsl:template>
- , element . element . <xsl:template match="element" mode="mode1"></xsl:template>
- , element mode1 . element . <xsl:template name="template-name"></xsl:template>
- template-name . - XML- .
XML- (, XML-, item ), " " :
<xsl:template match="navigation/sections/item"></xsl:template>
, , .., , , , .. navigation , navigation/sections/item sections/item .
, - . , xsl- . .
xsl .
, ( ) :
template_folder - . , my_template . dtd - . . lang - ( ). mod - .
xsl/my_template , layout.xsl :
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE xsl:stylesheet SYSTEM "../dtd/entities.dtd">
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:template match="/node()">
</xsl:template>
</xsl:stylesheet>
:
<xsl:template match="/node()"> </xsl:template>
- /node() (). /node() //document , .. .
XHTML- <xsl:template match="/node()"></xsl:template>
XML- . , XSL- XML- XHTML- .
, XSL template.xsl (, template - ), :
<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:import href=" my_template /layout.xsl"/>
</xsl:stylesheet>
:
<xsl:import href="my_template/layout.xsl"/>
XSL- ( XSL- ) . .
, .. XML- .
- .
, XML- :
<item id="0" parent_id="0" is_published="1" section="1">
/
<item id="1" parent_id="0" is_published="1" section="1" hit="yes">
news
:
id document - id . hit item - , , " ".
, , :
sections - . item - .
, , item item , , :
1. xsl/my_template navigation.xsl :
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE xsl:stylesheet SYSTEM "../dtd/entities.dtd">
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:template match="sections" mode="global_menu">
</xsl:template>
</xsl:stylesheet>
2. layout.xsl :
<xsl:template match="sections" mode="global_menu">
</xsl:template>
3. … layout.xsl :
<xsl:apply-templates select="navigation/sections" mode="global_menu"/>
:
select="navigation/sections" - ( ) - . , navigation/sections .
mode="global_menu" - global_menu . , , , " ", - .
4. , layout.xsl navigation.xsl :
<xsl:import href="navigation.xsl"/>
5. , navigation.xsl , :
<xsl:template match="item" mode="global_menu">
<xsl:call-template name="href_attribute"/>
<xsl:value-of select="title"/>
</xsl:template>
:
<xsl:call-template name="href_attribute"/>
- . , .. .
<xsl:value-of select="title"/>
- - title . @ - .
6. sections :
<xsl:template match="sections" mode="global_menu">
</xsl:template>
:
<xsl:apply-templates select="item" mode="global_menu"/>
- item sections . , item item ( sections/item/item ) , .. .
item ( ) . , : <xsl:call-template name="href_attribute"/>
uri- . .
7. ,
, . item :
<xsl:template match="item" mode="global_menu">
<xsl:choose>
<xsl:when test="descendant-or-self::*/@id = /node()/@id">
<xsl:value-of select="title"/>
</xsl:when>
<xsl:otherwise>
<xsl:call-template name="href_attribute"/>
<xsl:value-of select="title"/>
</xsl:otherwise>
</xsl:choose>
</xsl:template>
:
<xsl:choose>
<xsl:when></xsl:when>
<xsl:otherwise></xsl:otherwise>
</xsl:choose>
…, , XML- . : <xsl:when test="descendant-or-self::*/@id = /node()/@id">
ID ( document ) ( item ), , .
<xsl:when></xsl:when>
, . <xsl:otherwise></xsl:otherwise>
- .
8. , href_attribute :
<xsl:template name="href_attribute">
<xsl:attribute name="href">
<xsl:text>/</xsl:text>
<xsl:for-each select="ancestor-or-self::item">
<xsl:value-of select="dir"/>
<xsl:text>/</xsl:text>
</xsl:for-each>
</xsl:attribute>
</xsl:template>
xsl:attribute . . a , , href , .. .
<xsl:for-each select="ancestor-or-self::item">
, . ancestor-or-self::item - . dir , .. -.
, - , . , .
UPD:
. , :
parser.proc.ru/iso/xslt-1.zip
( ) Apache.
XML- /xsl/document.xml
- ( ). :
Lang - . . Id - .
<lang_table>
- , .
- :
- ( ):
<item id="0" parent_id="0" is_published="1" section="1">
- . :
Id - . Parent_id - . Is_published - . Dir - uri- . . Section - . .
- .
CMS : :
Html - . , . Com - -. , CMS: , , ..
XSL- , . .
CMS , :
:
Id - .
Container - - ( ).
Sorting - .
Type - :
Com - -
Html - .
Method - .
Title - .
DTD ( ):
<!DOCTYPE site_page [
<!ENTITY nbsp " ">
<!ENTITY sect "§" >
<!ENTITY copy "©">
<!ENTITY laquo "«">
<!ENTITY reg "®">
<!ENTITY deg "°">
<!ENTITY plusmn "±">
<!ENTITY para "¶">
<!ENTITY raquo "»">
<!ENTITY times "×">
<!ENTITY bull "•">
<!ENTITY hellip "…">
<!ENTITY ndash "–">
<!ENTITY mdash "—">
<!ENTITY lsquo "'">
<!ENTITY rsquo "'">
<!ENTITY sbquo "‚">
<!ENTITY ldquo "“">
<!ENTITY rdquo "”">
<!ENTITY bdquo "„">
<!ENTITY lsaquo "‹">
<!ENTITY rsaquo "›" >
<!ENTITY euro "€">
]>
XML- . <?xml version="1.0" encoding="windows-1251"?>
.
XHML-
XSL- XHTML- ( ). XHTML-, , .
.
XHML- , , :
( ). - , . / .
HTML-:
...
...
...
...
...
XSL-
XSL- :
<xsl:stylesheet version = '1.0' encoding="UTF-8"?>
<xsl:template match="element">
</xsl:template>
</xsl:stylesheet>
: <xsl:stylesheet version = '1.0' encoding="UTF-8"?>
- XML- . UTF-8 ( , ).
<xsl:stylesheet> </xsl:stylesheet>
- XSL-.
<xsl:template match="element"> </xsl:template>
- element.
:
<xsl:template match="element"></xsl:template>
- , element . element . <xsl:template match="element" mode="mode1"></xsl:template>
- , element mode1 . element . <xsl:template name="template-name"></xsl:template>
- template-name . - XML- .
XML- (, XML-, item ), " " :
<xsl:template match="navigation/sections/item"></xsl:template>
, , .., , , , .. navigation , navigation/sections/item sections/item .
, - . , xsl- . .
xsl .
, ( ) :
template_folder - . , my_template . dtd - . . lang - ( ). mod - .
xsl/my_template , layout.xsl :
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE xsl:stylesheet SYSTEM "../dtd/entities.dtd">
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:template match="/node()">
</xsl:template>
</xsl:stylesheet>
:
<xsl:template match="/node()"> </xsl:template>
- /node() (). /node() //document , .. .
XHTML- <xsl:template match="/node()"></xsl:template>
XML- . , XSL- XML- XHTML- .
, XSL template.xsl (, template - ), :
<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:import href=" my_template /layout.xsl"/>
</xsl:stylesheet>
:
<xsl:import href="my_template/layout.xsl"/>
XSL- ( XSL- ) . .
, .. XML- .
- .
, XML- :
<item id="0" parent_id="0" is_published="1" section="1">
/
<item id="1" parent_id="0" is_published="1" section="1" hit="yes">
news
:
id document - id . hit item - , , " ".
, , :
sections - . item - .
, , item item , , :
1. xsl/my_template navigation.xsl :
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE xsl:stylesheet SYSTEM "../dtd/entities.dtd">
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:template match="sections" mode="global_menu">
</xsl:template>
</xsl:stylesheet>
2. layout.xsl :
<xsl:template match="sections" mode="global_menu">
</xsl:template>
3. … layout.xsl :
<xsl:apply-templates select="navigation/sections" mode="global_menu"/>
:
select="navigation/sections" - ( ) - . , navigation/sections .
mode="global_menu" - global_menu . , , , " ", - .
4. , layout.xsl navigation.xsl :
<xsl:import href="navigation.xsl"/>
5. , navigation.xsl , :
<xsl:template match="item" mode="global_menu">
<xsl:call-template name="href_attribute"/>
<xsl:value-of select="title"/>
</xsl:template>
:
<xsl:call-template name="href_attribute"/>
- . , .. .
<xsl:value-of select="title"/>
- - title . @ - .
6. sections :
<xsl:template match="sections" mode="global_menu">
</xsl:template>
:
<xsl:apply-templates select="item" mode="global_menu"/>
- item sections . , item item ( sections/item/item ) , .. .
item ( ) . , : <xsl:call-template name="href_attribute"/>
uri- . .
7. ,
, . item :
<xsl:template match="item" mode="global_menu">
<xsl:choose>
<xsl:when test="descendant-or-self::*/@id = /node()/@id">
<xsl:value-of select="title"/>
</xsl:when>
<xsl:otherwise>
<xsl:call-template name="href_attribute"/>
<xsl:value-of select="title"/>
</xsl:otherwise>
</xsl:choose>
</xsl:template>
:
<xsl:choose>
<xsl:when></xsl:when>
<xsl:otherwise></xsl:otherwise>
</xsl:choose>
…, , XML- . : <xsl:when test="descendant-or-self::*/@id = /node()/@id">
ID ( document ) ( item ), , .
<xsl:when></xsl:when>
, . <xsl:otherwise></xsl:otherwise>
- .
8. , href_attribute :
<xsl:template name="href_attribute">
<xsl:attribute name="href">
<xsl:text>/</xsl:text>
<xsl:for-each select="ancestor-or-self::item">
<xsl:value-of select="dir"/>
<xsl:text>/</xsl:text>
</xsl:for-each>
</xsl:attribute>
</xsl:template>
xsl:attribute . . a , , href , .. .
<xsl:for-each select="ancestor-or-self::item">
, . ancestor-or-self::item - . dir , .. -.
, - , . , .
UPD:
. , :
parser.proc.ru/iso/xslt-1.zip
( ) Apache.
XML- /xsl/document.xml
- ( ). :
Lang - . . Id - .
<lang_table>
- , .
- :
- ( ):
<item id="0" parent_id="0" is_published="1" section="1">
- . :
Id - . Parent_id - . Is_published - . Dir - uri- . . Section - . .
- .
CMS : :
Html - . , . Com - -. , CMS: , , ..
XSL- , . .
CMS , :
:
Id - .
Container - - ( ).
Sorting - .
Type - :
Com - -
Html - .
Method - .
Title - .
DTD ( ):
<!DOCTYPE site_page [
<!ENTITY nbsp " ">
<!ENTITY sect "§" >
<!ENTITY copy "©">
<!ENTITY laquo "«">
<!ENTITY reg "®">
<!ENTITY deg "°">
<!ENTITY plusmn "±">
<!ENTITY para "¶">
<!ENTITY raquo "»">
<!ENTITY times "×">
<!ENTITY bull "•">
<!ENTITY hellip "…">
<!ENTITY ndash "–">
<!ENTITY mdash "—">
<!ENTITY lsquo "'">
<!ENTITY rsquo "'">
<!ENTITY sbquo "‚">
<!ENTITY ldquo "“">
<!ENTITY rdquo "”">
<!ENTITY bdquo "„">
<!ENTITY lsaquo "‹">
<!ENTITY rsaquo "›" >
<!ENTITY euro "€">
]>
XML- . <?xml version="1.0" encoding="windows-1251"?>
.
XHML-
XSL- XHTML- ( ). XHTML-, , .
.
XHML- , , :
( ). - , . / .
HTML-:
...
...
...
...
...
XSL-
XSL- :
<xsl:stylesheet version = '1.0' encoding="UTF-8"?>
<xsl:template match="element">
</xsl:template>
</xsl:stylesheet>
: <xsl:stylesheet version = '1.0' encoding="UTF-8"?>
- XML- . UTF-8 ( , ).
<xsl:stylesheet> </xsl:stylesheet>
- XSL-.
<xsl:template match="element"> </xsl:template>
- element.
:
<xsl:template match="element"></xsl:template>
- , element . element . <xsl:template match="element" mode="mode1"></xsl:template>
- , element mode1 . element . <xsl:template name="template-name"></xsl:template>
- template-name . - XML- .
XML- (, XML-, item ), " " :
<xsl:template match="navigation/sections/item"></xsl:template>
, , .., , , , .. navigation , navigation/sections/item sections/item .
, - . , xsl- . .
xsl .
, ( ) :
template_folder - . , my_template . dtd - . . lang - ( ). mod - .
xsl/my_template , layout.xsl :
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE xsl:stylesheet SYSTEM "../dtd/entities.dtd">
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:template match="/node()">
</xsl:template>
</xsl:stylesheet>
:
<xsl:template match="/node()"> </xsl:template>
- /node() (). /node() //document , .. .
XHTML- <xsl:template match="/node()"></xsl:template>
XML- . , XSL- XML- XHTML- .
, XSL template.xsl (, template - ), :
<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:import href=" my_template /layout.xsl"/>
</xsl:stylesheet>
:
<xsl:import href="my_template/layout.xsl"/>
XSL- ( XSL- ) . .
, .. XML- .
- .
, XML- :
<item id="0" parent_id="0" is_published="1" section="1">
/
<item id="1" parent_id="0" is_published="1" section="1" hit="yes">
news
:
id document - id . hit item - , , " ".
, , :
sections - . item - .
, , item item , , :
1. xsl/my_template navigation.xsl :
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE xsl:stylesheet SYSTEM "../dtd/entities.dtd">
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:template match="sections" mode="global_menu">
</xsl:template>
</xsl:stylesheet>
2. layout.xsl :
<xsl:template match="sections" mode="global_menu">
</xsl:template>
3. … layout.xsl :
<xsl:apply-templates select="navigation/sections" mode="global_menu"/>
:
select="navigation/sections" - ( ) - . , navigation/sections .
mode="global_menu" - global_menu . , , , " ", - .
4. , layout.xsl navigation.xsl :
<xsl:import href="navigation.xsl"/>
5. , navigation.xsl , :
<xsl:template match="item" mode="global_menu">
<xsl:call-template name="href_attribute"/>
<xsl:value-of select="title"/>
</xsl:template>
:
<xsl:call-template name="href_attribute"/>
- . , .. .
<xsl:value-of select="title"/>
- - title . @ - .
6. sections :
<xsl:template match="sections" mode="global_menu">
</xsl:template>
:
<xsl:apply-templates select="item" mode="global_menu"/>
- item sections . , item item ( sections/item/item ) , .. .
item ( ) . , : <xsl:call-template name="href_attribute"/>
uri- . .
7. ,
, . item :
<xsl:template match="item" mode="global_menu">
<xsl:choose>
<xsl:when test="descendant-or-self::*/@id = /node()/@id">
<xsl:value-of select="title"/>
</xsl:when>
<xsl:otherwise>
<xsl:call-template name="href_attribute"/>
<xsl:value-of select="title"/>
</xsl:otherwise>
</xsl:choose>
</xsl:template>
:
<xsl:choose>
<xsl:when></xsl:when>
<xsl:otherwise></xsl:otherwise>
</xsl:choose>
…, , XML- . : <xsl:when test="descendant-or-self::*/@id = /node()/@id">
ID ( document ) ( item ), , .
<xsl:when></xsl:when>
, . <xsl:otherwise></xsl:otherwise>
- .
8. , href_attribute :
<xsl:template name="href_attribute">
<xsl:attribute name="href">
<xsl:text>/</xsl:text>
<xsl:for-each select="ancestor-or-self::item">
<xsl:value-of select="dir"/>
<xsl:text>/</xsl:text>
</xsl:for-each>
</xsl:attribute>
</xsl:template>
xsl:attribute . . a , , href , .. .
<xsl:for-each select="ancestor-or-self::item">
, . ancestor-or-self::item - . dir , .. -.
, - , . , .
UPD:
. , :
parser.proc.ru/iso/xslt-1.zip
( ) Apache.
XML- /xsl/document.xml
- ( ). :
Lang - . . Id - .
<lang_table>
- , .
- :
- ( ):
<item id="0" parent_id="0" is_published="1" section="1">
- . :
Id - . Parent_id - . Is_published - . Dir - uri- . . Section - . .
- .
CMS : :
Html - . , . Com - -. , CMS: , , ..
XSL- , . .
CMS , :
:
Id - .
Container - - ( ).
Sorting - .
Type - :
Com - -
Html - .
Method - .
Title - .
DTD ( ):
<!DOCTYPE site_page [
<!ENTITY nbsp " ">
<!ENTITY sect "§" >
<!ENTITY copy "©">
<!ENTITY laquo "«">
<!ENTITY reg "®">
<!ENTITY deg "°">
<!ENTITY plusmn "±">
<!ENTITY para "¶">
<!ENTITY raquo "»">
<!ENTITY times "×">
<!ENTITY bull "•">
<!ENTITY hellip "…">
<!ENTITY ndash "–">
<!ENTITY mdash "—">
<!ENTITY lsquo "'">
<!ENTITY rsquo "'">
<!ENTITY sbquo "‚">
<!ENTITY ldquo "“">
<!ENTITY rdquo "”">
<!ENTITY bdquo "„">
<!ENTITY lsaquo "‹">
<!ENTITY rsaquo "›" >
<!ENTITY euro "€">
]>
XML- . <?xml version="1.0" encoding="windows-1251"?>
.
XHML-
XSL- XHTML- ( ). XHTML-, , .
.
XHML- , , :
( ). - , . / .
HTML-:
...
...
...
...
...
XSL-
XSL- :
<xsl:stylesheet version = '1.0' encoding="UTF-8"?>
<xsl:template match="element">
</xsl:template>
</xsl:stylesheet>
: <xsl:stylesheet version = '1.0' encoding="UTF-8"?>
- XML- . UTF-8 ( , ).
<xsl:stylesheet> </xsl:stylesheet>
- XSL-.
<xsl:template match="element"> </xsl:template>
- element.
:
<xsl:template match="element"></xsl:template>
- , element . element . <xsl:template match="element" mode="mode1"></xsl:template>
- , element mode1 . element . <xsl:template name="template-name"></xsl:template>
- template-name . - XML- .
XML- (, XML-, item ), " " :
<xsl:template match="navigation/sections/item"></xsl:template>
, , .., , , , .. navigation , navigation/sections/item sections/item .
, - . , xsl- . .
xsl .
, ( ) :
template_folder - . , my_template . dtd - . . lang - ( ). mod - .
xsl/my_template , layout.xsl :
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE xsl:stylesheet SYSTEM "../dtd/entities.dtd">
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:template match="/node()">
</xsl:template>
</xsl:stylesheet>
:
<xsl:template match="/node()"> </xsl:template>
- /node() (). /node() //document , .. .
XHTML- <xsl:template match="/node()"></xsl:template>
XML- . , XSL- XML- XHTML- .
, XSL template.xsl (, template - ), :
<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:import href=" my_template /layout.xsl"/>
</xsl:stylesheet>
:
<xsl:import href="my_template/layout.xsl"/>
XSL- ( XSL- ) . .
, .. XML- .
- .
, XML- :
<item id="0" parent_id="0" is_published="1" section="1">
/
<item id="1" parent_id="0" is_published="1" section="1" hit="yes">
news
:
id document - id . hit item - , , " ".
, , :
sections - . item - .
, , item item , , :
1. xsl/my_template navigation.xsl :
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE xsl:stylesheet SYSTEM "../dtd/entities.dtd">
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:template match="sections" mode="global_menu">
</xsl:template>
</xsl:stylesheet>
2. layout.xsl :
<xsl:template match="sections" mode="global_menu">
</xsl:template>
3. … layout.xsl :
<xsl:apply-templates select="navigation/sections" mode="global_menu"/>
:
select="navigation/sections" - ( ) - . , navigation/sections .
mode="global_menu" - global_menu . , , , " ", - .
4. , layout.xsl navigation.xsl :
<xsl:import href="navigation.xsl"/>
5. , navigation.xsl , :
<xsl:template match="item" mode="global_menu">
<xsl:call-template name="href_attribute"/>
<xsl:value-of select="title"/>
</xsl:template>
:
<xsl:call-template name="href_attribute"/>
- . , .. .
<xsl:value-of select="title"/>
- - title . @ - .
6. sections :
<xsl:template match="sections" mode="global_menu">
</xsl:template>
:
<xsl:apply-templates select="item" mode="global_menu"/>
- item sections . , item item ( sections/item/item ) , .. .
item ( ) . , : <xsl:call-template name="href_attribute"/>
uri- . .
7. ,
, . item :
<xsl:template match="item" mode="global_menu">
<xsl:choose>
<xsl:when test="descendant-or-self::*/@id = /node()/@id">
<xsl:value-of select="title"/>
</xsl:when>
<xsl:otherwise>
<xsl:call-template name="href_attribute"/>
<xsl:value-of select="title"/>
</xsl:otherwise>
</xsl:choose>
</xsl:template>
:
<xsl:choose>
<xsl:when></xsl:when>
<xsl:otherwise></xsl:otherwise>
</xsl:choose>
…, , XML- . : <xsl:when test="descendant-or-self::*/@id = /node()/@id">
ID ( document ) ( item ), , .
<xsl:when></xsl:when>
, . <xsl:otherwise></xsl:otherwise>
- .
8. , href_attribute :
<xsl:template name="href_attribute">
<xsl:attribute name="href">
<xsl:text>/</xsl:text>
<xsl:for-each select="ancestor-or-self::item">
<xsl:value-of select="dir"/>
<xsl:text>/</xsl:text>
</xsl:for-each>
</xsl:attribute>
</xsl:template>
xsl:attribute . . a , , href , .. .
<xsl:for-each select="ancestor-or-self::item">
, . ancestor-or-self::item - . dir , .. -.
, - , . , .
UPD:
. , :
parser.proc.ru/iso/xslt-1.zip
( ) Apache.
XML- /xsl/document.xml
- ( ). :
Lang - . . Id - .
<lang_table>
- , .
- :
- ( ):
<item id="0" parent_id="0" is_published="1" section="1">
- . :
Id - . Parent_id - . Is_published - . Dir - uri- . . Section - . .
- .
CMS : :
Html - . , . Com - -. , CMS: , , ..
XSL- , . .
CMS , :
:
Id - .
Container - - ( ).
Sorting - .
Type - :
Com - -
Html - .
Method - .
Title - .
DTD ( ):
<!DOCTYPE site_page [
<!ENTITY nbsp " ">
<!ENTITY sect "§" >
<!ENTITY copy "©">
<!ENTITY laquo "«">
<!ENTITY reg "®">
<!ENTITY deg "°">
<!ENTITY plusmn "±">
<!ENTITY para "¶">
<!ENTITY raquo "»">
<!ENTITY times "×">
<!ENTITY bull "•">
<!ENTITY hellip "…">
<!ENTITY ndash "–">
<!ENTITY mdash "—">
<!ENTITY lsquo "'">
<!ENTITY rsquo "'">
<!ENTITY sbquo "‚">
<!ENTITY ldquo "“">
<!ENTITY rdquo "”">
<!ENTITY bdquo "„">
<!ENTITY lsaquo "‹">
<!ENTITY rsaquo "›" >
<!ENTITY euro "€">
]>
XML- . <?xml version="1.0" encoding="windows-1251"?>
.
XHML-
XSL- XHTML- ( ). XHTML-, , .
.
XHML- , , :
( ). - , . / .
HTML-:
...
...
...
...
...
XSL-
XSL- :
<xsl:stylesheet version = '1.0' encoding="UTF-8"?>
<xsl:template match="element">
</xsl:template>
</xsl:stylesheet>
: <xsl:stylesheet version = '1.0' encoding="UTF-8"?>
- XML- . UTF-8 ( , ).
<xsl:stylesheet> </xsl:stylesheet>
- XSL-.
<xsl:template match="element"> </xsl:template>
- element.
:
<xsl:template match="element"></xsl:template>
- , element . element . <xsl:template match="element" mode="mode1"></xsl:template>
- , element mode1 . element . <xsl:template name="template-name"></xsl:template>
- template-name . - XML- .
XML- (, XML-, item ), " " :
<xsl:template match="navigation/sections/item"></xsl:template>
, , .., , , , .. navigation , navigation/sections/item sections/item .
, - . , xsl- . .
xsl .
, ( ) :
template_folder - . , my_template . dtd - . . lang - ( ). mod - .
xsl/my_template , layout.xsl :
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE xsl:stylesheet SYSTEM "../dtd/entities.dtd">
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:template match="/node()">
</xsl:template>
</xsl:stylesheet>
:
<xsl:template match="/node()"> </xsl:template>
- /node() (). /node() //document , .. .
XHTML- <xsl:template match="/node()"></xsl:template>
XML- . , XSL- XML- XHTML- .
, XSL template.xsl (, template - ), :
<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:import href=" my_template /layout.xsl"/>
</xsl:stylesheet>
:
<xsl:import href="my_template/layout.xsl"/>
XSL- ( XSL- ) . .
, .. XML- .
- .
, XML- :
<item id="0" parent_id="0" is_published="1" section="1">
/
<item id="1" parent_id="0" is_published="1" section="1" hit="yes">
news
:
id document - id . hit item - , , " ".
, , :
sections - . item - .
, , item item , , :
1. xsl/my_template navigation.xsl :
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE xsl:stylesheet SYSTEM "../dtd/entities.dtd">
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:template match="sections" mode="global_menu">
</xsl:template>
</xsl:stylesheet>
2. layout.xsl :
<xsl:template match="sections" mode="global_menu">
</xsl:template>
3. … layout.xsl :
<xsl:apply-templates select="navigation/sections" mode="global_menu"/>
:
select="navigation/sections" - ( ) - . , navigation/sections .
mode="global_menu" - global_menu . , , , " ", - .
4. , layout.xsl navigation.xsl :
<xsl:import href="navigation.xsl"/>
5. , navigation.xsl , :
<xsl:template match="item" mode="global_menu">
<xsl:call-template name="href_attribute"/>
<xsl:value-of select="title"/>
</xsl:template>
:
<xsl:call-template name="href_attribute"/>
- . , .. .
<xsl:value-of select="title"/>
- - title . @ - .
6. sections :
<xsl:template match="sections" mode="global_menu">
</xsl:template>
:
<xsl:apply-templates select="item" mode="global_menu"/>
- item sections . , item item ( sections/item/item ) , .. .
item ( ) . , : <xsl:call-template name="href_attribute"/>
uri- . .
7. ,
, . item :
<xsl:template match="item" mode="global_menu">
<xsl:choose>
<xsl:when test="descendant-or-self::*/@id = /node()/@id">
<xsl:value-of select="title"/>
</xsl:when>
<xsl:otherwise>
<xsl:call-template name="href_attribute"/>
<xsl:value-of select="title"/>
</xsl:otherwise>
</xsl:choose>
</xsl:template>
:
<xsl:choose>
<xsl:when></xsl:when>
<xsl:otherwise></xsl:otherwise>
</xsl:choose>
…, , XML- . : <xsl:when test="descendant-or-self::*/@id = /node()/@id">
ID ( document ) ( item ), , .
<xsl:when></xsl:when>
, . <xsl:otherwise></xsl:otherwise>
- .
8. , href_attribute :
<xsl:template name="href_attribute">
<xsl:attribute name="href">
<xsl:text>/</xsl:text>
<xsl:for-each select="ancestor-or-self::item">
<xsl:value-of select="dir"/>
<xsl:text>/</xsl:text>
</xsl:for-each>
</xsl:attribute>
</xsl:template>
xsl:attribute . . a , , href , .. .
<xsl:for-each select="ancestor-or-self::item">
, . ancestor-or-self::item - . dir , .. -.
, - , . , .
UPD:
. , :
parser.proc.ru/iso/xslt-1.zip
( ) Apache.
XML- /xsl/document.xml
- ( ). :
Lang - . . Id - .
<lang_table>
- , .
- :
- ( ):
<item id="0" parent_id="0" is_published="1" section="1">
- . :
Id - . Parent_id - . Is_published - . Dir - uri- . . Section - . .
- .
CMS : :
Html - . , . Com - -. , CMS: , , ..
XSL- , . .
CMS , :
:
Id - .
Container - - ( ).
Sorting - .
Type - :
Com - -
Html - .
Method - .
Title - .
DTD ( ):
<!DOCTYPE site_page [
<!ENTITY nbsp " ">
<!ENTITY sect "§" >
<!ENTITY copy "©">
<!ENTITY laquo "«">
<!ENTITY reg "®">
<!ENTITY deg "°">
<!ENTITY plusmn "±">
<!ENTITY para "¶">
<!ENTITY raquo "»">
<!ENTITY times "×">
<!ENTITY bull "•">
<!ENTITY hellip "…">
<!ENTITY ndash "–">
<!ENTITY mdash "—">
<!ENTITY lsquo "'">
<!ENTITY rsquo "'">
<!ENTITY sbquo "‚">
<!ENTITY ldquo "“">
<!ENTITY rdquo "”">
<!ENTITY bdquo "„">
<!ENTITY lsaquo "‹">
<!ENTITY rsaquo "›" >
<!ENTITY euro "€">
]>
XML- . <?xml version="1.0" encoding="windows-1251"?>
.
XHML-
XSL- XHTML- ( ). XHTML-, , .
.
XHML- , , :
( ). - , . / .
HTML-:
...
...
...
...
...
XSL-
XSL- :
<xsl:stylesheet version = '1.0' encoding="UTF-8"?>
<xsl:template match="element">
</xsl:template>
</xsl:stylesheet>
: <xsl:stylesheet version = '1.0' encoding="UTF-8"?>
- XML- . UTF-8 ( , ).
<xsl:stylesheet> </xsl:stylesheet>
- XSL-.
<xsl:template match="element"> </xsl:template>
- element.
:
<xsl:template match="element"></xsl:template>
- , element . element . <xsl:template match="element" mode="mode1"></xsl:template>
- , element mode1 . element . <xsl:template name="template-name"></xsl:template>
- template-name . - XML- .
XML- (, XML-, item ), " " :
<xsl:template match="navigation/sections/item"></xsl:template>
, , .., , , , .. navigation , navigation/sections/item sections/item .
, - . , xsl- . .
xsl .
, ( ) :
template_folder - . , my_template . dtd - . . lang - ( ). mod - .
xsl/my_template , layout.xsl :
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE xsl:stylesheet SYSTEM "../dtd/entities.dtd">
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:template match="/node()">
</xsl:template>
</xsl:stylesheet>
:
<xsl:template match="/node()"> </xsl:template>
- /node() (). /node() //document , .. .
XHTML- <xsl:template match="/node()"></xsl:template>
XML- . , XSL- XML- XHTML- .
, XSL template.xsl (, template - ), :
<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:import href=" my_template /layout.xsl"/>
</xsl:stylesheet>
:
<xsl:import href="my_template/layout.xsl"/>
XSL- ( XSL- ) . .
, .. XML- .
- .
, XML- :
<item id="0" parent_id="0" is_published="1" section="1">
/
<item id="1" parent_id="0" is_published="1" section="1" hit="yes">
news
:
id document - id . hit item - , , " ".
, , :
sections - . item - .
, , item item , , :
1. xsl/my_template navigation.xsl :
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE xsl:stylesheet SYSTEM "../dtd/entities.dtd">
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:template match="sections" mode="global_menu">
</xsl:template>
</xsl:stylesheet>
2. layout.xsl :
<xsl:template match="sections" mode="global_menu">
</xsl:template>
3. … layout.xsl :
<xsl:apply-templates select="navigation/sections" mode="global_menu"/>
:
select="navigation/sections" - ( ) - . , navigation/sections .
mode="global_menu" - global_menu . , , , " ", - .
4. , layout.xsl navigation.xsl :
<xsl:import href="navigation.xsl"/>
5. , navigation.xsl , :
<xsl:template match="item" mode="global_menu">
<xsl:call-template name="href_attribute"/>
<xsl:value-of select="title"/>
</xsl:template>
:
<xsl:call-template name="href_attribute"/>
- . , .. .
<xsl:value-of select="title"/>
- - title . @ - .
6. sections :
<xsl:template match="sections" mode="global_menu">
</xsl:template>
:
<xsl:apply-templates select="item" mode="global_menu"/>
- item sections . , item item ( sections/item/item ) , .. .
item ( ) . , : <xsl:call-template name="href_attribute"/>
uri- . .
7. ,
, . item :
<xsl:template match="item" mode="global_menu">
<xsl:choose>
<xsl:when test="descendant-or-self::*/@id = /node()/@id">
<xsl:value-of select="title"/>
</xsl:when>
<xsl:otherwise>
<xsl:call-template name="href_attribute"/>
<xsl:value-of select="title"/>
</xsl:otherwise>
</xsl:choose>
</xsl:template>
:
<xsl:choose>
<xsl:when></xsl:when>
<xsl:otherwise></xsl:otherwise>
</xsl:choose>
…, , XML- . : <xsl:when test="descendant-or-self::*/@id = /node()/@id">
ID ( document ) ( item ), , .
<xsl:when></xsl:when>
, . <xsl:otherwise></xsl:otherwise>
- .
8. , href_attribute :
<xsl:template name="href_attribute">
<xsl:attribute name="href">
<xsl:text>/</xsl:text>
<xsl:for-each select="ancestor-or-self::item">
<xsl:value-of select="dir"/>
<xsl:text>/</xsl:text>
</xsl:for-each>
</xsl:attribute>
</xsl:template>
xsl:attribute . . a , , href , .. .
<xsl:for-each select="ancestor-or-self::item">
, . ancestor-or-self::item - . dir , .. -.
, - , . , .
UPD:
. , :
parser.proc.ru/iso/xslt-1.zip
( ) Apache.
XML- /xsl/document.xml
- ( ). :
Lang - . . Id - .
<lang_table>
- , .
- :
- ( ):
<item id="0" parent_id="0" is_published="1" section="1">
- . :
Id - . Parent_id - . Is_published - . Dir - uri- . . Section - . .
- .
CMS : :
Html - . , . Com - -. , CMS: , , ..
XSL- , . .
CMS , :
:
Id - .
Container - - ( ).
Sorting - .
Type - :
Com - -
Html - .
Method - .
Title - .
DTD ( ):
<!DOCTYPE site_page [
<!ENTITY nbsp " ">
<!ENTITY sect "§" >
<!ENTITY copy "©">
<!ENTITY laquo "«">
<!ENTITY reg "®">
<!ENTITY deg "°">
<!ENTITY plusmn "±">
<!ENTITY para "¶">
<!ENTITY raquo "»">
<!ENTITY times "×">
<!ENTITY bull "•">
<!ENTITY hellip "…">
<!ENTITY ndash "–">
<!ENTITY mdash "—">
<!ENTITY lsquo "'">
<!ENTITY rsquo "'">
<!ENTITY sbquo "‚">
<!ENTITY ldquo "“">
<!ENTITY rdquo "”">
<!ENTITY bdquo "„">
<!ENTITY lsaquo "‹">
<!ENTITY rsaquo "›" >
<!ENTITY euro "€">
]>
XML- . <?xml version="1.0" encoding="windows-1251"?>
.
XHML-
XSL- XHTML- ( ). XHTML-, , .
.
XHML- , , :
( ). - , . / .
HTML-:
...
...
...
...
...
XSL-
XSL- :
<xsl:stylesheet version = '1.0' encoding="UTF-8"?>
<xsl:template match="element">
</xsl:template>
</xsl:stylesheet>
: <xsl:stylesheet version = '1.0' encoding="UTF-8"?>
- XML- . UTF-8 ( , ).
<xsl:stylesheet> </xsl:stylesheet>
- XSL-.
<xsl:template match="element"> </xsl:template>
- element.
:
<xsl:template match="element"></xsl:template>
- , element . element . <xsl:template match="element" mode="mode1"></xsl:template>
- , element mode1 . element . <xsl:template name="template-name"></xsl:template>
- template-name . - XML- .
XML- (, XML-, item ), " " :
<xsl:template match="navigation/sections/item"></xsl:template>
, , .., , , , .. navigation , navigation/sections/item sections/item .
, - . , xsl- . .
xsl .
, ( ) :
template_folder - . , my_template . dtd - . . lang - ( ). mod - .
xsl/my_template , layout.xsl :
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE xsl:stylesheet SYSTEM "../dtd/entities.dtd">
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:template match="/node()">
</xsl:template>
</xsl:stylesheet>
:
<xsl:template match="/node()"> </xsl:template>
- /node() (). /node() //document , .. .
XHTML- <xsl:template match="/node()"></xsl:template>
XML- . , XSL- XML- XHTML- .
, XSL template.xsl (, template - ), :
<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:import href=" my_template /layout.xsl"/>
</xsl:stylesheet>
:
<xsl:import href="my_template/layout.xsl"/>
XSL- ( XSL- ) . .
, .. XML- .
- .
, XML- :
<item id="0" parent_id="0" is_published="1" section="1">
/
<item id="1" parent_id="0" is_published="1" section="1" hit="yes">
news
:
id document - id . hit item - , , " ".
, , :
sections - . item - .
, , item item , , :
1. xsl/my_template navigation.xsl :
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE xsl:stylesheet SYSTEM "../dtd/entities.dtd">
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:template match="sections" mode="global_menu">
</xsl:template>
</xsl:stylesheet>
2. layout.xsl :
<xsl:template match="sections" mode="global_menu">
</xsl:template>
3. … layout.xsl :
<xsl:apply-templates select="navigation/sections" mode="global_menu"/>
:
select="navigation/sections" - ( ) - . , navigation/sections .
mode="global_menu" - global_menu . , , , " ", - .
4. , layout.xsl navigation.xsl :
<xsl:import href="navigation.xsl"/>
5. , navigation.xsl , :
<xsl:template match="item" mode="global_menu">
<xsl:call-template name="href_attribute"/>
<xsl:value-of select="title"/>
</xsl:template>
:
<xsl:call-template name="href_attribute"/>
- . , .. .
<xsl:value-of select="title"/>
- - title . @ - .
6. sections :
<xsl:template match="sections" mode="global_menu">
</xsl:template>
:
<xsl:apply-templates select="item" mode="global_menu"/>
- item sections . , item item ( sections/item/item ) , .. .
item ( ) . , : <xsl:call-template name="href_attribute"/>
uri- . .
7. ,
, . item :
<xsl:template match="item" mode="global_menu">
<xsl:choose>
<xsl:when test="descendant-or-self::*/@id = /node()/@id">
<xsl:value-of select="title"/>
</xsl:when>
<xsl:otherwise>
<xsl:call-template name="href_attribute"/>
<xsl:value-of select="title"/>
</xsl:otherwise>
</xsl:choose>
</xsl:template>
:
<xsl:choose>
<xsl:when></xsl:when>
<xsl:otherwise></xsl:otherwise>
</xsl:choose>
…, , XML- . : <xsl:when test="descendant-or-self::*/@id = /node()/@id">
ID ( document ) ( item ), , .
<xsl:when></xsl:when>
, . <xsl:otherwise></xsl:otherwise>
- .
8. , href_attribute :
<xsl:template name="href_attribute">
<xsl:attribute name="href">
<xsl:text>/</xsl:text>
<xsl:for-each select="ancestor-or-self::item">
<xsl:value-of select="dir"/>
<xsl:text>/</xsl:text>
</xsl:for-each>
</xsl:attribute>
</xsl:template>
xsl:attribute . . a , , href , .. .
<xsl:for-each select="ancestor-or-self::item">
, . ancestor-or-self::item - . dir , .. -.
, - , . , .
UPD:
. , :
parser.proc.ru/iso/xslt-1.zip
( ) Apache.
XML- /xsl/document.xml
- ( ). :
Lang - . . Id - .
<lang_table>
- , .
- :
- ( ):
<item id="0" parent_id="0" is_published="1" section="1">
- . :
Id - . Parent_id - . Is_published - . Dir - uri- . . Section - . .
- .
CMS : :
Html - . , . Com - -. , CMS: , , ..
XSL- , . .
CMS , :
:
Id - .
Container - - ( ).
Sorting - .
Type - :
Com - -
Html - .
Method - .
Title - .
DTD ( ):
<!DOCTYPE site_page [
<!ENTITY nbsp " ">
<!ENTITY sect "§" >
<!ENTITY copy "©">
<!ENTITY laquo "«">
<!ENTITY reg "®">
<!ENTITY deg "°">
<!ENTITY plusmn "±">
<!ENTITY para "¶">
<!ENTITY raquo "»">
<!ENTITY times "×">
<!ENTITY bull "•">
<!ENTITY hellip "…">
<!ENTITY ndash "–">
<!ENTITY mdash "—">
<!ENTITY lsquo "'">
<!ENTITY rsquo "'">
<!ENTITY sbquo "‚">
<!ENTITY ldquo "“">
<!ENTITY rdquo "”">
<!ENTITY bdquo "„">
<!ENTITY lsaquo "‹">
<!ENTITY rsaquo "›" >
<!ENTITY euro "€">
]>
XML- . <?xml version="1.0" encoding="windows-1251"?>
.
XHML-
XSL- XHTML- ( ). XHTML-, , .
.
XHML- , , :
( ). - , . / .
HTML-:
...
...
...
...
...
XSL-
XSL- :
<xsl:stylesheet version = '1.0' encoding="UTF-8"?>
<xsl:template match="element">
</xsl:template>
</xsl:stylesheet>
: <xsl:stylesheet version = '1.0' encoding="UTF-8"?>
- XML- . UTF-8 ( , ).
<xsl:stylesheet> </xsl:stylesheet>
- XSL-.
<xsl:template match="element"> </xsl:template>
- element.
:
<xsl:template match="element"></xsl:template>
- , element . element . <xsl:template match="element" mode="mode1"></xsl:template>
- , element mode1 . element . <xsl:template name="template-name"></xsl:template>
- template-name . - XML- .
XML- (, XML-, item ), " " :
<xsl:template match="navigation/sections/item"></xsl:template>
, , .., , , , .. navigation , navigation/sections/item sections/item .
, - . , xsl- . .
xsl .
, ( ) :
template_folder - . , my_template . dtd - . . lang - ( ). mod - .
xsl/my_template , layout.xsl :
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE xsl:stylesheet SYSTEM "../dtd/entities.dtd">
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:template match="/node()">
</xsl:template>
</xsl:stylesheet>
:
<xsl:template match="/node()"> </xsl:template>
- /node() (). /node() //document , .. .
XHTML- <xsl:template match="/node()"></xsl:template>
XML- . , XSL- XML- XHTML- .
, XSL template.xsl (, template - ), :
<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:import href=" my_template /layout.xsl"/>
</xsl:stylesheet>
:
<xsl:import href="my_template/layout.xsl"/>
XSL- ( XSL- ) . .
, .. XML- .
- .
, XML- :
<item id="0" parent_id="0" is_published="1" section="1">
/
<item id="1" parent_id="0" is_published="1" section="1" hit="yes">
news
:
id document - id . hit item - , , " ".
, , :
sections - . item - .
, , item item , , :
1. xsl/my_template navigation.xsl :
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE xsl:stylesheet SYSTEM "../dtd/entities.dtd">
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:template match="sections" mode="global_menu">
</xsl:template>
</xsl:stylesheet>
2. layout.xsl :
<xsl:template match="sections" mode="global_menu">
</xsl:template>
3. … layout.xsl :
<xsl:apply-templates select="navigation/sections" mode="global_menu"/>
:
select="navigation/sections" - ( ) - . , navigation/sections .
mode="global_menu" - global_menu . , , , " ", - .
4. , layout.xsl navigation.xsl :
<xsl:import href="navigation.xsl"/>
5. , navigation.xsl , :
<xsl:template match="item" mode="global_menu">
<xsl:call-template name="href_attribute"/>
<xsl:value-of select="title"/>
</xsl:template>
:
<xsl:call-template name="href_attribute"/>
- . , .. .
<xsl:value-of select="title"/>
- - title . @ - .
6. sections :
<xsl:template match="sections" mode="global_menu">
</xsl:template>
:
<xsl:apply-templates select="item" mode="global_menu"/>
- item sections . , item item ( sections/item/item ) , .. .
item ( ) . , : <xsl:call-template name="href_attribute"/>
uri- . .
7. ,
, . item :
<xsl:template match="item" mode="global_menu">
<xsl:choose>
<xsl:when test="descendant-or-self::*/@id = /node()/@id">
<xsl:value-of select="title"/>
</xsl:when>
<xsl:otherwise>
<xsl:call-template name="href_attribute"/>
<xsl:value-of select="title"/>
</xsl:otherwise>
</xsl:choose>
</xsl:template>
:
<xsl:choose>
<xsl:when></xsl:when>
<xsl:otherwise></xsl:otherwise>
</xsl:choose>
…, , XML- . : <xsl:when test="descendant-or-self::*/@id = /node()/@id">
ID ( document ) ( item ), , .
<xsl:when></xsl:when>
, . <xsl:otherwise></xsl:otherwise>
- .
8. , href_attribute :
<xsl:template name="href_attribute">
<xsl:attribute name="href">
<xsl:text>/</xsl:text>
<xsl:for-each select="ancestor-or-self::item">
<xsl:value-of select="dir"/>
<xsl:text>/</xsl:text>
</xsl:for-each>
</xsl:attribute>
</xsl:template>
xsl:attribute . . a , , href , .. .
<xsl:for-each select="ancestor-or-self::item">
, . ancestor-or-self::item - . dir , .. -.
, - , . , .
UPD:
. , :
parser.proc.ru/iso/xslt-1.zip
( ) Apache.
XML- /xsl/document.xml
- ( ). :
Lang - . . Id - .
<lang_table>
- , .
- :
- ( ):
<item id="0" parent_id="0" is_published="1" section="1">
- . :
Id - . Parent_id - . Is_published - . Dir - uri- . . Section - . .
- .
CMS : :
Html - . , . Com - -. , CMS: , , ..
XSL- , . .
CMS , :
:
Id - .
Container - - ( ).
Sorting - .
Type - :
Com - -
Html - .
Method - .
Title - .
DTD ( ):
<!DOCTYPE site_page [
<!ENTITY nbsp " ">
<!ENTITY sect "§" >
<!ENTITY copy "©">
<!ENTITY laquo "«">
<!ENTITY reg "®">
<!ENTITY deg "°">
<!ENTITY plusmn "±">
<!ENTITY para "¶">
<!ENTITY raquo "»">
<!ENTITY times "×">
<!ENTITY bull "•">
<!ENTITY hellip "…">
<!ENTITY ndash "–">
<!ENTITY mdash "—">
<!ENTITY lsquo "'">
<!ENTITY rsquo "'">
<!ENTITY sbquo "‚">
<!ENTITY ldquo "“">
<!ENTITY rdquo "”">
<!ENTITY bdquo "„">
<!ENTITY lsaquo "‹">
<!ENTITY rsaquo "›" >
<!ENTITY euro "€">
]>
XML- . <?xml version="1.0" encoding="windows-1251"?>
.
XHML-
XSL- XHTML- ( ). XHTML-, , .
.
XHML- , , :
( ). - , . / .
HTML-:
...
...
...
...
...
XSL-
XSL- :
<xsl:stylesheet version = '1.0' encoding="UTF-8"?>
<xsl:template match="element">
</xsl:template>
</xsl:stylesheet>
: <xsl:stylesheet version = '1.0' encoding="UTF-8"?>
- XML- . UTF-8 ( , ).
<xsl:stylesheet> </xsl:stylesheet>
- XSL-.
<xsl:template match="element"> </xsl:template>
- element.
:
<xsl:template match="element"></xsl:template>
- , element . element . <xsl:template match="element" mode="mode1"></xsl:template>
- , element mode1 . element . <xsl:template name="template-name"></xsl:template>
- template-name . - XML- .
XML- (, XML-, item ), " " :
<xsl:template match="navigation/sections/item"></xsl:template>
, , .., , , , .. navigation , navigation/sections/item sections/item .
, - . , xsl- . .
xsl .
, ( ) :
template_folder - . , my_template . dtd - . . lang - ( ). mod - .
xsl/my_template , layout.xsl :
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE xsl:stylesheet SYSTEM "../dtd/entities.dtd">
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:template match="/node()">
</xsl:template>
</xsl:stylesheet>
:
<xsl:template match="/node()"> </xsl:template>
- /node() (). /node() //document , .. .
XHTML- <xsl:template match="/node()"></xsl:template>
XML- . , XSL- XML- XHTML- .
, XSL template.xsl (, template - ), :
<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:import href=" my_template /layout.xsl"/>
</xsl:stylesheet>
:
<xsl:import href="my_template/layout.xsl"/>
XSL- ( XSL- ) . .
, .. XML- .
- .
, XML- :
<item id="0" parent_id="0" is_published="1" section="1">
/
<item id="1" parent_id="0" is_published="1" section="1" hit="yes">
news
:
id document - id . hit item - , , " ".
, , :
sections - . item - .
, , item item , , :
1. xsl/my_template navigation.xsl :
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE xsl:stylesheet SYSTEM "../dtd/entities.dtd">
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:template match="sections" mode="global_menu">
</xsl:template>
</xsl:stylesheet>
2. layout.xsl :
<xsl:template match="sections" mode="global_menu">
</xsl:template>
3. … layout.xsl :
<xsl:apply-templates select="navigation/sections" mode="global_menu"/>
:
select="navigation/sections" - ( ) - . , navigation/sections .
mode="global_menu" - global_menu . , , , " ", - .
4. , layout.xsl navigation.xsl :
<xsl:import href="navigation.xsl"/>
5. , navigation.xsl , :
<xsl:template match="item" mode="global_menu">
<xsl:call-template name="href_attribute"/>
<xsl:value-of select="title"/>
</xsl:template>
:
<xsl:call-template name="href_attribute"/>
- . , .. .
<xsl:value-of select="title"/>
- - title . @ - .
6. sections :
<xsl:template match="sections" mode="global_menu">
</xsl:template>
:
<xsl:apply-templates select="item" mode="global_menu"/>
- item sections . , item item ( sections/item/item ) , .. .
item ( ) . , : <xsl:call-template name="href_attribute"/>
uri- . .
7. ,
, . item :
<xsl:template match="item" mode="global_menu">
<xsl:choose>
<xsl:when test="descendant-or-self::*/@id = /node()/@id">
<xsl:value-of select="title"/>
</xsl:when>
<xsl:otherwise>
<xsl:call-template name="href_attribute"/>
<xsl:value-of select="title"/>
</xsl:otherwise>
</xsl:choose>
</xsl:template>
:
<xsl:choose>
<xsl:when></xsl:when>
<xsl:otherwise></xsl:otherwise>
</xsl:choose>
…, , XML- . : <xsl:when test="descendant-or-self::*/@id = /node()/@id">
ID ( document ) ( item ), , .
<xsl:when></xsl:when>
, . <xsl:otherwise></xsl:otherwise>
- .
8. , href_attribute :
<xsl:template name="href_attribute">
<xsl:attribute name="href">
<xsl:text>/</xsl:text>
<xsl:for-each select="ancestor-or-self::item">
<xsl:value-of select="dir"/>
<xsl:text>/</xsl:text>
</xsl:for-each>
</xsl:attribute>
</xsl:template>
xsl:attribute . . a , , href , .. .
<xsl:for-each select="ancestor-or-self::item">
, . ancestor-or-self::item - . dir , .. -.
, - , . , .
UPD:
. , :
parser.proc.ru/iso/xslt-1.zip
( ) Apache.
XML- /xsl/document.xml
- ( ). :
Lang - . . Id - .
<lang_table>
- , .
- :
- ( ):
<item id="0" parent_id="0" is_published="1" section="1">
- . :
Id - . Parent_id - . Is_published - . Dir - uri- . . Section - . .
- .
CMS : :
Html - . , . Com - -. , CMS: , , ..
XSL- , . .
CMS , :
:
Id - .
Container - - ( ).
Sorting - .
Type - :
Com - -
Html - .
Method - .
Title - .
DTD ( ):
<!DOCTYPE site_page [
<!ENTITY nbsp " ">
<!ENTITY sect "§" >
<!ENTITY copy "©">
<!ENTITY laquo "«">
<!ENTITY reg "®">
<!ENTITY deg "°">
<!ENTITY plusmn "±">
<!ENTITY para "¶">
<!ENTITY raquo "»">
<!ENTITY times "×">
<!ENTITY bull "•">
<!ENTITY hellip "…">
<!ENTITY ndash "–">
<!ENTITY mdash "—">
<!ENTITY lsquo "'">
<!ENTITY rsquo "'">
<!ENTITY sbquo "‚">
<!ENTITY ldquo "“">
<!ENTITY rdquo "”">
<!ENTITY bdquo "„">
<!ENTITY lsaquo "‹">
<!ENTITY rsaquo "›" >
<!ENTITY euro "€">
]>
XML- . <?xml version="1.0" encoding="windows-1251"?>
.
XHML-
XSL- XHTML- ( ). XHTML-, , .
.
XHML- , , :
( ). - , . / .
HTML-:
...
...
...
...
...
XSL-
XSL- :
<xsl:stylesheet version = '1.0' encoding="UTF-8"?>
<xsl:template match="element">
</xsl:template>
</xsl:stylesheet>
: <xsl:stylesheet version = '1.0' encoding="UTF-8"?>
- XML- . UTF-8 ( , ).
<xsl:stylesheet> </xsl:stylesheet>
- XSL-.
<xsl:template match="element"> </xsl:template>
- element.
:
<xsl:template match="element"></xsl:template>
- , element . element . <xsl:template match="element" mode="mode1"></xsl:template>
- , element mode1 . element . <xsl:template name="template-name"></xsl:template>
- template-name . - XML- .
XML- (, XML-, item ), " " :
<xsl:template match="navigation/sections/item"></xsl:template>
, , .., , , , .. navigation , navigation/sections/item sections/item .
, - . , xsl- . .
xsl .
, ( ) :
template_folder - . , my_template . dtd - . . lang - ( ). mod - .
xsl/my_template , layout.xsl :
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE xsl:stylesheet SYSTEM "../dtd/entities.dtd">
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:template match="/node()">
</xsl:template>
</xsl:stylesheet>
:
<xsl:template match="/node()"> </xsl:template>
- /node() (). /node() //document , .. .
XHTML- <xsl:template match="/node()"></xsl:template>
XML- . , XSL- XML- XHTML- .
, XSL template.xsl (, template - ), :
<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:import href=" my_template /layout.xsl"/>
</xsl:stylesheet>
:
<xsl:import href="my_template/layout.xsl"/>
XSL- ( XSL- ) . .
, .. XML- .
- .
, XML- :
<item id="0" parent_id="0" is_published="1" section="1">
/
<item id="1" parent_id="0" is_published="1" section="1" hit="yes">
news
:
id document - id . hit item - , , " ".
, , :
sections - . item - .
, , item item , , :
1. xsl/my_template navigation.xsl :
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE xsl:stylesheet SYSTEM "../dtd/entities.dtd">
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:template match="sections" mode="global_menu">
</xsl:template>
</xsl:stylesheet>
2. layout.xsl :
<xsl:template match="sections" mode="global_menu">
</xsl:template>
3. … layout.xsl :
<xsl:apply-templates select="navigation/sections" mode="global_menu"/>
:
select="navigation/sections" - ( ) - . , navigation/sections .
mode="global_menu" - global_menu . , , , " ", - .
4. , layout.xsl navigation.xsl :
<xsl:import href="navigation.xsl"/>
5. , navigation.xsl , :
<xsl:template match="item" mode="global_menu">
<xsl:call-template name="href_attribute"/>
<xsl:value-of select="title"/>
</xsl:template>
:
<xsl:call-template name="href_attribute"/>
- . , .. .
<xsl:value-of select="title"/>
- - title . @ - .
6. sections :
<xsl:template match="sections" mode="global_menu">
</xsl:template>
:
<xsl:apply-templates select="item" mode="global_menu"/>
- item sections . , item item ( sections/item/item ) , .. .
item ( ) . , : <xsl:call-template name="href_attribute"/>
uri- . .
7. ,
, . item :
<xsl:template match="item" mode="global_menu">
<xsl:choose>
<xsl:when test="descendant-or-self::*/@id = /node()/@id">
<xsl:value-of select="title"/>
</xsl:when>
<xsl:otherwise>
<xsl:call-template name="href_attribute"/>
<xsl:value-of select="title"/>
</xsl:otherwise>
</xsl:choose>
</xsl:template>
:
<xsl:choose>
<xsl:when></xsl:when>
<xsl:otherwise></xsl:otherwise>
</xsl:choose>
…, , XML- . : <xsl:when test="descendant-or-self::*/@id = /node()/@id">
ID ( document ) ( item ), , .
<xsl:when></xsl:when>
, . <xsl:otherwise></xsl:otherwise>
- .
8. , href_attribute :
<xsl:template name="href_attribute">
<xsl:attribute name="href">
<xsl:text>/</xsl:text>
<xsl:for-each select="ancestor-or-self::item">
<xsl:value-of select="dir"/>
<xsl:text>/</xsl:text>
</xsl:for-each>
</xsl:attribute>
</xsl:template>
xsl:attribute . . a , , href , .. .
<xsl:for-each select="ancestor-or-self::item">
, . ancestor-or-self::item - . dir , .. -.
, - , . , .
UPD:
. , :
parser.proc.ru/iso/xslt-1.zip
( ) Apache.
XML- /xsl/document.xml
- ( ). :
Lang - . . Id - .
<lang_table>
- , .
- :
- ( ):
<item id="0" parent_id="0" is_published="1" section="1">
- . :
Id - . Parent_id - . Is_published - . Dir - uri- . . Section - . .
- .
CMS : :
Html - . , . Com - -. , CMS: , , ..
XSL- , . .
CMS , :
:
Id - .
Container - - ( ).
Sorting - .
Type - :
Com - -
Html - .
Method - .
Title - .
DTD ( ):
<!DOCTYPE site_page [
<!ENTITY nbsp " ">
<!ENTITY sect "§" >
<!ENTITY copy "©">
<!ENTITY laquo "«">
<!ENTITY reg "®">
<!ENTITY deg "°">
<!ENTITY plusmn "±">
<!ENTITY para "¶">
<!ENTITY raquo "»">
<!ENTITY times "×">
<!ENTITY bull "•">
<!ENTITY hellip "…">
<!ENTITY ndash "–">
<!ENTITY mdash "—">
<!ENTITY lsquo "'">
<!ENTITY rsquo "'">
<!ENTITY sbquo "‚">
<!ENTITY ldquo "“">
<!ENTITY rdquo "”">
<!ENTITY bdquo "„">
<!ENTITY lsaquo "‹">
<!ENTITY rsaquo "›" >
<!ENTITY euro "€">
]>
XML- . <?xml version="1.0" encoding="windows-1251"?>
.
XHML-
XSL- XHTML- ( ). XHTML-, , .
.
XHML- , , :
( ). - , . / .
HTML-:
...
...
...
...
...
XSL-
XSL- :
<xsl:stylesheet version = '1.0' encoding="UTF-8"?>
<xsl:template match="element">
</xsl:template>
</xsl:stylesheet>
: <xsl:stylesheet version = '1.0' encoding="UTF-8"?>
- XML- . UTF-8 ( , ).
<xsl:stylesheet> </xsl:stylesheet>
- XSL-.
<xsl:template match="element"> </xsl:template>
- element.
:
<xsl:template match="element"></xsl:template>
- , element . element . <xsl:template match="element" mode="mode1"></xsl:template>
- , element mode1 . element . <xsl:template name="template-name"></xsl:template>
- template-name . - XML- .
XML- (, XML-, item ), " " :
<xsl:template match="navigation/sections/item"></xsl:template>
, , .., , , , .. navigation , navigation/sections/item sections/item .
, - . , xsl- . .
xsl .
, ( ) :
template_folder - . , my_template . dtd - . . lang - ( ). mod - .
xsl/my_template , layout.xsl :
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE xsl:stylesheet SYSTEM "../dtd/entities.dtd">
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:template match="/node()">
</xsl:template>
</xsl:stylesheet>
:
<xsl:template match="/node()"> </xsl:template>
- /node() (). /node() //document , .. .
XHTML- <xsl:template match="/node()"></xsl:template>
XML- . , XSL- XML- XHTML- .
, XSL template.xsl (, template - ), :
<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:import href=" my_template /layout.xsl"/>
</xsl:stylesheet>
:
<xsl:import href="my_template/layout.xsl"/>
XSL- ( XSL- ) . .
, .. XML- .
- .
, XML- :
<item id="0" parent_id="0" is_published="1" section="1">
/
<item id="1" parent_id="0" is_published="1" section="1" hit="yes">
news
:
id document - id . hit item - , , " ".
, , :
sections - . item - .
, , item item , , :
1. xsl/my_template navigation.xsl :
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE xsl:stylesheet SYSTEM "../dtd/entities.dtd">
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:template match="sections" mode="global_menu">
</xsl:template>
</xsl:stylesheet>
2. layout.xsl :
<xsl:template match="sections" mode="global_menu">
</xsl:template>
3. … layout.xsl :
<xsl:apply-templates select="navigation/sections" mode="global_menu"/>
:
select="navigation/sections" - ( ) - . , navigation/sections .
mode="global_menu" - global_menu . , , , " ", - .
4. , layout.xsl navigation.xsl :
<xsl:import href="navigation.xsl"/>
5. , navigation.xsl , :
<xsl:template match="item" mode="global_menu">
<xsl:call-template name="href_attribute"/>
<xsl:value-of select="title"/>
</xsl:template>
:
<xsl:call-template name="href_attribute"/>
- . , .. .
<xsl:value-of select="title"/>
- - title . @ - .
6. sections :
<xsl:template match="sections" mode="global_menu">
</xsl:template>
:
<xsl:apply-templates select="item" mode="global_menu"/>
- item sections . , item item ( sections/item/item ) , .. .
item ( ) . , : <xsl:call-template name="href_attribute"/>
uri- . .
7. ,
, . item :
<xsl:template match="item" mode="global_menu">
<xsl:choose>
<xsl:when test="descendant-or-self::*/@id = /node()/@id">
<xsl:value-of select="title"/>
</xsl:when>
<xsl:otherwise>
<xsl:call-template name="href_attribute"/>
<xsl:value-of select="title"/>
</xsl:otherwise>
</xsl:choose>
</xsl:template>
:
<xsl:choose>
<xsl:when></xsl:when>
<xsl:otherwise></xsl:otherwise>
</xsl:choose>
…, , XML- . : <xsl:when test="descendant-or-self::*/@id = /node()/@id">
ID ( document ) ( item ), , .
<xsl:when></xsl:when>
, . <xsl:otherwise></xsl:otherwise>
- .
8. , href_attribute :
<xsl:template name="href_attribute">
<xsl:attribute name="href">
<xsl:text>/</xsl:text>
<xsl:for-each select="ancestor-or-self::item">
<xsl:value-of select="dir"/>
<xsl:text>/</xsl:text>
</xsl:for-each>
</xsl:attribute>
</xsl:template>
xsl:attribute . . a , , href , .. .
<xsl:for-each select="ancestor-or-self::item">
, . ancestor-or-self::item - . dir , .. -.
, - , . , .
UPD:
. , :
parser.proc.ru/iso/xslt-1.zip
( ) Apache.
XML- /xsl/document.xml
- ( ). :
Lang - . . Id - .
<lang_table>
- , .
- :
- ( ):
<item id="0" parent_id="0" is_published="1" section="1">
- . :
Id - . Parent_id - . Is_published - . Dir - uri- . . Section - . .
- .
CMS : :
Html - . , . Com - -. , CMS: , , ..
XSL- , . .
CMS , :
:
Id - .
Container - - ( ).
Sorting - .
Type - :
Com - -
Html - .
Method - .
Title - .
DTD ( ):
<!DOCTYPE site_page [
<!ENTITY nbsp " ">
<!ENTITY sect "§" >
<!ENTITY copy "©">
<!ENTITY laquo "«">
<!ENTITY reg "®">
<!ENTITY deg "°">
<!ENTITY plusmn "±">
<!ENTITY para "¶">
<!ENTITY raquo "»">
<!ENTITY times "×">
<!ENTITY bull "•">
<!ENTITY hellip "…">
<!ENTITY ndash "–">
<!ENTITY mdash "—">
<!ENTITY lsquo "'">
<!ENTITY rsquo "'">
<!ENTITY sbquo "‚">
<!ENTITY ldquo "“">
<!ENTITY rdquo "”">
<!ENTITY bdquo "„">
<!ENTITY lsaquo "‹">
<!ENTITY rsaquo "›" >
<!ENTITY euro "€">
]>
XML- . <?xml version="1.0" encoding="windows-1251"?>
.
XHML-
XSL- XHTML- ( ). XHTML-, , .
.
XHML- , , :
( ). - , . / .
HTML-:
...
...
...
...
...
XSL-
XSL- :
<xsl:stylesheet version = '1.0' encoding="UTF-8"?>
<xsl:template match="element">
</xsl:template>
</xsl:stylesheet>
: <xsl:stylesheet version = '1.0' encoding="UTF-8"?>
- XML- . UTF-8 ( , ).
<xsl:stylesheet> </xsl:stylesheet>
- XSL-.
<xsl:template match="element"> </xsl:template>
- element.
:
<xsl:template match="element"></xsl:template>
- , element . element . <xsl:template match="element" mode="mode1"></xsl:template>
- , element mode1 . element . <xsl:template name="template-name"></xsl:template>
- template-name . - XML- .
XML- (, XML-, item ), " " :
<xsl:template match="navigation/sections/item"></xsl:template>
, , .., , , , .. navigation , navigation/sections/item sections/item .
, - . , xsl- . .
xsl .
, ( ) :
template_folder - . , my_template . dtd - . . lang - ( ). mod - .
xsl/my_template , layout.xsl :
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE xsl:stylesheet SYSTEM "../dtd/entities.dtd">
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:template match="/node()">
</xsl:template>
</xsl:stylesheet>
:
<xsl:template match="/node()"> </xsl:template>
- /node() (). /node() //document , .. .
XHTML- <xsl:template match="/node()"></xsl:template>
XML- . , XSL- XML- XHTML- .
, XSL template.xsl (, template - ), :
<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:import href=" my_template /layout.xsl"/>
</xsl:stylesheet>
:
<xsl:import href="my_template/layout.xsl"/>
XSL- ( XSL- ) . .
, .. XML- .
- .
, XML- :
<item id="0" parent_id="0" is_published="1" section="1">
/
<item id="1" parent_id="0" is_published="1" section="1" hit="yes">
news
:
id document - id . hit item - , , " ".
, , :
sections - . item - .
, , item item , , :
1. xsl/my_template navigation.xsl :
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE xsl:stylesheet SYSTEM "../dtd/entities.dtd">
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:template match="sections" mode="global_menu">
</xsl:template>
</xsl:stylesheet>
2. layout.xsl :
<xsl:template match="sections" mode="global_menu">
</xsl:template>
3. … layout.xsl :
<xsl:apply-templates select="navigation/sections" mode="global_menu"/>
:
select="navigation/sections" - ( ) - . , navigation/sections .
mode="global_menu" - global_menu . , , , " ", - .
4. , layout.xsl navigation.xsl :
<xsl:import href="navigation.xsl"/>
5. , navigation.xsl , :
<xsl:template match="item" mode="global_menu">
<xsl:call-template name="href_attribute"/>
<xsl:value-of select="title"/>
</xsl:template>
:
<xsl:call-template name="href_attribute"/>
- . , .. .
<xsl:value-of select="title"/>
- - title . @ - .
6. sections :
<xsl:template match="sections" mode="global_menu">
</xsl:template>
:
<xsl:apply-templates select="item" mode="global_menu"/>
- item sections . , item item ( sections/item/item ) , .. .
item ( ) . , : <xsl:call-template name="href_attribute"/>
uri- . .
7. ,
, . item :
<xsl:template match="item" mode="global_menu">
<xsl:choose>
<xsl:when test="descendant-or-self::*/@id = /node()/@id">
<xsl:value-of select="title"/>
</xsl:when>
<xsl:otherwise>
<xsl:call-template name="href_attribute"/>
<xsl:value-of select="title"/>
</xsl:otherwise>
</xsl:choose>
</xsl:template>
:
<xsl:choose>
<xsl:when></xsl:when>
<xsl:otherwise></xsl:otherwise>
</xsl:choose>
…, , XML- . : <xsl:when test="descendant-or-self::*/@id = /node()/@id">
ID ( document ) ( item ), , .
<xsl:when></xsl:when>
, . <xsl:otherwise></xsl:otherwise>
- .
8. , href_attribute :
<xsl:template name="href_attribute">
<xsl:attribute name="href">
<xsl:text>/</xsl:text>
<xsl:for-each select="ancestor-or-self::item">
<xsl:value-of select="dir"/>
<xsl:text>/</xsl:text>
</xsl:for-each>
</xsl:attribute>
</xsl:template>
xsl:attribute . . a , , href , .. .
<xsl:for-each select="ancestor-or-self::item">
, . ancestor-or-self::item - . dir , .. -.
, - , . , .
UPD:
. , :
parser.proc.ru/iso/xslt-1.zip
( ) Apache.
XML- /xsl/document.xml
- ( ). :
Lang - . . Id - .
<lang_table>
- , .
- :
- ( ):
<item id="0" parent_id="0" is_published="1" section="1">
- . :
Id - . Parent_id - . Is_published - . Dir - uri- . . Section - . .
- .
CMS : :
Html - . , . Com - -. , CMS: , , ..
XSL- , . .
CMS , :
:
Id - .
Container - - ( ).
Sorting - .
Type - :
Com - -
Html - .
Method - .
Title - .
DTD ( ):
<!DOCTYPE site_page [
<!ENTITY nbsp " ">
<!ENTITY sect "§" >
<!ENTITY copy "©">
<!ENTITY laquo "«">
<!ENTITY reg "®">
<!ENTITY deg "°">
<!ENTITY plusmn "±">
<!ENTITY para "¶">
<!ENTITY raquo "»">
<!ENTITY times "×">
<!ENTITY bull "•">
<!ENTITY hellip "…">
<!ENTITY ndash "–">
<!ENTITY mdash "—">
<!ENTITY lsquo "'">
<!ENTITY rsquo "'">
<!ENTITY sbquo "‚">
<!ENTITY ldquo "“">
<!ENTITY rdquo "”">
<!ENTITY bdquo "„">
<!ENTITY lsaquo "‹">
<!ENTITY rsaquo "›" >
<!ENTITY euro "€">
]>
XML- . <?xml version="1.0" encoding="windows-1251"?>
.
XHML-
XSL- XHTML- ( ). XHTML-, , .
.
XHML- , , :
( ). - , . / .
HTML-:
...
...
...
...
...
XSL-
XSL- :
<xsl:stylesheet version = '1.0' encoding="UTF-8"?>
<xsl:template match="element">
</xsl:template>
</xsl:stylesheet>
: <xsl:stylesheet version = '1.0' encoding="UTF-8"?>
- XML- . UTF-8 ( , ).
<xsl:stylesheet> </xsl:stylesheet>
- XSL-.
<xsl:template match="element"> </xsl:template>
- element.
:
<xsl:template match="element"></xsl:template>
- , element . element . <xsl:template match="element" mode="mode1"></xsl:template>
- , element mode1 . element . <xsl:template name="template-name"></xsl:template>
- template-name . - XML- .
XML- (, XML-, item ), " " :
<xsl:template match="navigation/sections/item"></xsl:template>
, , .., , , , .. navigation , navigation/sections/item sections/item .
, - . , xsl- . .
xsl .
, ( ) :
template_folder - . , my_template . dtd - . . lang - ( ). mod - .
xsl/my_template , layout.xsl :
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE xsl:stylesheet SYSTEM "../dtd/entities.dtd">
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:template match="/node()">
</xsl:template>
</xsl:stylesheet>
:
<xsl:template match="/node()"> </xsl:template>
- /node() (). /node() //document , .. .
XHTML- <xsl:template match="/node()"></xsl:template>
XML- . , XSL- XML- XHTML- .
, XSL template.xsl (, template - ), :
<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:import href=" my_template /layout.xsl"/>
</xsl:stylesheet>
:
<xsl:import href="my_template/layout.xsl"/>
XSL- ( XSL- ) . .
, .. XML- .
- .
, XML- :
<item id="0" parent_id="0" is_published="1" section="1">
/
<item id="1" parent_id="0" is_published="1" section="1" hit="yes">
news
:
id document - id . hit item - , , " ".
, , :
sections - . item - .
, , item item , , :
1. xsl/my_template navigation.xsl :
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE xsl:stylesheet SYSTEM "../dtd/entities.dtd">
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:template match="sections" mode="global_menu">
</xsl:template>
</xsl:stylesheet>
2. layout.xsl :
<xsl:template match="sections" mode="global_menu">
</xsl:template>
3. … layout.xsl :
<xsl:apply-templates select="navigation/sections" mode="global_menu"/>
:
select="navigation/sections" - ( ) - . , navigation/sections .
mode="global_menu" - global_menu . , , , " ", - .
4. , layout.xsl navigation.xsl :
<xsl:import href="navigation.xsl"/>
5. , navigation.xsl , :
<xsl:template match="item" mode="global_menu">
<xsl:call-template name="href_attribute"/>
<xsl:value-of select="title"/>
</xsl:template>
:
<xsl:call-template name="href_attribute"/>
- . , .. .
<xsl:value-of select="title"/>
- - title . @ - .
6. sections :
<xsl:template match="sections" mode="global_menu">
</xsl:template>
:
<xsl:apply-templates select="item" mode="global_menu"/>
- item sections . , item item ( sections/item/item ) , .. .
item ( ) . , : <xsl:call-template name="href_attribute"/>
uri- . .
7. ,
, . item :
<xsl:template match="item" mode="global_menu">
<xsl:choose>
<xsl:when test="descendant-or-self::*/@id = /node()/@id">
<xsl:value-of select="title"/>
</xsl:when>
<xsl:otherwise>
<xsl:call-template name="href_attribute"/>
<xsl:value-of select="title"/>
</xsl:otherwise>
</xsl:choose>
</xsl:template>
:
<xsl:choose>
<xsl:when></xsl:when>
<xsl:otherwise></xsl:otherwise>
</xsl:choose>
…, , XML- . : <xsl:when test="descendant-or-self::*/@id = /node()/@id">
ID ( document ) ( item ), , .
<xsl:when></xsl:when>
, . <xsl:otherwise></xsl:otherwise>
- .
8. , href_attribute :
<xsl:template name="href_attribute">
<xsl:attribute name="href">
<xsl:text>/</xsl:text>
<xsl:for-each select="ancestor-or-self::item">
<xsl:value-of select="dir"/>
<xsl:text>/</xsl:text>
</xsl:for-each>
</xsl:attribute>
</xsl:template>
xsl:attribute . . a , , href , .. .
<xsl:for-each select="ancestor-or-self::item">
, . ancestor-or-self::item - . dir , .. -.
, - , . , .
UPD:
. , :
parser.proc.ru/iso/xslt-1.zip
( ) Apache.
XML- /xsl/document.xml
- ( ). :
Lang - . . Id - .
<lang_table>
- , .
- :
- ( ):
<item id="0" parent_id="0" is_published="1" section="1">
- . :
Id - . Parent_id - . Is_published - . Dir - uri- . . Section - . .
- .
CMS : :
Html - . , . Com - -. , CMS: , , ..
XSL- , . .
CMS , :
:
Id - .
Container - - ( ).
Sorting - .
Type - :
Com - -
Html - .
Method - .
Title - .
DTD ( ):
<!DOCTYPE site_page [
<!ENTITY nbsp " ">
<!ENTITY sect "§" >
<!ENTITY copy "©">
<!ENTITY laquo "«">
<!ENTITY reg "®">
<!ENTITY deg "°">
<!ENTITY plusmn "±">
<!ENTITY para "¶">
<!ENTITY raquo "»">
<!ENTITY times "×">
<!ENTITY bull "•">
<!ENTITY hellip "…">
<!ENTITY ndash "–">
<!ENTITY mdash "—">
<!ENTITY lsquo "'">
<!ENTITY rsquo "'">
<!ENTITY sbquo "‚">
<!ENTITY ldquo "“">
<!ENTITY rdquo "”">
<!ENTITY bdquo "„">
<!ENTITY lsaquo "‹">
<!ENTITY rsaquo "›" >
<!ENTITY euro "€">
]>
XML- . <?xml version="1.0" encoding="windows-1251"?>
.
XHML-
XSL- XHTML- ( ). XHTML-, , .
.
XHML- , , :
( ). - , . / .
HTML-:
...
...
...
...
...
XSL-
XSL- :
<xsl:stylesheet version = '1.0' encoding="UTF-8"?>
<xsl:template match="element">
</xsl:template>
</xsl:stylesheet>
: <xsl:stylesheet version = '1.0' encoding="UTF-8"?>
- XML- . UTF-8 ( , ).
<xsl:stylesheet> </xsl:stylesheet>
- XSL-.
<xsl:template match="element"> </xsl:template>
- element.
:
<xsl:template match="element"></xsl:template>
- , element . element . <xsl:template match="element" mode="mode1"></xsl:template>
- , element mode1 . element . <xsl:template name="template-name"></xsl:template>
- template-name . - XML- .
XML- (, XML-, item ), " " :
<xsl:template match="navigation/sections/item"></xsl:template>
, , .., , , , .. navigation , navigation/sections/item sections/item .
, - . , xsl- . .
xsl .
, ( ) :
template_folder - . , my_template . dtd - . . lang - ( ). mod - .
xsl/my_template , layout.xsl :
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE xsl:stylesheet SYSTEM "../dtd/entities.dtd">
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:template match="/node()">
</xsl:template>
</xsl:stylesheet>
:
<xsl:template match="/node()"> </xsl:template>
- /node() (). /node() //document , .. .
XHTML- <xsl:template match="/node()"></xsl:template>
XML- . , XSL- XML- XHTML- .
, XSL template.xsl (, template - ), :
<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:import href=" my_template /layout.xsl"/>
</xsl:stylesheet>
:
<xsl:import href="my_template/layout.xsl"/>
XSL- ( XSL- ) . .
, .. XML- .
- .
, XML- :
<item id="0" parent_id="0" is_published="1" section="1">
/
<item id="1" parent_id="0" is_published="1" section="1" hit="yes">
news
:
id document - id . hit item - , , " ".
, , :
sections - . item - .
, , item item , , :
1. xsl/my_template navigation.xsl :
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE xsl:stylesheet SYSTEM "../dtd/entities.dtd">
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:template match="sections" mode="global_menu">
</xsl:template>
</xsl:stylesheet>
2. layout.xsl :
<xsl:template match="sections" mode="global_menu">
</xsl:template>
3. … layout.xsl :
<xsl:apply-templates select="navigation/sections" mode="global_menu"/>
:
select="navigation/sections" - ( ) - . , navigation/sections .
mode="global_menu" - global_menu . , , , " ", - .
4. , layout.xsl navigation.xsl :
<xsl:import href="navigation.xsl"/>
5. , navigation.xsl , :
<xsl:template match="item" mode="global_menu">
<xsl:call-template name="href_attribute"/>
<xsl:value-of select="title"/>
</xsl:template>
:
<xsl:call-template name="href_attribute"/>
- . , .. .
<xsl:value-of select="title"/>
- - title . @ - .
6. sections :
<xsl:template match="sections" mode="global_menu">
</xsl:template>
:
<xsl:apply-templates select="item" mode="global_menu"/>
- item sections . , item item ( sections/item/item ) , .. .
item ( ) . , : <xsl:call-template name="href_attribute"/>
uri- . .
7. ,
, . item :
<xsl:template match="item" mode="global_menu">
<xsl:choose>
<xsl:when test="descendant-or-self::*/@id = /node()/@id">
<xsl:value-of select="title"/>
</xsl:when>
<xsl:otherwise>
<xsl:call-template name="href_attribute"/>
<xsl:value-of select="title"/>
</xsl:otherwise>
</xsl:choose>
</xsl:template>
:
<xsl:choose>
<xsl:when></xsl:when>
<xsl:otherwise></xsl:otherwise>
</xsl:choose>
…, , XML- . : <xsl:when test="descendant-or-self::*/@id = /node()/@id">
ID ( document ) ( item ), , .
<xsl:when></xsl:when>
, . <xsl:otherwise></xsl:otherwise>
- .
8. , href_attribute :
<xsl:template name="href_attribute">
<xsl:attribute name="href">
<xsl:text>/</xsl:text>
<xsl:for-each select="ancestor-or-self::item">
<xsl:value-of select="dir"/>
<xsl:text>/</xsl:text>
</xsl:for-each>
</xsl:attribute>
</xsl:template>
xsl:attribute . . a , , href , .. .
<xsl:for-each select="ancestor-or-self::item">
, . ancestor-or-self::item - . dir , .. -.
, - , . , .
UPD:
. , :
parser.proc.ru/iso/xslt-1.zip
( ) Apache.
XML- /xsl/document.xml
- ( ). :
Lang - . . Id - .
<lang_table>
- , .
- :
- ( ):
<item id="0" parent_id="0" is_published="1" section="1">
- . :
Id - . Parent_id - . Is_published - . Dir - uri- . . Section - . .
- .
CMS : :
Html - . , . Com - -. , CMS: , , ..
XSL- , . .
CMS , :
:
Id - .
Container - - ( ).
Sorting - .
Type - :
Com - -
Html - .
Method - .
Title - .
DTD ( ):
<!DOCTYPE site_page [
<!ENTITY nbsp " ">
<!ENTITY sect "§" >
<!ENTITY copy "©">
<!ENTITY laquo "«">
<!ENTITY reg "®">
<!ENTITY deg "°">
<!ENTITY plusmn "±">
<!ENTITY para "¶">
<!ENTITY raquo "»">
<!ENTITY times "×">
<!ENTITY bull "•">
<!ENTITY hellip "…">
<!ENTITY ndash "–">
<!ENTITY mdash "—">
<!ENTITY lsquo "'">
<!ENTITY rsquo "'">
<!ENTITY sbquo "‚">
<!ENTITY ldquo "“">
<!ENTITY rdquo "”">
<!ENTITY bdquo "„">
<!ENTITY lsaquo "‹">
<!ENTITY rsaquo "›" >
<!ENTITY euro "€">
]>
XML- . <?xml version="1.0" encoding="windows-1251"?>
.
XHML-
XSL- XHTML- ( ). XHTML-, , .
.
XHML- , , :
( ). - , . / .
HTML-:
...
...
...
...
...
XSL-
XSL- :
<xsl:stylesheet version = '1.0' encoding="UTF-8"?>
<xsl:template match="element">
</xsl:template>
</xsl:stylesheet>
: <xsl:stylesheet version = '1.0' encoding="UTF-8"?>
- XML- . UTF-8 ( , ).
<xsl:stylesheet> </xsl:stylesheet>
- XSL-.
<xsl:template match="element"> </xsl:template>
- element.
:
<xsl:template match="element"></xsl:template>
- , element . element . <xsl:template match="element" mode="mode1"></xsl:template>
- , element mode1 . element . <xsl:template name="template-name"></xsl:template>
- template-name . - XML- .
XML- (, XML-, item ), " " :
<xsl:template match="navigation/sections/item"></xsl:template>
, , .., , , , .. navigation , navigation/sections/item sections/item .
, - . , xsl- . .
xsl .
, ( ) :
template_folder - . , my_template . dtd - . . lang - ( ). mod - .
xsl/my_template , layout.xsl :
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE xsl:stylesheet SYSTEM "../dtd/entities.dtd">
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:template match="/node()">
</xsl:template>
</xsl:stylesheet>
:
<xsl:template match="/node()"> </xsl:template>
- /node() (). /node() //document , .. .
XHTML- <xsl:template match="/node()"></xsl:template>
XML- . , XSL- XML- XHTML- .
, XSL template.xsl (, template - ), :
<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:import href=" my_template /layout.xsl"/>
</xsl:stylesheet>
:
<xsl:import href="my_template/layout.xsl"/>
XSL- ( XSL- ) . .
, .. XML- .
- .
, XML- :
<item id="0" parent_id="0" is_published="1" section="1">
/
<item id="1" parent_id="0" is_published="1" section="1" hit="yes">
news
:
id document - id . hit item - , , " ".
, , :
sections - . item - .
, , item item , , :
1. xsl/my_template navigation.xsl :
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE xsl:stylesheet SYSTEM "../dtd/entities.dtd">
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:template match="sections" mode="global_menu">
</xsl:template>
</xsl:stylesheet>
2. layout.xsl :
<xsl:template match="sections" mode="global_menu">
</xsl:template>
3. … layout.xsl :
<xsl:apply-templates select="navigation/sections" mode="global_menu"/>
:
select="navigation/sections" - ( ) - . , navigation/sections .
mode="global_menu" - global_menu . , , , " ", - .
4. , layout.xsl navigation.xsl :
<xsl:import href="navigation.xsl"/>
5. , navigation.xsl , :
<xsl:template match="item" mode="global_menu">
<xsl:call-template name="href_attribute"/>
<xsl:value-of select="title"/>
</xsl:template>
:
<xsl:call-template name="href_attribute"/>
- . , .. .
<xsl:value-of select="title"/>
- - title . @ - .
6. sections :
<xsl:template match="sections" mode="global_menu">
</xsl:template>
:
<xsl:apply-templates select="item" mode="global_menu"/>
- item sections . , item item ( sections/item/item ) , .. .
item ( ) . , : <xsl:call-template name="href_attribute"/>
uri- . .
7. ,
, . item :
<xsl:template match="item" mode="global_menu">
<xsl:choose>
<xsl:when test="descendant-or-self::*/@id = /node()/@id">
<xsl:value-of select="title"/>
</xsl:when>
<xsl:otherwise>
<xsl:call-template name="href_attribute"/>
<xsl:value-of select="title"/>
</xsl:otherwise>
</xsl:choose>
</xsl:template>
:
<xsl:choose>
<xsl:when></xsl:when>
<xsl:otherwise></xsl:otherwise>
</xsl:choose>
…, , XML- . : <xsl:when test="descendant-or-self::*/@id = /node()/@id">
ID ( document ) ( item ), , .
<xsl:when></xsl:when>
, . <xsl:otherwise></xsl:otherwise>
- .
8. , href_attribute :
<xsl:template name="href_attribute">
<xsl:attribute name="href">
<xsl:text>/</xsl:text>
<xsl:for-each select="ancestor-or-self::item">
<xsl:value-of select="dir"/>
<xsl:text>/</xsl:text>
</xsl:for-each>
</xsl:attribute>
</xsl:template>
xsl:attribute . . a , , href , .. .
<xsl:for-each select="ancestor-or-self::item">
, . ancestor-or-self::item - . dir , .. -.
, - , . , .
UPD:
. , :
parser.proc.ru/iso/xslt-1.zip
( ) Apache.
XML- /xsl/document.xml
- ( ). :
Lang - . . Id - .
<lang_table>
- , .
- :
- ( ):
<item id="0" parent_id="0" is_published="1" section="1">
- . :
Id - . Parent_id - . Is_published - . Dir - uri- . . Section - . .
- .
CMS : :
Html - . , . Com - -. , CMS: , , ..
XSL- , . .
CMS , :
:
Id - .
Container - - ( ).
Sorting - .
Type - :
Com - -
Html - .
Method - .
Title - .
DTD ( ):
<!DOCTYPE site_page [
<!ENTITY nbsp " ">
<!ENTITY sect "§" >
<!ENTITY copy "©">
<!ENTITY laquo "«">
<!ENTITY reg "®">
<!ENTITY deg "°">
<!ENTITY plusmn "±">
<!ENTITY para "¶">
<!ENTITY raquo "»">
<!ENTITY times "×">
<!ENTITY bull "•">
<!ENTITY hellip "…">
<!ENTITY ndash "–">
<!ENTITY mdash "—">
<!ENTITY lsquo "'">
<!ENTITY rsquo "'">
<!ENTITY sbquo "‚">
<!ENTITY ldquo "“">
<!ENTITY rdquo "”">
<!ENTITY bdquo "„">
<!ENTITY lsaquo "‹">
<!ENTITY rsaquo "›" >
<!ENTITY euro "€">
]>
XML- . <?xml version="1.0" encoding="windows-1251"?>
.
XHML-
XSL- XHTML- ( ). XHTML-, , .
.
XHML- , , :
( ). - , . / .
HTML-:
...
...
...
...
...
XSL-
XSL- :
<xsl:stylesheet version = '1.0' encoding="UTF-8"?>
<xsl:template match="element">
</xsl:template>
</xsl:stylesheet>
: <xsl:stylesheet version = '1.0' encoding="UTF-8"?>
- XML- . UTF-8 ( , ).
<xsl:stylesheet> </xsl:stylesheet>
- XSL-.
<xsl:template match="element"> </xsl:template>
- element.
:
<xsl:template match="element"></xsl:template>
- , element . element . <xsl:template match="element" mode="mode1"></xsl:template>
- , element mode1 . element . <xsl:template name="template-name"></xsl:template>
- template-name . - XML- .
XML- (, XML-, item ), " " :
<xsl:template match="navigation/sections/item"></xsl:template>
, , .., , , , .. navigation , navigation/sections/item sections/item .
, - . , xsl- . .
xsl .
, ( ) :
template_folder - . , my_template . dtd - . . lang - ( ). mod - .
xsl/my_template , layout.xsl :
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE xsl:stylesheet SYSTEM "../dtd/entities.dtd">
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:template match="/node()">
</xsl:template>
</xsl:stylesheet>
:
<xsl:template match="/node()"> </xsl:template>
- /node() (). /node() //document , .. .
XHTML- <xsl:template match="/node()"></xsl:template>
XML- . , XSL- XML- XHTML- .
, XSL template.xsl (, template - ), :
<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:import href=" my_template /layout.xsl"/>
</xsl:stylesheet>
:
<xsl:import href="my_template/layout.xsl"/>
XSL- ( XSL- ) . .
, .. XML- .
- .
, XML- :
<item id="0" parent_id="0" is_published="1" section="1">
/
<item id="1" parent_id="0" is_published="1" section="1" hit="yes">
news
:
id document - id . hit item - , , " ".
, , :
sections - . item - .
, , item item , , :
1. xsl/my_template navigation.xsl :
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE xsl:stylesheet SYSTEM "../dtd/entities.dtd">
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:template match="sections" mode="global_menu">
</xsl:template>
</xsl:stylesheet>
2. layout.xsl :
<xsl:template match="sections" mode="global_menu">
</xsl:template>
3. … layout.xsl :
<xsl:apply-templates select="navigation/sections" mode="global_menu"/>
:
select="navigation/sections" - ( ) - . , navigation/sections .
mode="global_menu" - global_menu . , , , " ", - .
4. , layout.xsl navigation.xsl :
<xsl:import href="navigation.xsl"/>
5. , navigation.xsl , :
<xsl:template match="item" mode="global_menu">
<xsl:call-template name="href_attribute"/>
<xsl:value-of select="title"/>
</xsl:template>
:
<xsl:call-template name="href_attribute"/>
- . , .. .
<xsl:value-of select="title"/>
- - title . @ - .
6. sections :
<xsl:template match="sections" mode="global_menu">
</xsl:template>
:
<xsl:apply-templates select="item" mode="global_menu"/>
- item sections . , item item ( sections/item/item ) , .. .
item ( ) . , : <xsl:call-template name="href_attribute"/>
uri- . .
7. ,
, . item :
<xsl:template match="item" mode="global_menu">
<xsl:choose>
<xsl:when test="descendant-or-self::*/@id = /node()/@id">
<xsl:value-of select="title"/>
</xsl:when>
<xsl:otherwise>
<xsl:call-template name="href_attribute"/>
<xsl:value-of select="title"/>
</xsl:otherwise>
</xsl:choose>
</xsl:template>
:
<xsl:choose>
<xsl:when></xsl:when>
<xsl:otherwise></xsl:otherwise>
</xsl:choose>
…, , XML- . : <xsl:when test="descendant-or-self::*/@id = /node()/@id">
ID ( document ) ( item ), , .
<xsl:when></xsl:when>
, . <xsl:otherwise></xsl:otherwise>
- .
8. , href_attribute :
<xsl:template name="href_attribute">
<xsl:attribute name="href">
<xsl:text>/</xsl:text>
<xsl:for-each select="ancestor-or-self::item">
<xsl:value-of select="dir"/>
<xsl:text>/</xsl:text>
</xsl:for-each>
</xsl:attribute>
</xsl:template>
xsl:attribute . . a , , href , .. .
<xsl:for-each select="ancestor-or-self::item">
, . ancestor-or-self::item - . dir , .. -.
, - , . , .
UPD:
. , :
parser.proc.ru/iso/xslt-1.zip
( ) Apache.
XML- /xsl/document.xml
- ( ). :
Lang - . . Id - .
<lang_table>
- , .
- :
- ( ):
<item id="0" parent_id="0" is_published="1" section="1">
- . :
Id - . Parent_id - . Is_published - . Dir - uri- . . Section - . .
- .
CMS : :
Html - . , . Com - -. , CMS: , , ..
XSL- , . .
CMS , :
:
Id - .
Container - - ( ).
Sorting - .
Type - :
Com - -
Html - .
Method - .
Title - .
DTD ( ):
<!DOCTYPE site_page [
<!ENTITY nbsp " ">
<!ENTITY sect "§" >
<!ENTITY copy "©">
<!ENTITY laquo "«">
<!ENTITY reg "®">
<!ENTITY deg "°">
<!ENTITY plusmn "±">
<!ENTITY para "¶">
<!ENTITY raquo "»">
<!ENTITY times "×">
<!ENTITY bull "•">
<!ENTITY hellip "…">
<!ENTITY ndash "–">
<!ENTITY mdash "—">
<!ENTITY lsquo "'">
<!ENTITY rsquo "'">
<!ENTITY sbquo "‚">
<!ENTITY ldquo "“">
<!ENTITY rdquo "”">
<!ENTITY bdquo "„">
<!ENTITY lsaquo "‹">
<!ENTITY rsaquo "›" >
<!ENTITY euro "€">
]>
XML- . <?xml version="1.0" encoding="windows-1251"?>
.
XHML-
XSL- XHTML- ( ). XHTML-, , .
.
XHML- , , :
( ). - , . / .
HTML-:
...
...
...
...
...
XSL-
XSL- :
<xsl:stylesheet version = '1.0' encoding="UTF-8"?>
<xsl:template match="element">
</xsl:template>
</xsl:stylesheet>
: <xsl:stylesheet version = '1.0' encoding="UTF-8"?>
- XML- . UTF-8 ( , ).
<xsl:stylesheet> </xsl:stylesheet>
- XSL-.
<xsl:template match="element"> </xsl:template>
- element.
:
<xsl:template match="element"></xsl:template>
- , element . element . <xsl:template match="element" mode="mode1"></xsl:template>
- , element mode1 . element . <xsl:template name="template-name"></xsl:template>
- template-name . - XML- .
XML- (, XML-, item ), " " :
<xsl:template match="navigation/sections/item"></xsl:template>
, , .., , , , .. navigation , navigation/sections/item sections/item .
, - . , xsl- . .
xsl .
, ( ) :
template_folder - . , my_template . dtd - . . lang - ( ). mod - .
xsl/my_template , layout.xsl :
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE xsl:stylesheet SYSTEM "../dtd/entities.dtd">
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:template match="/node()">
</xsl:template>
</xsl:stylesheet>
:
<xsl:template match="/node()"> </xsl:template>
- /node() (). /node() //document , .. .
XHTML- <xsl:template match="/node()"></xsl:template>
XML- . , XSL- XML- XHTML- .
, XSL template.xsl (, template - ), :
<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:import href=" my_template /layout.xsl"/>
</xsl:stylesheet>
:
<xsl:import href="my_template/layout.xsl"/>
XSL- ( XSL- ) . .
, .. XML- .
- .
, XML- :
<item id="0" parent_id="0" is_published="1" section="1">
/
<item id="1" parent_id="0" is_published="1" section="1" hit="yes">
news
:
id document - id . hit item - , , " ".
, , :
sections - . item - .
, , item item , , :
1. xsl/my_template navigation.xsl :
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE xsl:stylesheet SYSTEM "../dtd/entities.dtd">
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:template match="sections" mode="global_menu">
</xsl:template>
</xsl:stylesheet>
2. layout.xsl :
<xsl:template match="sections" mode="global_menu">
</xsl:template>
3. … layout.xsl :
<xsl:apply-templates select="navigation/sections" mode="global_menu"/>
:
select="navigation/sections" - ( ) - . , navigation/sections .
mode="global_menu" - global_menu . , , , " ", - .
4. , layout.xsl navigation.xsl :
<xsl:import href="navigation.xsl"/>
5. , navigation.xsl , :
<xsl:template match="item" mode="global_menu">
<xsl:call-template name="href_attribute"/>
<xsl:value-of select="title"/>
</xsl:template>
:
<xsl:call-template name="href_attribute"/>
- . , .. .
<xsl:value-of select="title"/>
- - title . @ - .
6. sections :
<xsl:template match="sections" mode="global_menu">
</xsl:template>
:
<xsl:apply-templates select="item" mode="global_menu"/>
- item sections . , item item ( sections/item/item ) , .. .
item ( ) . , : <xsl:call-template name="href_attribute"/>
uri- . .
7. ,
, . item :
<xsl:template match="item" mode="global_menu">
<xsl:choose>
<xsl:when test="descendant-or-self::*/@id = /node()/@id">
<xsl:value-of select="title"/>
</xsl:when>
<xsl:otherwise>
<xsl:call-template name="href_attribute"/>
<xsl:value-of select="title"/>
</xsl:otherwise>
</xsl:choose>
</xsl:template>
:
<xsl:choose>
<xsl:when></xsl:when>
<xsl:otherwise></xsl:otherwise>
</xsl:choose>
…, , XML- . : <xsl:when test="descendant-or-self::*/@id = /node()/@id">
ID ( document ) ( item ), , .
<xsl:when></xsl:when>
, . <xsl:otherwise></xsl:otherwise>
- .
8. , href_attribute :
<xsl:template name="href_attribute">
<xsl:attribute name="href">
<xsl:text>/</xsl:text>
<xsl:for-each select="ancestor-or-self::item">
<xsl:value-of select="dir"/>
<xsl:text>/</xsl:text>
</xsl:for-each>
</xsl:attribute>
</xsl:template>
xsl:attribute . . a , , href , .. .
<xsl:for-each select="ancestor-or-self::item">
, . ancestor-or-self::item - . dir , .. -.
, - , . , .
UPD:
. , :
parser.proc.ru/iso/xslt-1.zip
( ) Apache.
XML- /xsl/document.xml
- ( ). :
Lang - . . Id - .
<lang_table>
- , .
- :
- ( ):
<item id="0" parent_id="0" is_published="1" section="1">
- . :
Id - . Parent_id - . Is_published - . Dir - uri- . . Section - . .
- .
CMS : :
Html - . , . Com - -. , CMS: , , ..
XSL- , . .
CMS , :
:
Id - .
Container - - ( ).
Sorting - .
Type - :
Com - -
Html - .
Method - .
Title - .
DTD ( ):
<!DOCTYPE site_page [
<!ENTITY nbsp " ">
<!ENTITY sect "§" >
<!ENTITY copy "©">
<!ENTITY laquo "«">
<!ENTITY reg "®">
<!ENTITY deg "°">
<!ENTITY plusmn "±">
<!ENTITY para "¶">
<!ENTITY raquo "»">
<!ENTITY times "×">
<!ENTITY bull "•">
<!ENTITY hellip "…">
<!ENTITY ndash "–">
<!ENTITY mdash "—">
<!ENTITY lsquo "'">
<!ENTITY rsquo "'">
<!ENTITY sbquo "‚">
<!ENTITY ldquo "“">
<!ENTITY rdquo "”">
<!ENTITY bdquo "„">
<!ENTITY lsaquo "‹">
<!ENTITY rsaquo "›" >
<!ENTITY euro "€">
]>
XML- . <?xml version="1.0" encoding="windows-1251"?>
.
XHML-
XSL- XHTML- ( ). XHTML-, , .
.
XHML- , , :
( ). - , . / .
HTML-:
...
...
...
...
...
XSL-
XSL- :
<xsl:stylesheet version = '1.0' encoding="UTF-8"?>
<xsl:template match="element">
</xsl:template>
</xsl:stylesheet>
: <xsl:stylesheet version = '1.0' encoding="UTF-8"?>
- XML- . UTF-8 ( , ).
<xsl:stylesheet> </xsl:stylesheet>
- XSL-.
<xsl:template match="element"> </xsl:template>
- element.
:
<xsl:template match="element"></xsl:template>
- , element . element . <xsl:template match="element" mode="mode1"></xsl:template>
- , element mode1 . element . <xsl:template name="template-name"></xsl:template>
- template-name . - XML- .
XML- (, XML-, item ), " " :
<xsl:template match="navigation/sections/item"></xsl:template>
, , .., , , , .. navigation , navigation/sections/item sections/item .
, - . , xsl- . .
xsl .
, ( ) :
template_folder - . , my_template . dtd - . . lang - ( ). mod - .
xsl/my_template , layout.xsl :
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE xsl:stylesheet SYSTEM "../dtd/entities.dtd">
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:template match="/node()">
</xsl:template>
</xsl:stylesheet>
:
<xsl:template match="/node()"> </xsl:template>
- /node() (). /node() //document , .. .
XHTML- <xsl:template match="/node()"></xsl:template>
XML- . , XSL- XML- XHTML- .
, XSL template.xsl (, template - ), :
<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:import href=" my_template /layout.xsl"/>
</xsl:stylesheet>
:
<xsl:import href="my_template/layout.xsl"/>
XSL- ( XSL- ) . .
, .. XML- .
- .
, XML- :
<item id="0" parent_id="0" is_published="1" section="1">
/
<item id="1" parent_id="0" is_published="1" section="1" hit="yes">
news
:
id document - id . hit item - , , " ".
, , :
sections - . item - .
, , item item , , :
1. xsl/my_template navigation.xsl :
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE xsl:stylesheet SYSTEM "../dtd/entities.dtd">
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:template match="sections" mode="global_menu">
</xsl:template>
</xsl:stylesheet>
2. layout.xsl :
<xsl:template match="sections" mode="global_menu">
</xsl:template>
3. … layout.xsl :
<xsl:apply-templates select="navigation/sections" mode="global_menu"/>
:
select="navigation/sections" - ( ) - . , navigation/sections .
mode="global_menu" - global_menu . , , , " ", - .
4. , layout.xsl navigation.xsl :
<xsl:import href="navigation.xsl"/>
5. , navigation.xsl , :
<xsl:template match="item" mode="global_menu">
<xsl:call-template name="href_attribute"/>
<xsl:value-of select="title"/>
</xsl:template>
:
<xsl:call-template name="href_attribute"/>
- . , .. .
<xsl:value-of select="title"/>
- - title . @ - .
6. sections :
<xsl:template match="sections" mode="global_menu">
</xsl:template>
:
<xsl:apply-templates select="item" mode="global_menu"/>
- item sections . , item item ( sections/item/item ) , .. .
item ( ) . , : <xsl:call-template name="href_attribute"/>
uri- . .
7. ,
, . item :
<xsl:template match="item" mode="global_menu">
<xsl:choose>
<xsl:when test="descendant-or-self::*/@id = /node()/@id">
<xsl:value-of select="title"/>
</xsl:when>
<xsl:otherwise>
<xsl:call-template name="href_attribute"/>
<xsl:value-of select="title"/>
</xsl:otherwise>
</xsl:choose>
</xsl:template>
:
<xsl:choose>
<xsl:when></xsl:when>
<xsl:otherwise></xsl:otherwise>
</xsl:choose>
…, , XML- . : <xsl:when test="descendant-or-self::*/@id = /node()/@id">
ID ( document ) ( item ), , .
<xsl:when></xsl:when>
, . <xsl:otherwise></xsl:otherwise>
- .
8. , href_attribute :
<xsl:template name="href_attribute">
<xsl:attribute name="href">
<xsl:text>/</xsl:text>
<xsl:for-each select="ancestor-or-self::item">
<xsl:value-of select="dir"/>
<xsl:text>/</xsl:text>
</xsl:for-each>
</xsl:attribute>
</xsl:template>
xsl:attribute . . a , , href , .. .
<xsl:for-each select="ancestor-or-self::item">
, . ancestor-or-self::item - . dir , .. -.
, - , . , .
UPD:
. , :
parser.proc.ru/iso/xslt-1.zip
( ) Apache.
XML- /xsl/document.xml
- ( ). :
Lang - . . Id - .
<lang_table>
- , .
- :
- ( ):
<item id="0" parent_id="0" is_published="1" section="1">
- . :
Id - . Parent_id - . Is_published - . Dir - uri- . . Section - . .
- .
CMS : :
Html - . , . Com - -. , CMS: , , ..
XSL- , . .
CMS , :
:
Id - .
Container - - ( ).
Sorting - .
Type - :
Com - -
Html - .
Method - .
Title - .
DTD ( ):
<!DOCTYPE site_page [
<!ENTITY nbsp " ">
<!ENTITY sect "§" >
<!ENTITY copy "©">
<!ENTITY laquo "«">
<!ENTITY reg "®">
<!ENTITY deg "°">
<!ENTITY plusmn "±">
<!ENTITY para "¶">
<!ENTITY raquo "»">
<!ENTITY times "×">
<!ENTITY bull "•">
<!ENTITY hellip "…">
<!ENTITY ndash "–">
<!ENTITY mdash "—">
<!ENTITY lsquo "'">
<!ENTITY rsquo "'">
<!ENTITY sbquo "‚">
<!ENTITY ldquo "“">
<!ENTITY rdquo "”">
<!ENTITY bdquo "„">
<!ENTITY lsaquo "‹">
<!ENTITY rsaquo "›" >
<!ENTITY euro "€">
]>
XML- . <?xml version="1.0" encoding="windows-1251"?>
.
XHML-
XSL- XHTML- ( ). XHTML-, , .
.
XHML- , , :
( ). - , . / .
HTML-:
...
...
...
...
...
XSL-
XSL- :
<xsl:stylesheet version = '1.0' encoding="UTF-8"?>
<xsl:template match="element">
</xsl:template>
</xsl:stylesheet>
: <xsl:stylesheet version = '1.0' encoding="UTF-8"?>
- XML- . UTF-8 ( , ).
<xsl:stylesheet> </xsl:stylesheet>
- XSL-.
<xsl:template match="element"> </xsl:template>
- element.
:
<xsl:template match="element"></xsl:template>
- , element . element . <xsl:template match="element" mode="mode1"></xsl:template>
- , element mode1 . element . <xsl:template name="template-name"></xsl:template>
- template-name . - XML- .
XML- (, XML-, item ), " " :
<xsl:template match="navigation/sections/item"></xsl:template>
, , .., , , , .. navigation , navigation/sections/item sections/item .
, - . , xsl- . .
xsl .
, ( ) :
template_folder - . , my_template . dtd - . . lang - ( ). mod - .
xsl/my_template , layout.xsl :
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE xsl:stylesheet SYSTEM "../dtd/entities.dtd">
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:template match="/node()">
</xsl:template>
</xsl:stylesheet>
:
<xsl:template match="/node()"> </xsl:template>
- /node() (). /node() //document , .. .
XHTML- <xsl:template match="/node()"></xsl:template>
XML- . , XSL- XML- XHTML- .
, XSL template.xsl (, template - ), :
<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:import href=" my_template /layout.xsl"/>
</xsl:stylesheet>
:
<xsl:import href="my_template/layout.xsl"/>
XSL- ( XSL- ) . .
, .. XML- .
- .
, XML- :
<item id="0" parent_id="0" is_published="1" section="1">
/
<item id="1" parent_id="0" is_published="1" section="1" hit="yes">
news
:
id document - id . hit item - , , " ".
, , :
sections - . item - .
, , item item , , :
1. xsl/my_template navigation.xsl :
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE xsl:stylesheet SYSTEM "../dtd/entities.dtd">
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:template match="sections" mode="global_menu">
</xsl:template>
</xsl:stylesheet>
2. layout.xsl :
<xsl:template match="sections" mode="global_menu">
</xsl:template>
3. … layout.xsl :
<xsl:apply-templates select="navigation/sections" mode="global_menu"/>
:
select="navigation/sections" - ( ) - . , navigation/sections .
mode="global_menu" - global_menu . , , , " ", - .
4. , layout.xsl navigation.xsl :
<xsl:import href="navigation.xsl"/>
5. , navigation.xsl , :
<xsl:template match="item" mode="global_menu">
<xsl:call-template name="href_attribute"/>
<xsl:value-of select="title"/>
</xsl:template>
:
<xsl:call-template name="href_attribute"/>
- . , .. .
<xsl:value-of select="title"/>
- - title . @ - .
6. sections :
<xsl:template match="sections" mode="global_menu">
</xsl:template>
:
<xsl:apply-templates select="item" mode="global_menu"/>
- item sections . , item item ( sections/item/item ) , .. .
item ( ) . , : <xsl:call-template name="href_attribute"/>
uri- . .
7. ,
, . item :
<xsl:template match="item" mode="global_menu">
<xsl:choose>
<xsl:when test="descendant-or-self::*/@id = /node()/@id">
<xsl:value-of select="title"/>
</xsl:when>
<xsl:otherwise>
<xsl:call-template name="href_attribute"/>
<xsl:value-of select="title"/>
</xsl:otherwise>
</xsl:choose>
</xsl:template>
:
<xsl:choose>
<xsl:when></xsl:when>
<xsl:otherwise></xsl:otherwise>
</xsl:choose>
…, , XML- . : <xsl:when test="descendant-or-self::*/@id = /node()/@id">
ID ( document ) ( item ), , .
<xsl:when></xsl:when>
, . <xsl:otherwise></xsl:otherwise>
- .
8. , href_attribute :
<xsl:template name="href_attribute">
<xsl:attribute name="href">
<xsl:text>/</xsl:text>
<xsl:for-each select="ancestor-or-self::item">
<xsl:value-of select="dir"/>
<xsl:text>/</xsl:text>
</xsl:for-each>
</xsl:attribute>
</xsl:template>
xsl:attribute . . a , , href , .. .
<xsl:for-each select="ancestor-or-self::item">
, . ancestor-or-self::item - . dir , .. -.
, - , . , .
UPD:
. , :
parser.proc.ru/iso/xslt-1.zip
( ) Apache.
XML- /xsl/document.xml
- ( ). :
Lang - . . Id - .
<lang_table>
- , .
- :
- ( ):
<item id="0" parent_id="0" is_published="1" section="1">
- . :
Id - . Parent_id - . Is_published - . Dir - uri- . . Section - . .
- .
CMS : :
Html - . , . Com - -. , CMS: , , ..
XSL- , . .
CMS , :
:
Id - .
Container - - ( ).
Sorting - .
Type - :
Com - -
Html - .
Method - .
Title - .
DTD ( ):
<!DOCTYPE site_page [
<!ENTITY nbsp " ">
<!ENTITY sect "§" >
<!ENTITY copy "©">
<!ENTITY laquo "«">
<!ENTITY reg "®">
<!ENTITY deg "°">
<!ENTITY plusmn "±">
<!ENTITY para "¶">
<!ENTITY raquo "»">
<!ENTITY times "×">
<!ENTITY bull "•">
<!ENTITY hellip "…">
<!ENTITY ndash "–">
<!ENTITY mdash "—">
<!ENTITY lsquo "'">
<!ENTITY rsquo "'">
<!ENTITY sbquo "‚">
<!ENTITY ldquo "“">
<!ENTITY rdquo "”">
<!ENTITY bdquo "„">
<!ENTITY lsaquo "‹">
<!ENTITY rsaquo "›" >
<!ENTITY euro "€">
]>
XML- . <?xml version="1.0" encoding="windows-1251"?>
.
XHML-
XSL- XHTML- ( ). XHTML-, , .
.
XHML- , , :
( ). - , . / .
HTML-:
...
...
...
...
...
XSL-
XSL- :
<xsl:stylesheet version = '1.0' encoding="UTF-8"?>
<xsl:template match="element">
</xsl:template>
</xsl:stylesheet>
: <xsl:stylesheet version = '1.0' encoding="UTF-8"?>
- XML- . UTF-8 ( , ).
<xsl:stylesheet> </xsl:stylesheet>
- XSL-.
<xsl:template match="element"> </xsl:template>
- element.
:
<xsl:template match="element"></xsl:template>
- , element . element . <xsl:template match="element" mode="mode1"></xsl:template>
- , element mode1 . element . <xsl:template name="template-name"></xsl:template>
- template-name . - XML- .
XML- (, XML-, item ), " " :
<xsl:template match="navigation/sections/item"></xsl:template>
, , .., , , , .. navigation , navigation/sections/item sections/item .
, - . , xsl- . .
xsl .
, ( ) :
template_folder - . , my_template . dtd - . . lang - ( ). mod - .
xsl/my_template , layout.xsl :
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE xsl:stylesheet SYSTEM "../dtd/entities.dtd">
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:template match="/node()">
</xsl:template>
</xsl:stylesheet>
:
<xsl:template match="/node()"> </xsl:template>
- /node() (). /node() //document , .. .
XHTML- <xsl:template match="/node()"></xsl:template>
XML- . , XSL- XML- XHTML- .
, XSL template.xsl (, template - ), :
<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:import href=" my_template /layout.xsl"/>
</xsl:stylesheet>
:
<xsl:import href="my_template/layout.xsl"/>
XSL- ( XSL- ) . .
, .. XML- .
- .
, XML- :
<item id="0" parent_id="0" is_published="1" section="1">
/
<item id="1" parent_id="0" is_published="1" section="1" hit="yes">
news
:
id document - id . hit item - , , " ".
, , :
sections - . item - .
, , item item , , :
1. xsl/my_template navigation.xsl :
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE xsl:stylesheet SYSTEM "../dtd/entities.dtd">
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:template match="sections" mode="global_menu">
</xsl:template>
</xsl:stylesheet>
2. layout.xsl :
<xsl:template match="sections" mode="global_menu">
</xsl:template>
3. … layout.xsl :
<xsl:apply-templates select="navigation/sections" mode="global_menu"/>
:
select="navigation/sections" - ( ) - . , navigation/sections .
mode="global_menu" - global_menu . , , , " ", - .
4. , layout.xsl navigation.xsl :
<xsl:import href="navigation.xsl"/>
5. , navigation.xsl , :
<xsl:template match="item" mode="global_menu">
<xsl:call-template name="href_attribute"/>
<xsl:value-of select="title"/>
</xsl:template>
:
<xsl:call-template name="href_attribute"/>
- . , .. .
<xsl:value-of select="title"/>
- - title . @ - .
6. sections :
<xsl:template match="sections" mode="global_menu">
</xsl:template>
:
<xsl:apply-templates select="item" mode="global_menu"/>
- item sections . , item item ( sections/item/item ) , .. .
item ( ) . , : <xsl:call-template name="href_attribute"/>
uri- . .
7. ,
, . item :
<xsl:template match="item" mode="global_menu">
<xsl:choose>
<xsl:when test="descendant-or-self::*/@id = /node()/@id">
<xsl:value-of select="title"/>
</xsl:when>
<xsl:otherwise>
<xsl:call-template name="href_attribute"/>
<xsl:value-of select="title"/>
</xsl:otherwise>
</xsl:choose>
</xsl:template>
:
<xsl:choose>
<xsl:when></xsl:when>
<xsl:otherwise></xsl:otherwise>
</xsl:choose>
…, , XML- . : <xsl:when test="descendant-or-self::*/@id = /node()/@id">
ID ( document ) ( item ), , .
<xsl:when></xsl:when>
, . <xsl:otherwise></xsl:otherwise>
- .
8. , href_attribute :
<xsl:template name="href_attribute">
<xsl:attribute name="href">
<xsl:text>/</xsl:text>
<xsl:for-each select="ancestor-or-self::item">
<xsl:value-of select="dir"/>
<xsl:text>/</xsl:text>
</xsl:for-each>
</xsl:attribute>
</xsl:template>
xsl:attribute . . a , , href , .. .
<xsl:for-each select="ancestor-or-self::item">
, . ancestor-or-self::item - . dir , .. -.
, - , . , .
UPD:
. , :
parser.proc.ru/iso/xslt-1.zip
( ) Apache.
XML- /xsl/document.xml
- ( ). :
Lang - . . Id - .
<lang_table>
- , .
- :
- ( ):
<item id="0" parent_id="0" is_published="1" section="1">
- . :
Id - . Parent_id - . Is_published - . Dir - uri- . . Section - . .
- .
CMS : :
Html - . , . Com - -. , CMS: , , ..
XSL- , . .
CMS , :
:
Id - .
Container - - ( ).
Sorting - .
Type - :
Com - -
Html - .
Method - .
Title - .
DTD ( ):
<!DOCTYPE site_page [
<!ENTITY nbsp " ">
<!ENTITY sect "§" >
<!ENTITY copy "©">
<!ENTITY laquo "«">
<!ENTITY reg "®">
<!ENTITY deg "°">
<!ENTITY plusmn "±">
<!ENTITY para "¶">
<!ENTITY raquo "»">
<!ENTITY times "×">
<!ENTITY bull "•">
<!ENTITY hellip "…">
<!ENTITY ndash "–">
<!ENTITY mdash "—">
<!ENTITY lsquo "'">
<!ENTITY rsquo "'">
<!ENTITY sbquo "‚">
<!ENTITY ldquo "“">
<!ENTITY rdquo "”">
<!ENTITY bdquo "„">
<!ENTITY lsaquo "‹">
<!ENTITY rsaquo "›" >
<!ENTITY euro "€">
]>
XML- . <?xml version="1.0" encoding="windows-1251"?>
.
XHML-
XSL- XHTML- ( ). XHTML-, , .
.
XHML- , , :
( ). - , . / .
HTML-:
...
...
...
...
...
XSL-
XSL- :
<xsl:stylesheet version = '1.0' encoding="UTF-8"?>
<xsl:template match="element">
</xsl:template>
</xsl:stylesheet>
: <xsl:stylesheet version = '1.0' encoding="UTF-8"?>
- XML- . UTF-8 ( , ).
<xsl:stylesheet> </xsl:stylesheet>
- XSL-.
<xsl:template match="element"> </xsl:template>
- element.
:
<xsl:template match="element"></xsl:template>
- , element . element . <xsl:template match="element" mode="mode1"></xsl:template>
- , element mode1 . element . <xsl:template name="template-name"></xsl:template>
- template-name . - XML- .
XML- (, XML-, item ), " " :
<xsl:template match="navigation/sections/item"></xsl:template>
, , .., , , , .. navigation , navigation/sections/item sections/item .
, - . , xsl- . .
xsl .
, ( ) :
template_folder - . , my_template . dtd - . . lang - ( ). mod - .
xsl/my_template , layout.xsl :
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE xsl:stylesheet SYSTEM "../dtd/entities.dtd">
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:template match="/node()">
</xsl:template>
</xsl:stylesheet>
:
<xsl:template match="/node()"> </xsl:template>
- /node() (). /node() //document , .. .
XHTML- <xsl:template match="/node()"></xsl:template>
XML- . , XSL- XML- XHTML- .
, XSL template.xsl (, template - ), :
<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:import href=" my_template /layout.xsl"/>
</xsl:stylesheet>
:
<xsl:import href="my_template/layout.xsl"/>
XSL- ( XSL- ) . .
, .. XML- .
- .
, XML- :
<item id="0" parent_id="0" is_published="1" section="1">
/
<item id="1" parent_id="0" is_published="1" section="1" hit="yes">
news
:
id document - id . hit item - , , " ".
, , :
sections - . item - .
, , item item , , :
1. xsl/my_template navigation.xsl :
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE xsl:stylesheet SYSTEM "../dtd/entities.dtd">
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:template match="sections" mode="global_menu">
</xsl:template>
</xsl:stylesheet>
2. layout.xsl :
<xsl:template match="sections" mode="global_menu">
</xsl:template>
3. … layout.xsl :
<xsl:apply-templates select="navigation/sections" mode="global_menu"/>
:
select="navigation/sections" - ( ) - . , navigation/sections .
mode="global_menu" - global_menu . , , , " ", - .
4. , layout.xsl navigation.xsl :
<xsl:import href="navigation.xsl"/>
5. , navigation.xsl , :
<xsl:template match="item" mode="global_menu">
<xsl:call-template name="href_attribute"/>
<xsl:value-of select="title"/>
</xsl:template>
:
<xsl:call-template name="href_attribute"/>
- . , .. .
<xsl:value-of select="title"/>
- - title . @ - .
6. sections :
<xsl:template match="sections" mode="global_menu">
</xsl:template>
:
<xsl:apply-templates select="item" mode="global_menu"/>
- item sections . , item item ( sections/item/item ) , .. .
item ( ) . , : <xsl:call-template name="href_attribute"/>
uri- . .
7. ,
, . item :
<xsl:template match="item" mode="global_menu">
<xsl:choose>
<xsl:when test="descendant-or-self::*/@id = /node()/@id">
<xsl:value-of select="title"/>
</xsl:when>
<xsl:otherwise>
<xsl:call-template name="href_attribute"/>
<xsl:value-of select="title"/>
</xsl:otherwise>
</xsl:choose>
</xsl:template>
:
<xsl:choose>
<xsl:when></xsl:when>
<xsl:otherwise></xsl:otherwise>
</xsl:choose>
…, , XML- . : <xsl:when test="descendant-or-self::*/@id = /node()/@id">
ID ( document ) ( item ), , .
<xsl:when></xsl:when>
, . <xsl:otherwise></xsl:otherwise>
- .
8. , href_attribute :
<xsl:template name="href_attribute">
<xsl:attribute name="href">
<xsl:text>/</xsl:text>
<xsl:for-each select="ancestor-or-self::item">
<xsl:value-of select="dir"/>
<xsl:text>/</xsl:text>
</xsl:for-each>
</xsl:attribute>
</xsl:template>
xsl:attribute . . a , , href , .. .
<xsl:for-each select="ancestor-or-self::item">
, . ancestor-or-self::item - . dir , .. -.
, - , . , .
UPD:
. , :
parser.proc.ru/iso/xslt-1.zip
( ) Apache.
XML- /xsl/document.xml
- ( ). :
Lang - . . Id - .
<lang_table>
- , .
- :
- ( ):
<item id="0" parent_id="0" is_published="1" section="1">
- . :
Id - . Parent_id - . Is_published - . Dir - uri- . . Section - . .
- .
CMS : :
Html - . , . Com - -. , CMS: , , ..
XSL- , . .
CMS , :
:
Id - .
Container - - ( ).
Sorting - .
Type - :
Com - -
Html - .
Method - .
Title - .
DTD ( ):
<!DOCTYPE site_page [
<!ENTITY nbsp " ">
<!ENTITY sect "§" >
<!ENTITY copy "©">
<!ENTITY laquo "«">
<!ENTITY reg "®">
<!ENTITY deg "°">
<!ENTITY plusmn "±">
<!ENTITY para "¶">
<!ENTITY raquo "»">
<!ENTITY times "×">
<!ENTITY bull "•">
<!ENTITY hellip "…">
<!ENTITY ndash "–">
<!ENTITY mdash "—">
<!ENTITY lsquo "'">
<!ENTITY rsquo "'">
<!ENTITY sbquo "‚">
<!ENTITY ldquo "“">
<!ENTITY rdquo "”">
<!ENTITY bdquo "„">
<!ENTITY lsaquo "‹">
<!ENTITY rsaquo "›" >
<!ENTITY euro "€">
]>
XML- . <?xml version="1.0" encoding="windows-1251"?>
.
XHML-
XSL- XHTML- ( ). XHTML-, , .
.
XHML- , , :
( ). - , . / .
HTML-:
...
...
...
...
...
XSL-
XSL- :
<xsl:stylesheet version = '1.0' encoding="UTF-8"?>
<xsl:template match="element">
</xsl:template>
</xsl:stylesheet>
: <xsl:stylesheet version = '1.0' encoding="UTF-8"?>
- XML- . UTF-8 ( , ).
<xsl:stylesheet> </xsl:stylesheet>
- XSL-.
<xsl:template match="element"> </xsl:template>
- element.
:
<xsl:template match="element"></xsl:template>
- , element . element . <xsl:template match="element" mode="mode1"></xsl:template>
- , element mode1 . element . <xsl:template name="template-name"></xsl:template>
- template-name . - XML- .
XML- (, XML-, item ), " " :
<xsl:template match="navigation/sections/item"></xsl:template>
, , .., , , , .. navigation , navigation/sections/item sections/item .
, - . , xsl- . .
xsl .
, ( ) :
template_folder - . , my_template . dtd - . . lang - ( ). mod - .
xsl/my_template , layout.xsl :
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE xsl:stylesheet SYSTEM "../dtd/entities.dtd">
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:template match="/node()">
</xsl:template>
</xsl:stylesheet>
:
<xsl:template match="/node()"> </xsl:template>
- /node() (). /node() //document , .. .
XHTML- <xsl:template match="/node()"></xsl:template>
XML- . , XSL- XML- XHTML- .
, XSL template.xsl (, template - ), :
<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:import href=" my_template /layout.xsl"/>
</xsl:stylesheet>
:
<xsl:import href="my_template/layout.xsl"/>
XSL- ( XSL- ) . .
, .. XML- .
- .
, XML- :
<item id="0" parent_id="0" is_published="1" section="1">
/
<item id="1" parent_id="0" is_published="1" section="1" hit="yes">
news
:
id document - id . hit item - , , " ".
, , :
sections - . item - .
, , item item , , :
1. xsl/my_template navigation.xsl :
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE xsl:stylesheet SYSTEM "../dtd/entities.dtd">
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:template match="sections" mode="global_menu">
</xsl:template>
</xsl:stylesheet>
2. layout.xsl :
<xsl:template match="sections" mode="global_menu">
</xsl:template>
3. … layout.xsl :
<xsl:apply-templates select="navigation/sections" mode="global_menu"/>
:
select="navigation/sections" - ( ) - . , navigation/sections .
mode="global_menu" - global_menu . , , , " ", - .
4. , layout.xsl navigation.xsl :
<xsl:import href="navigation.xsl"/>
5. , navigation.xsl , :
<xsl:template match="item" mode="global_menu">
<xsl:call-template name="href_attribute"/>
<xsl:value-of select="title"/>
</xsl:template>
:
<xsl:call-template name="href_attribute"/>
- . , .. .
<xsl:value-of select="title"/>
- - title . @ - .
6. sections :
<xsl:template match="sections" mode="global_menu">
</xsl:template>
:
<xsl:apply-templates select="item" mode="global_menu"/>
- item sections . , item item ( sections/item/item ) , .. .
item ( ) . , : <xsl:call-template name="href_attribute"/>
uri- . .
7. ,
, . item :
<xsl:template match="item" mode="global_menu">
<xsl:choose>
<xsl:when test="descendant-or-self::*/@id = /node()/@id">
<xsl:value-of select="title"/>
</xsl:when>
<xsl:otherwise>
<xsl:call-template name="href_attribute"/>
<xsl:value-of select="title"/>
</xsl:otherwise>
</xsl:choose>
</xsl:template>
:
<xsl:choose>
<xsl:when></xsl:when>
<xsl:otherwise></xsl:otherwise>
</xsl:choose>
…, , XML- . : <xsl:when test="descendant-or-self::*/@id = /node()/@id">
ID ( document ) ( item ), , .
<xsl:when></xsl:when>
, . <xsl:otherwise></xsl:otherwise>
- .
8. , href_attribute :
<xsl:template name="href_attribute">
<xsl:attribute name="href">
<xsl:text>/</xsl:text>
<xsl:for-each select="ancestor-or-self::item">
<xsl:value-of select="dir"/>
<xsl:text>/</xsl:text>
</xsl:for-each>
</xsl:attribute>
</xsl:template>
xsl:attribute . . a , , href , .. .
<xsl:for-each select="ancestor-or-self::item">
, . ancestor-or-self::item - . dir , .. -.
, - , . , .
UPD:
. , :
parser.proc.ru/iso/xslt-1.zip
( ) Apache.
XML- /xsl/document.xml
- ( ). :
Lang - . . Id - .
<lang_table>
- , .
- :
- ( ):
<item id="0" parent_id="0" is_published="1" section="1">
- . :
Id - . Parent_id - . Is_published - . Dir - uri- . . Section - . .
- .
CMS : :
Html - . , . Com - -. , CMS: , , ..
XSL- , . .
CMS , :
:
Id - .
Container - - ( ).
Sorting - .
Type - :
Com - -
Html - .
Method - .
Title - .
DTD ( ):
<!DOCTYPE site_page [
<!ENTITY nbsp " ">
<!ENTITY sect "§" >
<!ENTITY copy "©">
<!ENTITY laquo "«">
<!ENTITY reg "®">
<!ENTITY deg "°">
<!ENTITY plusmn "±">
<!ENTITY para "¶">
<!ENTITY raquo "»">
<!ENTITY times "×">
<!ENTITY bull "•">
<!ENTITY hellip "…">
<!ENTITY ndash "–">
<!ENTITY mdash "—">
<!ENTITY lsquo "'">
<!ENTITY rsquo "'">
<!ENTITY sbquo "‚">
<!ENTITY ldquo "“">
<!ENTITY rdquo "”">
<!ENTITY bdquo "„">
<!ENTITY lsaquo "‹">
<!ENTITY rsaquo "›" >
<!ENTITY euro "€">
]>
XML- . <?xml version="1.0" encoding="windows-1251"?>
.
XHML-
XSL- XHTML- ( ). XHTML-, , .
.
XHML- , , :
( ). - , . / .
HTML-:
...
...
...
...
...
XSL-
XSL- :
<xsl:stylesheet version = '1.0' encoding="UTF-8"?>
<xsl:template match="element">
</xsl:template>
</xsl:stylesheet>
: <xsl:stylesheet version = '1.0' encoding="UTF-8"?>
- XML- . UTF-8 ( , ).
<xsl:stylesheet> </xsl:stylesheet>
- XSL-.
<xsl:template match="element"> </xsl:template>
- element.
:
<xsl:template match="element"></xsl:template>
- , element . element . <xsl:template match="element" mode="mode1"></xsl:template>
- , element mode1 . element . <xsl:template name="template-name"></xsl:template>
- template-name . - XML- .
XML- (, XML-, item ), " " :
<xsl:template match="navigation/sections/item"></xsl:template>
, , .., , , , .. navigation , navigation/sections/item sections/item .
, - . , xsl- . .
xsl .
, ( ) :
template_folder - . , my_template . dtd - . . lang - ( ). mod - .
xsl/my_template , layout.xsl :
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE xsl:stylesheet SYSTEM "../dtd/entities.dtd">
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:template match="/node()">
</xsl:template>
</xsl:stylesheet>
:
<xsl:template match="/node()"> </xsl:template>
- /node() (). /node() //document , .. .
XHTML- <xsl:template match="/node()"></xsl:template>
XML- . , XSL- XML- XHTML- .
, XSL template.xsl (, template - ), :
<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:import href=" my_template /layout.xsl"/>
</xsl:stylesheet>
:
<xsl:import href="my_template/layout.xsl"/>
XSL- ( XSL- ) . .
, .. XML- .
- .
, XML- :
<item id="0" parent_id="0" is_published="1" section="1">
/
<item id="1" parent_id="0" is_published="1" section="1" hit="yes">
news
:
id document - id . hit item - , , " ".
, , :
sections - . item - .
, , item item , , :
1. xsl/my_template navigation.xsl :
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE xsl:stylesheet SYSTEM "../dtd/entities.dtd">
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:template match="sections" mode="global_menu">
</xsl:template>
</xsl:stylesheet>
2. layout.xsl :
<xsl:template match="sections" mode="global_menu">
</xsl:template>
3. … layout.xsl :
<xsl:apply-templates select="navigation/sections" mode="global_menu"/>
:
select="navigation/sections" - ( ) - . , navigation/sections .
mode="global_menu" - global_menu . , , , " ", - .
4. , layout.xsl navigation.xsl :
<xsl:import href="navigation.xsl"/>
5. , navigation.xsl , :
<xsl:template match="item" mode="global_menu">
<xsl:call-template name="href_attribute"/>
<xsl:value-of select="title"/>
</xsl:template>
:
<xsl:call-template name="href_attribute"/>
- . , .. .
<xsl:value-of select="title"/>
- - title . @ - .
6. sections :
<xsl:template match="sections" mode="global_menu">
</xsl:template>
:
<xsl:apply-templates select="item" mode="global_menu"/>
- item sections . , item item ( sections/item/item ) , .. .
item ( ) . , : <xsl:call-template name="href_attribute"/>
uri- . .
7. ,
, . item :
<xsl:template match="item" mode="global_menu">
<xsl:choose>
<xsl:when test="descendant-or-self::*/@id = /node()/@id">
<xsl:value-of select="title"/>
</xsl:when>
<xsl:otherwise>
<xsl:call-template name="href_attribute"/>
<xsl:value-of select="title"/>
</xsl:otherwise>
</xsl:choose>
</xsl:template>
:
<xsl:choose>
<xsl:when></xsl:when>
<xsl:otherwise></xsl:otherwise>
</xsl:choose>
…, , XML- . : <xsl:when test="descendant-or-self::*/@id = /node()/@id">
ID ( document ) ( item ), , .
<xsl:when></xsl:when>
, . <xsl:otherwise></xsl:otherwise>
- .
8. , href_attribute :
<xsl:template name="href_attribute">
<xsl:attribute name="href">
<xsl:text>/</xsl:text>
<xsl:for-each select="ancestor-or-self::item">
<xsl:value-of select="dir"/>
<xsl:text>/</xsl:text>
</xsl:for-each>
</xsl:attribute>
</xsl:template>
xsl:attribute . . a , , href , .. .
<xsl:for-each select="ancestor-or-self::item">
, . ancestor-or-self::item - . dir , .. -.
, - , . , .
UPD:
. , :
parser.proc.ru/iso/xslt-1.zip
( ) Apache.
XML- /xsl/document.xml
- ( ). :
Lang - . . Id - .
<lang_table>
- , .
- :
- ( ):
<item id="0" parent_id="0" is_published="1" section="1">
- . :
Id - . Parent_id - . Is_published - . Dir - uri- . . Section - . .
- .
CMS : :
Html - . , . Com - -. , CMS: , , ..
XSL- , . .
CMS , :
:
Id - .
Container - - ( ).
Sorting - .
Type - :
Com - -
Html - .
Method - .
Title - .
DTD ( ):
<!DOCTYPE site_page [
<!ENTITY nbsp " ">
<!ENTITY sect "§" >
<!ENTITY copy "©">
<!ENTITY laquo "«">
<!ENTITY reg "®">
<!ENTITY deg "°">
<!ENTITY plusmn "±">
<!ENTITY para "¶">
<!ENTITY raquo "»">
<!ENTITY times "×">
<!ENTITY bull "•">
<!ENTITY hellip "…">
<!ENTITY ndash "–">
<!ENTITY mdash "—">
<!ENTITY lsquo "'">
<!ENTITY rsquo "'">
<!ENTITY sbquo "‚">
<!ENTITY ldquo "“">
<!ENTITY rdquo "”">
<!ENTITY bdquo "„">
<!ENTITY lsaquo "‹">
<!ENTITY rsaquo "›" >
<!ENTITY euro "€">
]>
XML- . <?xml version="1.0" encoding="windows-1251"?>
.
XHML-
XSL- XHTML- ( ). XHTML-, , .
.
XHML- , , :
( ). - , . / .
HTML-:
...
...
...
...
...
XSL-
XSL- :
<xsl:stylesheet version = '1.0' encoding="UTF-8"?>
<xsl:template match="element">
</xsl:template>
</xsl:stylesheet>
: <xsl:stylesheet version = '1.0' encoding="UTF-8"?>
- XML- . UTF-8 ( , ).
<xsl:stylesheet> </xsl:stylesheet>
- XSL-.
<xsl:template match="element"> </xsl:template>
- element.
:
<xsl:template match="element"></xsl:template>
- , element . element . <xsl:template match="element" mode="mode1"></xsl:template>
- , element mode1 . element . <xsl:template name="template-name"></xsl:template>
- template-name . - XML- .
XML- (, XML-, item ), " " :
<xsl:template match="navigation/sections/item"></xsl:template>
, , .., , , , .. navigation , navigation/sections/item sections/item .
, - . , xsl- . .
xsl .
, ( ) :
template_folder - . , my_template . dtd - . . lang - ( ). mod - .
xsl/my_template , layout.xsl :
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE xsl:stylesheet SYSTEM "../dtd/entities.dtd">
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:template match="/node()">
</xsl:template>
</xsl:stylesheet>
:
<xsl:template match="/node()"> </xsl:template>
- /node() (). /node() //document , .. .
XHTML- <xsl:template match="/node()"></xsl:template>
XML- . , XSL- XML- XHTML- .
, XSL template.xsl (, template - ), :
<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:import href=" my_template /layout.xsl"/>
</xsl:stylesheet>
:
<xsl:import href="my_template/layout.xsl"/>
XSL- ( XSL- ) . .
, .. XML- .
- .
, XML- :
<item id="0" parent_id="0" is_published="1" section="1">
/
<item id="1" parent_id="0" is_published="1" section="1" hit="yes">
news
:
id document - id . hit item - , , " ".
, , :
sections - . item - .
, , item item , , :
1. xsl/my_template navigation.xsl :
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE xsl:stylesheet SYSTEM "../dtd/entities.dtd">
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:template match="sections" mode="global_menu">
</xsl:template>
</xsl:stylesheet>
2. layout.xsl :
<xsl:template match="sections" mode="global_menu">
</xsl:template>
3. … layout.xsl :
<xsl:apply-templates select="navigation/sections" mode="global_menu"/>
:
select="navigation/sections" - ( ) - . , navigation/sections .
mode="global_menu" - global_menu . , , , " ", - .
4. , layout.xsl navigation.xsl :
<xsl:import href="navigation.xsl"/>
5. , navigation.xsl , :
<xsl:template match="item" mode="global_menu">
<xsl:call-template name="href_attribute"/>
<xsl:value-of select="title"/>
</xsl:template>
:
<xsl:call-template name="href_attribute"/>
- . , .. .
<xsl:value-of select="title"/>
- - title . @ - .
6. sections :
<xsl:template match="sections" mode="global_menu">
</xsl:template>
:
<xsl:apply-templates select="item" mode="global_menu"/>
- item sections . , item item ( sections/item/item ) , .. .
item ( ) . , : <xsl:call-template name="href_attribute"/>
uri- . .
7. ,
, . item :
<xsl:template match="item" mode="global_menu">
<xsl:choose>
<xsl:when test="descendant-or-self::*/@id = /node()/@id">
<xsl:value-of select="title"/>
</xsl:when>
<xsl:otherwise>
<xsl:call-template name="href_attribute"/>
<xsl:value-of select="title"/>
</xsl:otherwise>
</xsl:choose>
</xsl:template>
:
<xsl:choose>
<xsl:when></xsl:when>
<xsl:otherwise></xsl:otherwise>
</xsl:choose>
…, , XML- . : <xsl:when test="descendant-or-self::*/@id = /node()/@id">
ID ( document ) ( item ), , .
<xsl:when></xsl:when>
, . <xsl:otherwise></xsl:otherwise>
- .
8. , href_attribute :
<xsl:template name="href_attribute">
<xsl:attribute name="href">
<xsl:text>/</xsl:text>
<xsl:for-each select="ancestor-or-self::item">
<xsl:value-of select="dir"/>
<xsl:text>/</xsl:text>
</xsl:for-each>
</xsl:attribute>
</xsl:template>
xsl:attribute . . a , , href , .. .
<xsl:for-each select="ancestor-or-self::item">
, . ancestor-or-self::item - . dir , .. -.
, - , . , .
UPD:
. , :
parser.proc.ru/iso/xslt-1.zip
( ) Apache.
XML- /xsl/document.xml
- ( ). :
Lang - . . Id - .
<lang_table>
- , .
- :
- ( ):
<item id="0" parent_id="0" is_published="1" section="1">
- . :
Id - . Parent_id - . Is_published - . Dir - uri- . . Section - . .
- .
CMS : :
Html - . , . Com - -. , CMS: , , ..
XSL- , . .
CMS , :
:
Id - .
Container - - ( ).
Sorting - .
Type - :
Com - -
Html - .
Method - .
Title - .
DTD ( ):
<!DOCTYPE site_page [
<!ENTITY nbsp " ">
<!ENTITY sect "§" >
<!ENTITY copy "©">
<!ENTITY laquo "«">
<!ENTITY reg "®">
<!ENTITY deg "°">
<!ENTITY plusmn "±">
<!ENTITY para "¶">
<!ENTITY raquo "»">
<!ENTITY times "×">
<!ENTITY bull "•">
<!ENTITY hellip "…">
<!ENTITY ndash "–">
<!ENTITY mdash "—">
<!ENTITY lsquo "'">
<!ENTITY rsquo "'">
<!ENTITY sbquo "‚">
<!ENTITY ldquo "“">
<!ENTITY rdquo "”">
<!ENTITY bdquo "„">
<!ENTITY lsaquo "‹">
<!ENTITY rsaquo "›" >
<!ENTITY euro "€">
]>
XML- . <?xml version="1.0" encoding="windows-1251"?>
.
XHML-
XSL- XHTML- ( ). XHTML-, , .
.
XHML- , , :
( ). - , . / .
HTML-:
...
...
...
...
...
XSL-
XSL- :
<xsl:stylesheet version = '1.0' encoding="UTF-8"?>
<xsl:template match="element">
</xsl:template>
</xsl:stylesheet>
: <xsl:stylesheet version = '1.0' encoding="UTF-8"?>
- XML- . UTF-8 ( , ).
<xsl:stylesheet> </xsl:stylesheet>
- XSL-.
<xsl:template match="element"> </xsl:template>
- element.
:
<xsl:template match="element"></xsl:template>
- , element . element . <xsl:template match="element" mode="mode1"></xsl:template>
- , element mode1 . element . <xsl:template name="template-name"></xsl:template>
- template-name . - XML- .
XML- (, XML-, item ), " " :
<xsl:template match="navigation/sections/item"></xsl:template>
, , .., , , , .. navigation , navigation/sections/item sections/item .
, - . , xsl- . .
xsl .
, ( ) :
template_folder - . , my_template . dtd - . . lang - ( ). mod - .
xsl/my_template , layout.xsl :
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE xsl:stylesheet SYSTEM "../dtd/entities.dtd">
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:template match="/node()">
</xsl:template>
</xsl:stylesheet>
:
<xsl:template match="/node()"> </xsl:template>
- /node() (). /node() //document , .. .
XHTML- <xsl:template match="/node()"></xsl:template>
XML- . , XSL- XML- XHTML- .
, XSL template.xsl (, template - ), :
<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:import href=" my_template /layout.xsl"/>
</xsl:stylesheet>
:
<xsl:import href="my_template/layout.xsl"/>
XSL- ( XSL- ) . .
, .. XML- .
- .
, XML- :
<item id="0" parent_id="0" is_published="1" section="1">
/
<item id="1" parent_id="0" is_published="1" section="1" hit="yes">
news
:
id document - id . hit item - , , " ".
, , :
sections - . item - .
, , item item , , :
1. xsl/my_template navigation.xsl :
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE xsl:stylesheet SYSTEM "../dtd/entities.dtd">
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:template match="sections" mode="global_menu">
</xsl:template>
</xsl:stylesheet>
2. layout.xsl :
<xsl:template match="sections" mode="global_menu">
</xsl:template>
3. … layout.xsl :
<xsl:apply-templates select="navigation/sections" mode="global_menu"/>
:
select="navigation/sections" - ( ) - . , navigation/sections .
mode="global_menu" - global_menu . , , , " ", - .
4. , layout.xsl navigation.xsl :
<xsl:import href="navigation.xsl"/>
5. , navigation.xsl , :
<xsl:template match="item" mode="global_menu">
<xsl:call-template name="href_attribute"/>
<xsl:value-of select="title"/>
</xsl:template>
:
<xsl:call-template name="href_attribute"/>
- . , .. .
<xsl:value-of select="title"/>
- - title . @ - .
6. sections :
<xsl:template match="sections" mode="global_menu">
</xsl:template>
:
<xsl:apply-templates select="item" mode="global_menu"/>
- item sections . , item item ( sections/item/item ) , .. .
item ( ) . , : <xsl:call-template name="href_attribute"/>
uri- . .
7. ,
, . item :
<xsl:template match="item" mode="global_menu">
<xsl:choose>
<xsl:when test="descendant-or-self::*/@id = /node()/@id">
<xsl:value-of select="title"/>
</xsl:when>
<xsl:otherwise>
<xsl:call-template name="href_attribute"/>
<xsl:value-of select="title"/>
</xsl:otherwise>
</xsl:choose>
</xsl:template>
:
<xsl:choose>
<xsl:when></xsl:when>
<xsl:otherwise></xsl:otherwise>
</xsl:choose>
…, , XML- . : <xsl:when test="descendant-or-self::*/@id = /node()/@id">
ID ( document ) ( item ), , .
<xsl:when></xsl:when>
, . <xsl:otherwise></xsl:otherwise>
- .
8. , href_attribute :
<xsl:template name="href_attribute">
<xsl:attribute name="href">
<xsl:text>/</xsl:text>
<xsl:for-each select="ancestor-or-self::item">
<xsl:value-of select="dir"/>
<xsl:text>/</xsl:text>
</xsl:for-each>
</xsl:attribute>
</xsl:template>
xsl:attribute . . a , , href , .. .
<xsl:for-each select="ancestor-or-self::item">
, . ancestor-or-self::item - . dir , .. -.
, - , . , .
UPD:
. , :
parser.proc.ru/iso/xslt-1.zip
( ) Apache.
XML- /xsl/document.xml
- ( ). :
Lang - . . Id - .
<lang_table>
- , .
- :
- ( ):
<item id="0" parent_id="0" is_published="1" section="1">
- . :
Id - . Parent_id - . Is_published - . Dir - uri- . . Section - . .
- .
CMS : :
Html - . , . Com - -. , CMS: , , ..
XSL- , . .
CMS , :
:
Id - .
Container - - ( ).
Sorting - .
Type - :
Com - -
Html - .
Method - .
Title - .
DTD ( ):
<!DOCTYPE site_page [
<!ENTITY nbsp " ">
<!ENTITY sect "§" >
<!ENTITY copy "©">
<!ENTITY laquo "«">
<!ENTITY reg "®">
<!ENTITY deg "°">
<!ENTITY plusmn "±">
<!ENTITY para "¶">
<!ENTITY raquo "»">
<!ENTITY times "×">
<!ENTITY bull "•">
<!ENTITY hellip "…">
<!ENTITY ndash "–">
<!ENTITY mdash "—">
<!ENTITY lsquo "'">
<!ENTITY rsquo "'">
<!ENTITY sbquo "‚">
<!ENTITY ldquo "“">
<!ENTITY rdquo "”">
<!ENTITY bdquo "„">
<!ENTITY lsaquo "‹">
<!ENTITY rsaquo "›" >
<!ENTITY euro "€">
]>
XML- . <?xml version="1.0" encoding="windows-1251"?>
.
XHML-
XSL- XHTML- ( ). XHTML-, , .
.
XHML- , , :
( ). - , . / .
HTML-:
...
...
...
...
...
XSL-
XSL- :
<xsl:stylesheet version = '1.0' encoding="UTF-8"?>
<xsl:template match="element">
</xsl:template>
</xsl:stylesheet>
: <xsl:stylesheet version = '1.0' encoding="UTF-8"?>
- XML- . UTF-8 ( , ).
<xsl:stylesheet> </xsl:stylesheet>
- XSL-.
<xsl:template match="element"> </xsl:template>
- element.
:
<xsl:template match="element"></xsl:template>
- , element . element . <xsl:template match="element" mode="mode1"></xsl:template>
- , element mode1 . element . <xsl:template name="template-name"></xsl:template>
- template-name . - XML- .
XML- (, XML-, item ), " " :
<xsl:template match="navigation/sections/item"></xsl:template>
, , .., , , , .. navigation , navigation/sections/item sections/item .
, - . , xsl- . .
xsl .
, ( ) :
template_folder - . , my_template . dtd - . . lang - ( ). mod - .
xsl/my_template , layout.xsl :
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE xsl:stylesheet SYSTEM "../dtd/entities.dtd">
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:template match="/node()">
</xsl:template>
</xsl:stylesheet>
:
<xsl:template match="/node()"> </xsl:template>
- /node() (). /node() //document , .. .
XHTML- <xsl:template match="/node()"></xsl:template>
XML- . , XSL- XML- XHTML- .
, XSL template.xsl (, template - ), :
<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:import href=" my_template /layout.xsl"/>
</xsl:stylesheet>
:
<xsl:import href="my_template/layout.xsl"/>
XSL- ( XSL- ) . .
, .. XML- .
- .
, XML- :
<item id="0" parent_id="0" is_published="1" section="1">
/
<item id="1" parent_id="0" is_published="1" section="1" hit="yes">
news
:
id document - id . hit item - , , " ".
, , :
sections - . item - .
, , item item , , :
1. xsl/my_template navigation.xsl :
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE xsl:stylesheet SYSTEM "../dtd/entities.dtd">
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:template match="sections" mode="global_menu">
</xsl:template>
</xsl:stylesheet>
2. layout.xsl :
<xsl:template match="sections" mode="global_menu">
</xsl:template>
3. … layout.xsl :
<xsl:apply-templates select="navigation/sections" mode="global_menu"/>
:
select="navigation/sections" - ( ) - . , navigation/sections .
mode="global_menu" - global_menu . , , , " ", - .
4. , layout.xsl navigation.xsl :
<xsl:import href="navigation.xsl"/>
5. , navigation.xsl , :
<xsl:template match="item" mode="global_menu">
<xsl:call-template name="href_attribute"/>
<xsl:value-of select="title"/>
</xsl:template>
:
<xsl:call-template name="href_attribute"/>
- . , .. .
<xsl:value-of select="title"/>
- - title . @ - .
6. sections :
<xsl:template match="sections" mode="global_menu">
</xsl:template>
:
<xsl:apply-templates select="item" mode="global_menu"/>
- item sections . , item item ( sections/item/item ) , .. .
item ( ) . , : <xsl:call-template name="href_attribute"/>
uri- . .
7. ,
, . item :
<xsl:template match="item" mode="global_menu">
<xsl:choose>
<xsl:when test="descendant-or-self::*/@id = /node()/@id">
<xsl:value-of select="title"/>
</xsl:when>
<xsl:otherwise>
<xsl:call-template name="href_attribute"/>
<xsl:value-of select="title"/>
</xsl:otherwise>
</xsl:choose>
</xsl:template>
:
<xsl:choose>
<xsl:when></xsl:when>
<xsl:otherwise></xsl:otherwise>
</xsl:choose>
…, , XML- . : <xsl:when test="descendant-or-self::*/@id = /node()/@id">
ID ( document ) ( item ), , .
<xsl:when></xsl:when>
, . <xsl:otherwise></xsl:otherwise>
- .
8. , href_attribute :
<xsl:template name="href_attribute">
<xsl:attribute name="href">
<xsl:text>/</xsl:text>
<xsl:for-each select="ancestor-or-self::item">
<xsl:value-of select="dir"/>
<xsl:text>/</xsl:text>
</xsl:for-each>
</xsl:attribute>
</xsl:template>
xsl:attribute . . a , , href , .. .
<xsl:for-each select="ancestor-or-self::item">
, . ancestor-or-self::item - . dir , .. -.
, - , . , .
UPD:
. , :
parser.proc.ru/iso/xslt-1.zip
( ) Apache.
XML- /xsl/document.xml
- ( ). :
Lang - . . Id - .
<lang_table>
- , .
- :
- ( ):
<item id="0" parent_id="0" is_published="1" section="1">
- . :
Id - . Parent_id - . Is_published - . Dir - uri- . . Section - . .
- .
CMS : :
Html - . , . Com - -. , CMS: , , ..
XSL- , . .
CMS , :
:
Id - .
Container - - ( ).
Sorting - .
Type - :
Com - -
Html - .
Method - .
Title - .
DTD ( ):
<!DOCTYPE site_page [
<!ENTITY nbsp " ">
<!ENTITY sect "§" >
<!ENTITY copy "©">
<!ENTITY laquo "«">
<!ENTITY reg "®">
<!ENTITY deg "°">
<!ENTITY plusmn "±">
<!ENTITY para "¶">
<!ENTITY raquo "»">
<!ENTITY times "×">
<!ENTITY bull "•">
<!ENTITY hellip "…">
<!ENTITY ndash "–">
<!ENTITY mdash "—">
<!ENTITY lsquo "'">
<!ENTITY rsquo "'">
<!ENTITY sbquo "‚">
<!ENTITY ldquo "“">
<!ENTITY rdquo "”">
<!ENTITY bdquo "„">
<!ENTITY lsaquo "‹">
<!ENTITY rsaquo "›" >
<!ENTITY euro "€">
]>
XML- . <?xml version="1.0" encoding="windows-1251"?>
.
XHML-
XSL- XHTML- ( ). XHTML-, , .
.
XHML- , , :
( ). - , . / .
HTML-:
...
...
...
...
...
XSL-
XSL- :
<xsl:stylesheet version = '1.0' encoding="UTF-8"?>
<xsl:template match="element">
</xsl:template>
</xsl:stylesheet>
: <xsl:stylesheet version = '1.0' encoding="UTF-8"?>
- XML- . UTF-8 ( , ).
<xsl:stylesheet> </xsl:stylesheet>
- XSL-.
<xsl:template match="element"> </xsl:template>
- element.
:
<xsl:template match="element"></xsl:template>
- , element . element . <xsl:template match="element" mode="mode1"></xsl:template>
- , element mode1 . element . <xsl:template name="template-name"></xsl:template>
- template-name . - XML- .
XML- (, XML-, item ), " " :
<xsl:template match="navigation/sections/item"></xsl:template>
, , .., , , , .. navigation , navigation/sections/item sections/item .
, - . , xsl- . .
xsl .
, ( ) :
template_folder - . , my_template . dtd - . . lang - ( ). mod - .
xsl/my_template , layout.xsl :
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE xsl:stylesheet SYSTEM "../dtd/entities.dtd">
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:template match="/node()">
</xsl:template>
</xsl:stylesheet>
:
<xsl:template match="/node()"> </xsl:template>
- /node() (). /node() //document , .. .
XHTML- <xsl:template match="/node()"></xsl:template>
XML- . , XSL- XML- XHTML- .
, XSL template.xsl (, template - ), :
<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:import href=" my_template /layout.xsl"/>
</xsl:stylesheet>
:
<xsl:import href="my_template/layout.xsl"/>
XSL- ( XSL- ) . .
, .. XML- .
- .
, XML- :
<item id="0" parent_id="0" is_published="1" section="1">
/
<item id="1" parent_id="0" is_published="1" section="1" hit="yes">
news
:
id document - id . hit item - , , " ".
, , :
sections - . item - .
, , item item , , :
1. xsl/my_template navigation.xsl :
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE xsl:stylesheet SYSTEM "../dtd/entities.dtd">
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:template match="sections" mode="global_menu">
</xsl:template>
</xsl:stylesheet>
2. layout.xsl :
<xsl:template match="sections" mode="global_menu">
</xsl:template>
3. … layout.xsl :
<xsl:apply-templates select="navigation/sections" mode="global_menu"/>
:
select="navigation/sections" - ( ) - . , navigation/sections .
mode="global_menu" - global_menu . , , , " ", - .
4. , layout.xsl navigation.xsl :
<xsl:import href="navigation.xsl"/>
5. , navigation.xsl , :
<xsl:template match="item" mode="global_menu">
<xsl:call-template name="href_attribute"/>
<xsl:value-of select="title"/>
</xsl:template>
:
<xsl:call-template name="href_attribute"/>
- . , .. .
<xsl:value-of select="title"/>
- - title . @ - .
6. sections :
<xsl:template match="sections" mode="global_menu">
</xsl:template>
:
<xsl:apply-templates select="item" mode="global_menu"/>
- item sections . , item item ( sections/item/item ) , .. .
item ( ) . , : <xsl:call-template name="href_attribute"/>
uri- . .
7. ,
, . item :
<xsl:template match="item" mode="global_menu">
<xsl:choose>
<xsl:when test="descendant-or-self::*/@id = /node()/@id">
<xsl:value-of select="title"/>
</xsl:when>
<xsl:otherwise>
<xsl:call-template name="href_attribute"/>
<xsl:value-of select="title"/>
</xsl:otherwise>
</xsl:choose>
</xsl:template>
:
<xsl:choose>
<xsl:when></xsl:when>
<xsl:otherwise></xsl:otherwise>
</xsl:choose>
…, , XML- . : <xsl:when test="descendant-or-self::*/@id = /node()/@id">
ID ( document ) ( item ), , .
<xsl:when></xsl:when>
, . <xsl:otherwise></xsl:otherwise>
- .
8. , href_attribute :
<xsl:template name="href_attribute">
<xsl:attribute name="href">
<xsl:text>/</xsl:text>
<xsl:for-each select="ancestor-or-self::item">
<xsl:value-of select="dir"/>
<xsl:text>/</xsl:text>
</xsl:for-each>
</xsl:attribute>
</xsl:template>
xsl:attribute . . a , , href , .. .
<xsl:for-each select="ancestor-or-self::item">
, . ancestor-or-self::item - . dir , .. -.
, - , . , .
UPD:
. , :
parser.proc.ru/iso/xslt-1.zip
( ) Apache.
XML- /xsl/document.xml
- ( ). :
Lang - . . Id - .
<lang_table>
- , .
- :
- ( ):
<item id="0" parent_id="0" is_published="1" section="1">
- . :
Id - . Parent_id - . Is_published - . Dir - uri- . . Section - . .
- .
CMS : :
Html - . , . Com - -. , CMS: , , ..
XSL- , . .
CMS , :
:
Id - .
Container - - ( ).
Sorting - .
Type - :
Com - -
Html - .
Method - .
Title - .
DTD ( ):
<!DOCTYPE site_page [
<!ENTITY nbsp " ">
<!ENTITY sect "§" >
<!ENTITY copy "©">
<!ENTITY laquo "«">
<!ENTITY reg "®">
<!ENTITY deg "°">
<!ENTITY plusmn "±">
<!ENTITY para "¶">
<!ENTITY raquo "»">
<!ENTITY times "×">
<!ENTITY bull "•">
<!ENTITY hellip "…">
<!ENTITY ndash "–">
<!ENTITY mdash "—">
<!ENTITY lsquo "'">
<!ENTITY rsquo "'">
<!ENTITY sbquo "‚">
<!ENTITY ldquo "“">
<!ENTITY rdquo "”">
<!ENTITY bdquo "„">
<!ENTITY lsaquo "‹">
<!ENTITY rsaquo "›" >
<!ENTITY euro "€">
]>
XML- . <?xml version="1.0" encoding="windows-1251"?>
.
XHML-
XSL- XHTML- ( ). XHTML-, , .
.
XHML- , , :
( ). - , . / .
HTML-:
...
...
...
...
...
XSL-
XSL- :
<xsl:stylesheet version = '1.0' encoding="UTF-8"?>
<xsl:template match="element">
</xsl:template>
</xsl:stylesheet>
: <xsl:stylesheet version = '1.0' encoding="UTF-8"?>
- XML- . UTF-8 ( , ).
<xsl:stylesheet> </xsl:stylesheet>
- XSL-.
<xsl:template match="element"> </xsl:template>
- element.
:
<xsl:template match="element"></xsl:template>
- , element . element . <xsl:template match="element" mode="mode1"></xsl:template>
- , element mode1 . element . <xsl:template name="template-name"></xsl:template>
- template-name . - XML- .
XML- (, XML-, item ), " " :
<xsl:template match="navigation/sections/item"></xsl:template>
, , .., , , , .. navigation , navigation/sections/item sections/item .
, - . , xsl- . .
xsl .
, ( ) :
template_folder - . , my_template . dtd - . . lang - ( ). mod - .
xsl/my_template , layout.xsl :
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE xsl:stylesheet SYSTEM "../dtd/entities.dtd">
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:template match="/node()">
</xsl:template>
</xsl:stylesheet>
:
<xsl:template match="/node()"> </xsl:template>
- /node() (). /node() //document , .. .
XHTML- <xsl:template match="/node()"></xsl:template>
XML- . , XSL- XML- XHTML- .
, XSL template.xsl (, template - ), :
<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:import href=" my_template /layout.xsl"/>
</xsl:stylesheet>
:
<xsl:import href="my_template/layout.xsl"/>
XSL- ( XSL- ) . .
, .. XML- .
- .
, XML- :
<item id="0" parent_id="0" is_published="1" section="1">
/
<item id="1" parent_id="0" is_published="1" section="1" hit="yes">
news
:
id document - id . hit item - , , " ".
, , :
sections - . item - .
, , item item , , :
1. xsl/my_template navigation.xsl :
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE xsl:stylesheet SYSTEM "../dtd/entities.dtd">
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:template match="sections" mode="global_menu">
</xsl:template>
</xsl:stylesheet>
2. layout.xsl :
<xsl:template match="sections" mode="global_menu">
</xsl:template>
3. … layout.xsl :
<xsl:apply-templates select="navigation/sections" mode="global_menu"/>
:
select="navigation/sections" - ( ) - . , navigation/sections .
mode="global_menu" - global_menu . , , , " ", - .
4. , layout.xsl navigation.xsl :
<xsl:import href="navigation.xsl"/>
5. , navigation.xsl , :
<xsl:template match="item" mode="global_menu">
<xsl:call-template name="href_attribute"/>
<xsl:value-of select="title"/>
</xsl:template>
:
<xsl:call-template name="href_attribute"/>
- . , .. .
<xsl:value-of select="title"/>
- - title . @ - .
6. sections :
<xsl:template match="sections" mode="global_menu">
</xsl:template>
:
<xsl:apply-templates select="item" mode="global_menu"/>
- item sections . , item item ( sections/item/item ) , .. .
item ( ) . , : <xsl:call-template name="href_attribute"/>
uri- . .
7. ,
, . item :
<xsl:template match="item" mode="global_menu">
<xsl:choose>
<xsl:when test="descendant-or-self::*/@id = /node()/@id">
<xsl:value-of select="title"/>
</xsl:when>
<xsl:otherwise>
<xsl:call-template name="href_attribute"/>
<xsl:value-of select="title"/>
</xsl:otherwise>
</xsl:choose>
</xsl:template>
:
<xsl:choose>
<xsl:when></xsl:when>
<xsl:otherwise></xsl:otherwise>
</xsl:choose>
…, , XML- . : <xsl:when test="descendant-or-self::*/@id = /node()/@id">
ID ( document ) ( item ), , .
<xsl:when></xsl:when>
, . <xsl:otherwise></xsl:otherwise>
- .
8. , href_attribute :
<xsl:template name="href_attribute">
<xsl:attribute name="href">
<xsl:text>/</xsl:text>
<xsl:for-each select="ancestor-or-self::item">
<xsl:value-of select="dir"/>
<xsl:text>/</xsl:text>
</xsl:for-each>
</xsl:attribute>
</xsl:template>
xsl:attribute . . a , , href , .. .
<xsl:for-each select="ancestor-or-self::item">
, . ancestor-or-self::item - . dir , .. -.
, - , . , .
UPD:
. , :
parser.proc.ru/iso/xslt-1.zip
( ) Apache.
XML- /xsl/document.xml
- ( ). :
Lang - . . Id - .
<lang_table>
- , .
- :
- ( ):
<item id="0" parent_id="0" is_published="1" section="1">
- . :
Id - . Parent_id - . Is_published - . Dir - uri- . . Section - . .
- .
CMS : :
Html - . , . Com - -. , CMS: , , ..
XSL- , . .
CMS , :
:
Id - .
Container - - ( ).
Sorting - .
Type - :
Com - -
Html - .
Method - .
Title - .
DTD ( ):
<!DOCTYPE site_page [
<!ENTITY nbsp " ">
<!ENTITY sect "§" >
<!ENTITY copy "©">
<!ENTITY laquo "«">
<!ENTITY reg "®">
<!ENTITY deg "°">
<!ENTITY plusmn "±">
<!ENTITY para "¶">
<!ENTITY raquo "»">
<!ENTITY times "×">
<!ENTITY bull "•">
<!ENTITY hellip "…">
<!ENTITY ndash "–">
<!ENTITY mdash "—">
<!ENTITY lsquo "'">
<!ENTITY rsquo "'">
<!ENTITY sbquo "‚">
<!ENTITY ldquo "“">
<!ENTITY rdquo "”">
<!ENTITY bdquo "„">
<!ENTITY lsaquo "‹">
<!ENTITY rsaquo "›" >
<!ENTITY euro "€">
]>
XML- . <?xml version="1.0" encoding="windows-1251"?>
.
XHML-
XSL- XHTML- ( ). XHTML-, , .
.
XHML- , , :
( ). - , . / .
HTML-:
...
...
...
...
...
XSL-
XSL- :
<xsl:stylesheet version = '1.0' encoding="UTF-8"?>
<xsl:template match="element">
</xsl:template>
</xsl:stylesheet>
: <xsl:stylesheet version = '1.0' encoding="UTF-8"?>
- XML- . UTF-8 ( , ).
<xsl:stylesheet> </xsl:stylesheet>
- XSL-.
<xsl:template match="element"> </xsl:template>
- element.
:
<xsl:template match="element"></xsl:template>
- , element . element . <xsl:template match="element" mode="mode1"></xsl:template>
- , element mode1 . element . <xsl:template name="template-name"></xsl:template>
- template-name . - XML- .
XML- (, XML-, item ), " " :
<xsl:template match="navigation/sections/item"></xsl:template>
, , .., , , , .. navigation , navigation/sections/item sections/item .
, - . , xsl- . .
xsl .
, ( ) :
template_folder - . , my_template . dtd - . . lang - ( ). mod - .
xsl/my_template , layout.xsl :
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE xsl:stylesheet SYSTEM "../dtd/entities.dtd">
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:template match="/node()">
</xsl:template>
</xsl:stylesheet>
:
<xsl:template match="/node()"> </xsl:template>
- /node() (). /node() //document , .. .
XHTML- <xsl:template match="/node()"></xsl:template>
XML- . , XSL- XML- XHTML- .
, XSL template.xsl (, template - ), :
<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:import href=" my_template /layout.xsl"/>
</xsl:stylesheet>
:
<xsl:import href="my_template/layout.xsl"/>
XSL- ( XSL- ) . .
, .. XML- .
- .
, XML- :
<item id="0" parent_id="0" is_published="1" section="1">
/
<item id="1" parent_id="0" is_published="1" section="1" hit="yes">
news
:
id document - id . hit item - , , " ".
, , :
sections - . item - .
, , item item , , :
1. xsl/my_template navigation.xsl :
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE xsl:stylesheet SYSTEM "../dtd/entities.dtd">
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:template match="sections" mode="global_menu">
</xsl:template>
</xsl:stylesheet>
2. layout.xsl :
<xsl:template match="sections" mode="global_menu">
</xsl:template>
3. … layout.xsl :
<xsl:apply-templates select="navigation/sections" mode="global_menu"/>
:
select="navigation/sections" - ( ) - . , navigation/sections .
mode="global_menu" - global_menu . , , , " ", - .
4. , layout.xsl navigation.xsl :
<xsl:import href="navigation.xsl"/>
5. , navigation.xsl , :
<xsl:template match="item" mode="global_menu">
<xsl:call-template name="href_attribute"/>
<xsl:value-of select="title"/>
</xsl:template>
:
<xsl:call-template name="href_attribute"/>
- . , .. .
<xsl:value-of select="title"/>
- - title . @ - .
6. sections :
<xsl:template match="sections" mode="global_menu">
</xsl:template>
:
<xsl:apply-templates select="item" mode="global_menu"/>
- item sections . , item item ( sections/item/item ) , .. .
item ( ) . , : <xsl:call-template name="href_attribute"/>
uri- . .
7. ,
, . item :
<xsl:template match="item" mode="global_menu">
<xsl:choose>
<xsl:when test="descendant-or-self::*/@id = /node()/@id">
<xsl:value-of select="title"/>
</xsl:when>
<xsl:otherwise>
<xsl:call-template name="href_attribute"/>
<xsl:value-of select="title"/>
</xsl:otherwise>
</xsl:choose>
</xsl:template>
:
<xsl:choose>
<xsl:when></xsl:when>
<xsl:otherwise></xsl:otherwise>
</xsl:choose>
…, , XML- . : <xsl:when test="descendant-or-self::*/@id = /node()/@id">
ID ( document ) ( item ), , .
<xsl:when></xsl:when>
, . <xsl:otherwise></xsl:otherwise>
- .
8. , href_attribute :
<xsl:template name="href_attribute">
<xsl:attribute name="href">
<xsl:text>/</xsl:text>
<xsl:for-each select="ancestor-or-self::item">
<xsl:value-of select="dir"/>
<xsl:text>/</xsl:text>
</xsl:for-each>
</xsl:attribute>
</xsl:template>
xsl:attribute . . a , , href , .. .
<xsl:for-each select="ancestor-or-self::item">
, . ancestor-or-self::item - . dir , .. -.
, - , . , .
UPD:
. , :
parser.proc.ru/iso/xslt-1.zip
( ) Apache.
XML- /xsl/document.xml
- ( ). :
Lang - . . Id - .
<lang_table>
- , .
- :
- ( ):
<item id="0" parent_id="0" is_published="1" section="1">
- . :
Id - . Parent_id - . Is_published - . Dir - uri- . . Section - . .
- .
CMS : :
Html - . , . Com - -. , CMS: , , ..
XSL- , . .
CMS , :
:
Id - .
Container - - ( ).
Sorting - .
Type - :
Com - -
Html - .
Method - .
Title - .
DTD ( ):
<!DOCTYPE site_page [
<!ENTITY nbsp " ">
<!ENTITY sect "§" >
<!ENTITY copy "©">
<!ENTITY laquo "«">
<!ENTITY reg "®">
<!ENTITY deg "°">
<!ENTITY plusmn "±">
<!ENTITY para "¶">
<!ENTITY raquo "»">
<!ENTITY times "×">
<!ENTITY bull "•">
<!ENTITY hellip "…">
<!ENTITY ndash "–">
<!ENTITY mdash "—">
<!ENTITY lsquo "'">
<!ENTITY rsquo "'">
<!ENTITY sbquo "‚">
<!ENTITY ldquo "“">
<!ENTITY rdquo "”">
<!ENTITY bdquo "„">
<!ENTITY lsaquo "‹">
<!ENTITY rsaquo "›" >
<!ENTITY euro "€">
]>
XML- . <?xml version="1.0" encoding="windows-1251"?>
.
XHML-
XSL- XHTML- ( ). XHTML-, , .
.
XHML- , , :
( ). - , . / .
HTML-:
...
...
...
...
...
XSL-
XSL- :
<xsl:stylesheet version = '1.0' encoding="UTF-8"?>
<xsl:template match="element">
</xsl:template>
</xsl:stylesheet>
: <xsl:stylesheet version = '1.0' encoding="UTF-8"?>
- XML- . UTF-8 ( , ).
<xsl:stylesheet> </xsl:stylesheet>
- XSL-.
<xsl:template match="element"> </xsl:template>
- element.
:
<xsl:template match="element"></xsl:template>
- , element . element . <xsl:template match="element" mode="mode1"></xsl:template>
- , element mode1 . element . <xsl:template name="template-name"></xsl:template>
- template-name . - XML- .
XML- (, XML-, item ), " " :
<xsl:template match="navigation/sections/item"></xsl:template>
, , .., , , , .. navigation , navigation/sections/item sections/item .
, - . , xsl- . .
xsl .
, ( ) :
template_folder - . , my_template . dtd - . . lang - ( ). mod - .
xsl/my_template , layout.xsl :
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE xsl:stylesheet SYSTEM "../dtd/entities.dtd">
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:template match="/node()">
</xsl:template>
</xsl:stylesheet>
:
<xsl:template match="/node()"> </xsl:template>
- /node() (). /node() //document , .. .
XHTML- <xsl:template match="/node()"></xsl:template>
XML- . , XSL- XML- XHTML- .
, XSL template.xsl (, template - ), :
<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:import href=" my_template /layout.xsl"/>
</xsl:stylesheet>
:
<xsl:import href="my_template/layout.xsl"/>
XSL- ( XSL- ) . .
, .. XML- .
- .
, XML- :
<item id="0" parent_id="0" is_published="1" section="1">
/
<item id="1" parent_id="0" is_published="1" section="1" hit="yes">
news
:
id document - id . hit item - , , " ".
, , :
sections - . item - .
, , item item , , :
1. xsl/my_template navigation.xsl :
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE xsl:stylesheet SYSTEM "../dtd/entities.dtd">
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:template match="sections" mode="global_menu">
</xsl:template>
</xsl:stylesheet>
2. layout.xsl :
<xsl:template match="sections" mode="global_menu">
</xsl:template>
3. … layout.xsl :
<xsl:apply-templates select="navigation/sections" mode="global_menu"/>
:
select="navigation/sections" - ( ) - . , navigation/sections .
mode="global_menu" - global_menu . , , , " ", - .
4. , layout.xsl navigation.xsl :
<xsl:import href="navigation.xsl"/>
5. , navigation.xsl , :
<xsl:template match="item" mode="global_menu">
<xsl:call-template name="href_attribute"/>
<xsl:value-of select="title"/>
</xsl:template>
:
<xsl:call-template name="href_attribute"/>
- . , .. .
<xsl:value-of select="title"/>
- - title . @ - .
6. sections :
<xsl:template match="sections" mode="global_menu">
</xsl:template>
:
<xsl:apply-templates select="item" mode="global_menu"/>
- item sections . , item item ( sections/item/item ) , .. .
item ( ) . , : <xsl:call-template name="href_attribute"/>
uri- . .
7. ,
, . item :
<xsl:template match="item" mode="global_menu">
<xsl:choose>
<xsl:when test="descendant-or-self::*/@id = /node()/@id">
<xsl:value-of select="title"/>
</xsl:when>
<xsl:otherwise>
<xsl:call-template name="href_attribute"/>
<xsl:value-of select="title"/>
</xsl:otherwise>
</xsl:choose>
</xsl:template>
:
<xsl:choose>
<xsl:when></xsl:when>
<xsl:otherwise></xsl:otherwise>
</xsl:choose>
…, , XML- . : <xsl:when test="descendant-or-self::*/@id = /node()/@id">
ID ( document ) ( item ), , .
<xsl:when></xsl:when>
, . <xsl:otherwise></xsl:otherwise>
- .
8. , href_attribute :
<xsl:template name="href_attribute">
<xsl:attribute name="href">
<xsl:text>/</xsl:text>
<xsl:for-each select="ancestor-or-self::item">
<xsl:value-of select="dir"/>
<xsl:text>/</xsl:text>
</xsl:for-each>
</xsl:attribute>
</xsl:template>
xsl:attribute . . a , , href , .. .
<xsl:for-each select="ancestor-or-self::item">
, . ancestor-or-self::item - . dir , .. -.
, - , . , .
UPD:
. , :
parser.proc.ru/iso/xslt-1.zip
( ) Apache.
XML- /xsl/document.xml
- ( ). :
Lang - . . Id - .
<lang_table>
- , .
- :
- ( ):
<item id="0" parent_id="0" is_published="1" section="1">
- . :
Id - . Parent_id - . Is_published - . Dir - uri- . . Section - . .
- .
CMS : :
Html - . , . Com - -. , CMS: , , ..
XSL- , . .
CMS , :
:
Id - .
Container - - ( ).
Sorting - .
Type - :
Com - -
Html - .
Method - .
Title - .
DTD ( ):
<!DOCTYPE site_page [
<!ENTITY nbsp " ">
<!ENTITY sect "§" >
<!ENTITY copy "©">
<!ENTITY laquo "«">
<!ENTITY reg "®">
<!ENTITY deg "°">
<!ENTITY plusmn "±">
<!ENTITY para "¶">
<!ENTITY raquo "»">
<!ENTITY times "×">
<!ENTITY bull "•">
<!ENTITY hellip "…">
<!ENTITY ndash "–">
<!ENTITY mdash "—">
<!ENTITY lsquo "'">
<!ENTITY rsquo "'">
<!ENTITY sbquo "‚">
<!ENTITY ldquo "“">
<!ENTITY rdquo "”">
<!ENTITY bdquo "„">
<!ENTITY lsaquo "‹">
<!ENTITY rsaquo "›" >
<!ENTITY euro "€">
]>
XML- . <?xml version="1.0" encoding="windows-1251"?>
.
XHML-
XSL- XHTML- ( ). XHTML-, , .
.
XHML- , , :
( ). - , . / .
HTML-:
...
...
...
...
...
XSL-
XSL- :
<xsl:stylesheet version = '1.0' encoding="UTF-8"?>
<xsl:template match="element">
</xsl:template>
</xsl:stylesheet>
: <xsl:stylesheet version = '1.0' encoding="UTF-8"?>
- XML- . UTF-8 ( , ).
<xsl:stylesheet> </xsl:stylesheet>
- XSL-.
<xsl:template match="element"> </xsl:template>
- element.
:
<xsl:template match="element"></xsl:template>
- , element . element . <xsl:template match="element" mode="mode1"></xsl:template>
- , element mode1 . element . <xsl:template name="template-name"></xsl:template>
- template-name . - XML- .
XML- (, XML-, item ), " " :
<xsl:template match="navigation/sections/item"></xsl:template>
, , .., , , , .. navigation , navigation/sections/item sections/item .
, - . , xsl- . .
xsl .
, ( ) :
template_folder - . , my_template . dtd - . . lang - ( ). mod - .
xsl/my_template , layout.xsl :
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE xsl:stylesheet SYSTEM "../dtd/entities.dtd">
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:template match="/node()">
</xsl:template>
</xsl:stylesheet>
:
<xsl:template match="/node()"> </xsl:template>
- /node() (). /node() //document , .. .
XHTML- <xsl:template match="/node()"></xsl:template>
XML- . , XSL- XML- XHTML- .
, XSL template.xsl (, template - ), :
<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:import href=" my_template /layout.xsl"/>
</xsl:stylesheet>
:
<xsl:import href="my_template/layout.xsl"/>
XSL- ( XSL- ) . .
, .. XML- .
- .
, XML- :
<item id="0" parent_id="0" is_published="1" section="1">
/
<item id="1" parent_id="0" is_published="1" section="1" hit="yes">
news
:
id document - id . hit item - , , " ".
, , :
sections - . item - .
, , item item , , :
1. xsl/my_template navigation.xsl :
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE xsl:stylesheet SYSTEM "../dtd/entities.dtd">
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:template match="sections" mode="global_menu">
</xsl:template>
</xsl:stylesheet>
2. layout.xsl :
<xsl:template match="sections" mode="global_menu">
</xsl:template>
3. … layout.xsl :
<xsl:apply-templates select="navigation/sections" mode="global_menu"/>
:
select="navigation/sections" - ( ) - . , navigation/sections .
mode="global_menu" - global_menu . , , , " ", - .
4. , layout.xsl navigation.xsl :
<xsl:import href="navigation.xsl"/>
5. , navigation.xsl , :
<xsl:template match="item" mode="global_menu">
<xsl:call-template name="href_attribute"/>
<xsl:value-of select="title"/>
</xsl:template>
:
<xsl:call-template name="href_attribute"/>
- . , .. .
<xsl:value-of select="title"/>
- - title . @ - .
6. sections :
<xsl:template match="sections" mode="global_menu">
</xsl:template>
:
<xsl:apply-templates select="item" mode="global_menu"/>
- item sections . , item item ( sections/item/item ) , .. .
item ( ) . , : <xsl:call-template name="href_attribute"/>
uri- . .
7. ,
, . item :
<xsl:template match="item" mode="global_menu">
<xsl:choose>
<xsl:when test="descendant-or-self::*/@id = /node()/@id">
<xsl:value-of select="title"/>
</xsl:when>
<xsl:otherwise>
<xsl:call-template name="href_attribute"/>
<xsl:value-of select="title"/>
</xsl:otherwise>
</xsl:choose>
</xsl:template>
:
<xsl:choose>
<xsl:when></xsl:when>
<xsl:otherwise></xsl:otherwise>
</xsl:choose>
…, , XML- . : <xsl:when test="descendant-or-self::*/@id = /node()/@id">
ID ( document ) ( item ), , .
<xsl:when></xsl:when>
, . <xsl:otherwise></xsl:otherwise>
- .
8. , href_attribute :
<xsl:template name="href_attribute">
<xsl:attribute name="href">
<xsl:text>/</xsl:text>
<xsl:for-each select="ancestor-or-self::item">
<xsl:value-of select="dir"/>
<xsl:text>/</xsl:text>
</xsl:for-each>
</xsl:attribute>
</xsl:template>
xsl:attribute . . a , , href , .. .
<xsl:for-each select="ancestor-or-self::item">
, . ancestor-or-self::item - . dir , .. -.
, - , . , .
UPD:
. , :
parser.proc.ru/iso/xslt-1.zip
( ) Apache.
XML- /xsl/document.xml
- ( ). :
Lang - . . Id - .
<lang_table>
- , .
- :
- ( ):
<item id="0" parent_id="0" is_published="1" section="1">
- . :
Id - . Parent_id - . Is_published - . Dir - uri- . . Section - . .
- .
CMS : :
Html - . , . Com - -. , CMS: , , ..
XSL- , . .
CMS , :
:
Id - .
Container - - ( ).
Sorting - .
Type - :
Com - -
Html - .
Method - .
Title - .
DTD ( ):
<!DOCTYPE site_page [
<!ENTITY nbsp " ">
<!ENTITY sect "§" >
<!ENTITY copy "©">
<!ENTITY laquo "«">
<!ENTITY reg "®">
<!ENTITY deg "°">
<!ENTITY plusmn "±">
<!ENTITY para "¶">
<!ENTITY raquo "»">
<!ENTITY times "×">
<!ENTITY bull "•">
<!ENTITY hellip "…">
<!ENTITY ndash "–">
<!ENTITY mdash "—">
<!ENTITY lsquo "'">
<!ENTITY rsquo "'">
<!ENTITY sbquo "‚">
<!ENTITY ldquo "“">
<!ENTITY rdquo "”">
<!ENTITY bdquo "„">
<!ENTITY lsaquo "‹">
<!ENTITY rsaquo "›" >
<!ENTITY euro "€">
]>
XML- . <?xml version="1.0" encoding="windows-1251"?>
.
XHML-
XSL- XHTML- ( ). XHTML-, , .
.
XHML- , , :
( ). - , . / .
HTML-:
...
...
...
...
...
XSL-
XSL- :
<xsl:stylesheet version = '1.0' encoding="UTF-8"?>
<xsl:template match="element">
</xsl:template>
</xsl:stylesheet>
: <xsl:stylesheet version = '1.0' encoding="UTF-8"?>
- XML- . UTF-8 ( , ).
<xsl:stylesheet> </xsl:stylesheet>
- XSL-.
<xsl:template match="element"> </xsl:template>
- element.
:
<xsl:template match="element"></xsl:template>
- , element . element . <xsl:template match="element" mode="mode1"></xsl:template>
- , element mode1 . element . <xsl:template name="template-name"></xsl:template>
- template-name . - XML- .
XML- (, XML-, item ), " " :
<xsl:template match="navigation/sections/item"></xsl:template>
, , .., , , , .. navigation , navigation/sections/item sections/item .
, - . , xsl- . .
xsl .
, ( ) :
template_folder - . , my_template . dtd - . . lang - ( ). mod - .
xsl/my_template , layout.xsl :
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE xsl:stylesheet SYSTEM "../dtd/entities.dtd">
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:template match="/node()">
</xsl:template>
</xsl:stylesheet>
:
<xsl:template match="/node()"> </xsl:template>
- /node() (). /node() //document , .. .
XHTML- <xsl:template match="/node()"></xsl:template>
XML- . , XSL- XML- XHTML- .
, XSL template.xsl (, template - ), :
<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:import href=" my_template /layout.xsl"/>
</xsl:stylesheet>
:
<xsl:import href="my_template/layout.xsl"/>
XSL- ( XSL- ) . .
, .. XML- .
- .
, XML- :
<item id="0" parent_id="0" is_published="1" section="1">
/
<item id="1" parent_id="0" is_published="1" section="1" hit="yes">
news
:
id document - id . hit item - , , " ".
, , :
sections - . item - .
, , item item , , :
1. xsl/my_template navigation.xsl :
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE xsl:stylesheet SYSTEM "../dtd/entities.dtd">
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:template match="sections" mode="global_menu">
</xsl:template>
</xsl:stylesheet>
2. layout.xsl :
<xsl:template match="sections" mode="global_menu">
</xsl:template>
3. … layout.xsl :
<xsl:apply-templates select="navigation/sections" mode="global_menu"/>
:
select="navigation/sections" - ( ) - . , navigation/sections .
mode="global_menu" - global_menu . , , , " ", - .
4. , layout.xsl navigation.xsl :
<xsl:import href="navigation.xsl"/>
5. , navigation.xsl , :
<xsl:template match="item" mode="global_menu">
<xsl:call-template name="href_attribute"/>
<xsl:value-of select="title"/>
</xsl:template>
:
<xsl:call-template name="href_attribute"/>
- . , .. .
<xsl:value-of select="title"/>
- - title . @ - .
6. sections :
<xsl:template match="sections" mode="global_menu">
</xsl:template>
:
<xsl:apply-templates select="item" mode="global_menu"/>
- item sections . , item item ( sections/item/item ) , .. .
item ( ) . , : <xsl:call-template name="href_attribute"/>
uri- . .
7. ,
, . item :
<xsl:template match="item" mode="global_menu">
<xsl:choose>
<xsl:when test="descendant-or-self::*/@id = /node()/@id">
<xsl:value-of select="title"/>
</xsl:when>
<xsl:otherwise>
<xsl:call-template name="href_attribute"/>
<xsl:value-of select="title"/>
</xsl:otherwise>
</xsl:choose>
</xsl:template>
:
<xsl:choose>
<xsl:when></xsl:when>
<xsl:otherwise></xsl:otherwise>
</xsl:choose>
…, , XML- . : <xsl:when test="descendant-or-self::*/@id = /node()/@id">
ID ( document ) ( item ), , .
<xsl:when></xsl:when>
, . <xsl:otherwise></xsl:otherwise>
- .
8. , href_attribute :
<xsl:template name="href_attribute">
<xsl:attribute name="href">
<xsl:text>/</xsl:text>
<xsl:for-each select="ancestor-or-self::item">
<xsl:value-of select="dir"/>
<xsl:text>/</xsl:text>
</xsl:for-each>
</xsl:attribute>
</xsl:template>
xsl:attribute . . a , , href , .. .
<xsl:for-each select="ancestor-or-self::item">
, . ancestor-or-self::item - . dir , .. -.
, - , . , .
UPD:
. , :
parser.proc.ru/iso/xslt-1.zip
( ) Apache.
XML- /xsl/document.xml
- ( ). :
Lang - . . Id - .
<lang_table>
- , .
- :
- ( ):
<item id="0" parent_id="0" is_published="1" section="1">
- . :
Id - . Parent_id - . Is_published - . Dir - uri- . . Section - . .
- .
CMS : :
Html - . , . Com - -. , CMS: , , ..
XSL- , . .
CMS , :
:
Id - .
Container - - ( ).
Sorting - .
Type - :
Com - -
Html - .
Method - .
Title - .
DTD ( ):
<!DOCTYPE site_page [
<!ENTITY nbsp " ">
<!ENTITY sect "§" >
<!ENTITY copy "©">
<!ENTITY laquo "«">
<!ENTITY reg "®">
<!ENTITY deg "°">
<!ENTITY plusmn "±">
<!ENTITY para "¶">
<!ENTITY raquo "»">
<!ENTITY times "×">
<!ENTITY bull "•">
<!ENTITY hellip "…">
<!ENTITY ndash "–">
<!ENTITY mdash "—">
<!ENTITY lsquo "'">
<!ENTITY rsquo "'">
<!ENTITY sbquo "‚">
<!ENTITY ldquo "“">
<!ENTITY rdquo "”">
<!ENTITY bdquo "„">
<!ENTITY lsaquo "‹">
<!ENTITY rsaquo "›" >
<!ENTITY euro "€">
]>
XML- . <?xml version="1.0" encoding="windows-1251"?>
.
XHML-
XSL- XHTML- ( ). XHTML-, , .
.
XHML- , , :
( ). - , . / .
HTML-:
...
...
...
...
...
XSL-
XSL- :
<xsl:stylesheet version = '1.0' encoding="UTF-8"?>
<xsl:template match="element">
</xsl:template>
</xsl:stylesheet>
: <xsl:stylesheet version = '1.0' encoding="UTF-8"?>
- XML- . UTF-8 ( , ).
<xsl:stylesheet> </xsl:stylesheet>
- XSL-.
<xsl:template match="element"> </xsl:template>
- element.
:
<xsl:template match="element"></xsl:template>
- , element . element . <xsl:template match="element" mode="mode1"></xsl:template>
- , element mode1 . element . <xsl:template name="template-name"></xsl:template>
- template-name . - XML- .
XML- (, XML-, item ), " " :
<xsl:template match="navigation/sections/item"></xsl:template>
, , .., , , , .. navigation , navigation/sections/item sections/item .
, - . , xsl- . .
xsl .
, ( ) :
template_folder - . , my_template . dtd - . . lang - ( ). mod - .
xsl/my_template , layout.xsl :
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE xsl:stylesheet SYSTEM "../dtd/entities.dtd">
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:template match="/node()">
</xsl:template>
</xsl:stylesheet>
:
<xsl:template match="/node()"> </xsl:template>
- /node() (). /node() //document , .. .
XHTML- <xsl:template match="/node()"></xsl:template>
XML- . , XSL- XML- XHTML- .
, XSL template.xsl (, template - ), :
<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:import href=" my_template /layout.xsl"/>
</xsl:stylesheet>
:
<xsl:import href="my_template/layout.xsl"/>
XSL- ( XSL- ) . .
, .. XML- .
- .
, XML- :
<item id="0" parent_id="0" is_published="1" section="1">
/
<item id="1" parent_id="0" is_published="1" section="1" hit="yes">
news
:
id document - id . hit item - , , " ".
, , :
sections - . item - .
, , item item , , :
1. xsl/my_template navigation.xsl :
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE xsl:stylesheet SYSTEM "../dtd/entities.dtd">
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:template match="sections" mode="global_menu">
</xsl:template>
</xsl:stylesheet>
2. layout.xsl :
<xsl:template match="sections" mode="global_menu">
</xsl:template>
3. … layout.xsl :
<xsl:apply-templates select="navigation/sections" mode="global_menu"/>
:
select="navigation/sections" - ( ) - . , navigation/sections .
mode="global_menu" - global_menu . , , , " ", - .
4. , layout.xsl navigation.xsl :
<xsl:import href="navigation.xsl"/>
5. , navigation.xsl , :
<xsl:template match="item" mode="global_menu">
<xsl:call-template name="href_attribute"/>
<xsl:value-of select="title"/>
</xsl:template>
:
<xsl:call-template name="href_attribute"/>
- . , .. .
<xsl:value-of select="title"/>
- - title . @ - .
6. sections :
<xsl:template match="sections" mode="global_menu">
</xsl:template>
:
<xsl:apply-templates select="item" mode="global_menu"/>
- item sections . , item item ( sections/item/item ) , .. .
item ( ) . , : <xsl:call-template name="href_attribute"/>
uri- . .
7. ,
, . item :
<xsl:template match="item" mode="global_menu">
<xsl:choose>
<xsl:when test="descendant-or-self::*/@id = /node()/@id">
<xsl:value-of select="title"/>
</xsl:when>
<xsl:otherwise>
<xsl:call-template name="href_attribute"/>
<xsl:value-of select="title"/>
</xsl:otherwise>
</xsl:choose>
</xsl:template>
:
<xsl:choose>
<xsl:when></xsl:when>
<xsl:otherwise></xsl:otherwise>
</xsl:choose>
…, , XML- . : <xsl:when test="descendant-or-self::*/@id = /node()/@id">
ID ( document ) ( item ), , .
<xsl:when></xsl:when>
, . <xsl:otherwise></xsl:otherwise>
- .
8. , href_attribute :
<xsl:template name="href_attribute">
<xsl:attribute name="href">
<xsl:text>/</xsl:text>
<xsl:for-each select="ancestor-or-self::item">
<xsl:value-of select="dir"/>
<xsl:text>/</xsl:text>
</xsl:for-each>
</xsl:attribute>
</xsl:template>
xsl:attribute . . a , , href , .. .
<xsl:for-each select="ancestor-or-self::item">
, . ancestor-or-self::item - . dir , .. -.
, - , . , .
UPD:
. , :
parser.proc.ru/iso/xslt-1.zip
( ) Apache.
XML- /xsl/document.xml
- ( ). :
Lang - . . Id - .
<lang_table>
- , .
- :
- ( ):
<item id="0" parent_id="0" is_published="1" section="1">
- . :
Id - . Parent_id - . Is_published - . Dir - uri- . . Section - . .
- .
CMS : :
Html - . , . Com - -. , CMS: , , ..
XSL- , . .
CMS , :
:
Id - .
Container - - ( ).
Sorting - .
Type - :
Com - -
Html - .
Method - .
Title - .
DTD ( ):
<!DOCTYPE site_page [
<!ENTITY nbsp " ">
<!ENTITY sect "§" >
<!ENTITY copy "©">
<!ENTITY laquo "«">
<!ENTITY reg "®">
<!ENTITY deg "°">
<!ENTITY plusmn "±">
<!ENTITY para "¶">
<!ENTITY raquo "»">
<!ENTITY times "×">
<!ENTITY bull "•">
<!ENTITY hellip "…">
<!ENTITY ndash "–">
<!ENTITY mdash "—">
<!ENTITY lsquo "'">
<!ENTITY rsquo "'">
<!ENTITY sbquo "‚">
<!ENTITY ldquo "“">
<!ENTITY rdquo "”">
<!ENTITY bdquo "„">
<!ENTITY lsaquo "‹">
<!ENTITY rsaquo "›" >
<!ENTITY euro "€">
]>
XML- . <?xml version="1.0" encoding="windows-1251"?>
.
XHML-
XSL- XHTML- ( ). XHTML-, , .
.
XHML- , , :
( ). - , . / .
HTML-:
...
...
...
...
...
XSL-
XSL- :
<xsl:stylesheet version = '1.0' encoding="UTF-8"?>
<xsl:template match="element">
</xsl:template>
</xsl:stylesheet>
: <xsl:stylesheet version = '1.0' encoding="UTF-8"?>
- XML- . UTF-8 ( , ).
<xsl:stylesheet> </xsl:stylesheet>
- XSL-.
<xsl:template match="element"> </xsl:template>
- element.
:
<xsl:template match="element"></xsl:template>
- , element . element . <xsl:template match="element" mode="mode1"></xsl:template>
- , element mode1 . element . <xsl:template name="template-name"></xsl:template>
- template-name . - XML- .
XML- (, XML-, item ), " " :
<xsl:template match="navigation/sections/item"></xsl:template>
, , .., , , , .. navigation , navigation/sections/item sections/item .
, - . , xsl- . .
xsl .
, ( ) :
template_folder - . , my_template . dtd - . . lang - ( ). mod - .
xsl/my_template , layout.xsl :
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE xsl:stylesheet SYSTEM "../dtd/entities.dtd">
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:template match="/node()">
</xsl:template>
</xsl:stylesheet>
:
<xsl:template match="/node()"> </xsl:template>
- /node() (). /node() //document , .. .
XHTML- <xsl:template match="/node()"></xsl:template>
XML- . , XSL- XML- XHTML- .
, XSL template.xsl (, template - ), :
<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:import href=" my_template /layout.xsl"/>
</xsl:stylesheet>
:
<xsl:import href="my_template/layout.xsl"/>
XSL- ( XSL- ) . .
, .. XML- .
- .
, XML- :
<item id="0" parent_id="0" is_published="1" section="1">
/
<item id="1" parent_id="0" is_published="1" section="1" hit="yes">
news
:
id document - id . hit item - , , " ".
, , :
sections - . item - .
, , item item , , :
1. xsl/my_template navigation.xsl :
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE xsl:stylesheet SYSTEM "../dtd/entities.dtd">
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:template match="sections" mode="global_menu">
</xsl:template>
</xsl:stylesheet>
2. layout.xsl :
<xsl:template match="sections" mode="global_menu">
</xsl:template>
3. … layout.xsl :
<xsl:apply-templates select="navigation/sections" mode="global_menu"/>
:
select="navigation/sections" - ( ) - . , navigation/sections .
mode="global_menu" - global_menu . , , , " ", - .
4. , layout.xsl navigation.xsl :
<xsl:import href="navigation.xsl"/>
5. , navigation.xsl , :
<xsl:template match="item" mode="global_menu">
<xsl:call-template name="href_attribute"/>
<xsl:value-of select="title"/>
</xsl:template>
:
<xsl:call-template name="href_attribute"/>
- . , .. .
<xsl:value-of select="title"/>
- - title . @ - .
6. sections :
<xsl:template match="sections" mode="global_menu">
</xsl:template>
:
<xsl:apply-templates select="item" mode="global_menu"/>
- item sections . , item item ( sections/item/item ) , .. .
item ( ) . , : <xsl:call-template name="href_attribute"/>
uri- . .
7. ,
, . item :
<xsl:template match="item" mode="global_menu">
<xsl:choose>
<xsl:when test="descendant-or-self::*/@id = /node()/@id">
<xsl:value-of select="title"/>
</xsl:when>
<xsl:otherwise>
<xsl:call-template name="href_attribute"/>
<xsl:value-of select="title"/>
</xsl:otherwise>
</xsl:choose>
</xsl:template>
:
<xsl:choose>
<xsl:when></xsl:when>
<xsl:otherwise></xsl:otherwise>
</xsl:choose>
…, , XML- . : <xsl:when test="descendant-or-self::*/@id = /node()/@id">
ID ( document ) ( item ), , .
<xsl:when></xsl:when>
, . <xsl:otherwise></xsl:otherwise>
- .
8. , href_attribute :
<xsl:template name="href_attribute">
<xsl:attribute name="href">
<xsl:text>/</xsl:text>
<xsl:for-each select="ancestor-or-self::item">
<xsl:value-of select="dir"/>
<xsl:text>/</xsl:text>
</xsl:for-each>
</xsl:attribute>
</xsl:template>
xsl:attribute . . a , , href , .. .
<xsl:for-each select="ancestor-or-self::item">
, . ancestor-or-self::item - . dir , .. -.
, - , . , .
UPD:
. , :
parser.proc.ru/iso/xslt-1.zip
( ) Apache.
XML- /xsl/document.xml