Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
6 changed files
with
49 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,24 @@ | ||
Насколько полезно использовать ключ | ||
=================================== | ||
|
||
Результаты тестов | ||
================= | ||
----------------- | ||
|
||
----------------------------------------------------------------------------------------------- | ||
../xml/l25000_.xml run parse xsl parse xml | ||
----------------------------------------------------------------------------------------------- | ||
key-abs.xsl 193.28 0.00 248.22 | ||
key-rel.xsl 210.08 0.00 248.20 | ||
select.xsl 399.84 0.00 248.42 | ||
|
||
|
||
Выводы | ||
------ | ||
|
||
Ну, чуда не случилось. Ключи быстрее. | ||
|
||
При этом абсолютный путь '/items/labels/label` в ключе лучше относительного `labels/label`. | ||
Если же выбрать путь просто `label`, то выполняться будет существенно дольше (я не дождался). | ||
Но. Если бы теги label внутри item'ов назывались бы по-другому, т.е. если бы в ключ нужно было бы | ||
запихать все теги label, то было бы выгоднее как раз использовать путь `label`. | ||
|
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
<?xml version="1.0" encoding="utf-8"?> | ||
<xsl:stylesheet | ||
xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0" | ||
> | ||
|
||
<xsl:include href="../common.xsl"/> | ||
|
||
<xsl:output method="xml"/> | ||
|
||
<xsl:key name="labels" match="labels/label" use="@id"/> | ||
|
||
<xsl:template match="item"> | ||
<xsl:value-of select="key('labels', label/@id)"/> | ||
</xsl:template> | ||
|
||
</xsl:stylesheet> | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,5 @@ | ||
../xml/l25000_.xml | ||
* | ||
key-abs.xsl | ||
key-rel.xsl | ||
select.xsl | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,7 @@ | ||
----------------------------------------------------------------------------------------------- | ||
../xml/5000_.xml run parse xsl parse xml | ||
../xml/l25000_.xml run parse xsl parse xml | ||
----------------------------------------------------------------------------------------------- | ||
keys.xsl 39.34 0.00 50.90 | ||
select.xsl 79.64 0.00 50.90 | ||
key-abs.xsl 193.28 0.00 248.22 | ||
key-rel.xsl 210.08 0.00 248.20 | ||
select.xsl 399.84 0.00 248.42 | ||
|