Xml SVG中的溢出
我使用XSLT来显示游戏列表。每个游戏都根据其在数据库中的位置(y=“{($position)*10}%”)进行定位。我的问题是,当数据库中有太多游戏时,这些游戏不会显示。我还尝试使用带有overflow=“scroll”的,但没有成功。当数据库增长时,如何显示我的输出,以便我可以滚动并查看所有游戏Xml SVG中的溢出,xml,xslt,svg,overflow,basex,Xml,Xslt,Svg,Overflow,Basex,我使用XSLT来显示游戏列表。每个游戏都根据其在数据库中的位置(y=“{($position)*10}%”)进行定位。我的问题是,当数据库中有太多游戏时,这些游戏不会显示。我还尝试使用带有overflow=“scroll”的,但没有成功。当数据库增长时,如何显示我的输出,以便我可以滚动并查看所有游戏 <xsl:template match="/"> <svg height="100%" width="100%" xmlns="http://www.w3.org/
<xsl:template match="/">
<svg height="100%" width="100%" xmlns="http://www.w3.org/2000/svg" overflow="scroll">
<xsl:for-each select="//game">
<xsl:variable name="gameid" select="@gameid"/>
<xsl:variable name="name1" select="players/player[@id='1']/name"/>
<xsl:variable name="name2" select="players/player[@id='2']/name"/>
<xsl:variable name="points1" select="players/player[@id='1']/points"/>
<xsl:variable name="points2" select="players/player[@id='2']/points"/>
<xsl:variable name="position" select="position()"/>
<text x="10%" y="{($position)*10}%" font-family="Verdana" font-size="100%">Id:</text>
<text x="18%" y="{($position)*10}%" font-family="Verdana" font-size="100%" ><xsl:value-of select="$gameid"/></text>
<text x="25%" y="{($position)*10}%" font-family="Verdana" font-size="100%"><xsl:value-of select="$name1"/>(<xsl:value-of select="$points1"/>) vs. <xsl:value-of select="$name2"/>(<xsl:value-of select="$points2"/>)</text>
</xsl:for-each>
</svg>
</xsl:template>
身份证件:
()对()
这是xml文件的一部分。在数据库中,此xml文件多次包含不同的值
<game gameid="2018-02-24T20:31:49.058>
<players>
<player id="1" playing="true">
<name></name>
<points>0</points>
</player>
<player id="2" playing="false">
<name>awd</name>
<points>0</points>
</player>
</players>
</game>
问题在于,您使用表达式y=“{($position)*10}%”设置垂直位置相对百分比。因此,当$position
大于10时,百分比值超过100%标记,项目将不会显示(例如,第11个项目为110%)
因此,解决方案是使用绝对值(例如在px
中):
您还必须设置发布一段XML来完成一个将有助于发现问题的示例。好的,谢谢,我编辑了它。希望有帮助!非常感谢,我会尝试一下并告诉你:)
{($position)*40}px