源XML文件:
<?xml version="1.0"?>
<
staff xmlns="urn:hl7-org:v3">
    <employee>
        <name>AAA</name>
        <salary>111</salary>
        <date>1981</date>
    </employee>
    <employee>
        <name>BBB</name>
        <salary>222</salary>
        <date>1982</date>
    </employee>
<
/staff>

XSL文件:
<?xml version="1.0" encoding="UTF-8" ?>
<xsl:stylesheet version="1.0" xmlns:HL7="urn:hl7-org:v3" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:output method="html" version="4.0" encoding="iso-8859-1" indent="yes"/>
<xsl:template match="/">
   <xsl:apply-templates select="node()">
</xsl:template>
<xsl:template match="HL7:employee">
    //TODO:
    ...
<xsl:template>
注意高亮的部分,我们必须定义名称空间这样才能匹配到XML文件中的相应节点。

相关文章:

  • 2021-10-15
  • 2021-07-13
  • 2022-01-18
  • 2021-08-10
  • 2022-12-23
  • 2022-02-09
  • 2022-01-06
  • 2021-06-07
猜你喜欢
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-11-27
  • 2021-09-20
  • 2022-02-23
  • 2021-07-09
相关资源
相似解决方案