在运行时,我可能会有两种XML文件格式:
<root> <diagram> <graph color= "#ff00ff"> <xaxis>1 2 3 12 312 3123 1231 23 </xaxis> <yaxis>1 2 3 12 312 3123 1231 23 </yaxis> </graph> </diagram> </root>
根据颜色属性的存在,我需要处理x轴和y轴的值。我需要使用XSL完成这个操作。有人能帮助我提供一个片段,提示我如何检查这些条件吗?我尝试了使用。<root> <diagram> <graph> <xaxis>1 2 3 12 312 3123 1231 23 </xaxis> <yaxis>1 2 3 12 312 3123 1231 23 </yaxis> </graph> </diagram> </root>
<xsl: when test="graph[1]/@color"> //some processing here using graph[1]/@color values </xsl:when>
我遇到了一个错误...
xsl:choose
指令?(xsl:when
+|xsl:otherwise
) - user357812/
文档根节点,root
元素,diagram
元素,graph
元素...? - user357812