我有这个 XML 文档:
<ns0:getDataResponse xmlns:ns0="http://abc.com/">
<return>
<wrapper>
<data><![CDATA[<?xml version="1.0" encoding="UTF-8"?>
<ConDic>
<dictionary>bank</dictionary>
<rows>
<row>
<bic>ABKZKZKX</bic>
<bcode>319</bcode>
<name1>AA "A BANK"</namekz>
<name2>BB "B BANK"</nameru>
</row>
<row>
<bic>ABNAKZKX</bic>
<bcode>922</bcode>
<name1>CC "C BANK"</namekz>
<name2>DD "D BANK"</nameru>
</row>
</rows>
</ConDic>]]></data>
</wrapper>
</return>
</ns0:getDataResponse>
我如何使用 XSL 解析它以获取 CDATA 中的每一行以进行这种选择:
<xsl:stylesheet version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:ns0="http://abc.com/">
<xsl:output method="html" />
<xsl:template match="text()|@*"/>
<xsl:template match="ns0:rows">
<select name="bank" id="bank" class="input" style="width: 370px;">
<xsl:for-each select="row">
<xsl:sort select="name1"/>
<option value="{bic}"><xsl:value-of select="name1" /></option>
</xsl:for-each>
</select>