<?xml-stylesheet type="text/xsl" href="template.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"?>
- the header of the XML file . Must go strictly from the beginning of the file. It contains the version of the XML language used and the encoding of the document. I usually work in windows-1251 (for now it's more convenient), but, in theory, UTF-8 is better.- ( ). :
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
Source: https://habr.com/ru/post/22236/
All Articles