8,906
社区成员
发帖
与我相关
我的任务
分享
<?xml-stylesheet type="text/xsl" href="transfer_test.xslt" ?>
<root>
<techs>
<tech>
<title>aaa</title>
<groups>
<group>
<name>group1</name>
</group>
<group>
<name>group2</name>
</group>
</groups>
</tech>
<tech>
<title>bbb</title>
<groups>
<group>
<name>group1</name>
</group>
</groups>
</tech>
</techs>
</root>
<?xml version="1.0" encoding="utf-8"?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:msxsl="urn:schemas-microsoft-com:xslt" exclude-result-prefixes="msxsl"
>
<xsl:template match="/">
<xsl:for-each select="root/techs/tech">
<span>
<xsl:value-of select="title"/>
</span>
<xsl:for-each select="groups/group">
<br />
<span>
<xsl:value-of select="name"/>
</span>
</xsl:for-each>
<br />
<br />
</xsl:for-each>
</xsl:template>
</xsl:stylesheet>