I am coding a ui.xsl to translate ui.xml into ui.html. The ui.xml is:
<?xml version="1.0" encoding="UTF-8"?>
<ui version="4.0">
<layout class="QGridLayout" name="gridLayout_2">
<item row="8" column="1" colspan="12">
</item>
<item row="11" column="1" colspan="2">
</item>
<item row="11" column="3" colspan="2">
</item>
<item row="11" column="5" colspan="2">
</item>
<item row="11" column="7" colspan="3">
</item>
<item row="1" column="6" colspan="3">
</item>
<item row="2" column="1" colspan="3">
</item>
<item row="2" column="0">
</item>
<item row="3" column="1" colspan="3">
</item>
<item row="6" column="1">
</item>
<item row="6" column="2" colspan="4">
</item>
<item row="3" column="9">
</item>
<item row="7" column="0">
</item>
<item row="7" column="1" colspan="12">
</item>
<item row="3" column="12">
</item>
<item row="4" column="0">
</item>
<item row="4" column="6" colspan="3">
</item>
<item row="4" column="9">
</item>
<item row="4" column="10">
</item>
<item row="10" column="1" colspan="12">
</item>
<item row="4" column="11">
</item>
<item row="4" column="12">
</item>
<item row="5" column="0">
</item>
<item row="5" column="1" colspan="3">
</item>
<item row="5" column="6" colspan="2">
</item>
<item row="5" column="9">
</item>
<item row="5" column="11">
</item>
<item row="5" column="12">
</item>
<item row="1" column="0">
</item>
<item row="4" column="1" colspan="3">
</item>
<item row="4" column="4">
</item>
<item row="2" column="12">
</item>
<item row="3" column="0">
</item>
<item row="1" column="1" colspan="3">
</item>
<item row="9" column="1" colspan="12">
</item>
<item row="1" column="9">
</item>
<item row="3" column="6" colspan="3">
</item>
<item row="1" column="11">
</item>
<item row="1" column="12">
</item>
<item row="3" column="11">
</item>
<item row="2" column="11">
</item>
<item row="0" column="8">
</item>
</layout>
</ui>
My ui.xsl is:
<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet version="2.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:xs="http://www.w3.org/2001/XMLSchema"
xmlns:fn="http://www.w3.org/2005/xpath-functions">
<xsl:output method="html" />
<xsl:variable name="maxRow" select="/ui/layout/item
[
(@row >= preceding-sibling::item/@row) and
(@row >= following-sibling::item/@row)
]/@row" />
<xsl:variable name="maxCol" select="/ui/layout/item
[
(@column >= preceding-sibling::item/@column) and
(@column >= following-sibling::item/@column)
]/@column" />
<xsl:template match="/">
<html>
<head>
<title>
</title>
</head>
<body>
<p>
maxRow = <xsl:value-of select="$maxRow"/>
maxCol = <xsl:value-of select="$maxCol"/>
</p>
</body>
</html>
</xsl:template>
</xsl:stylesheet>
I am hoping that I can see the ui.html has "maxRow = 11" and "maxCol = 12"; However, here is the result:
<html xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:fn="http://www.w3.org/2005/xpath-functions">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title></title>
</head>
<body><p>
maxRow = 11
maxCol = 1</p></body>
</html>
So my question here is what's wrong here? Why I can get maxRow correctly but not for maxCol? The code logic is the same, just two different attributes.