請問您可以告訴我如何更改標籤名稱xslt? ?我想將img
標記更改爲imp-img
標記。 這裏是我的代碼 http://xsltransform.net/bwdwsT/1如何更改xslt中的標籤名稱?
進出料
<!DOCTYPE html
PUBLIC "XSLT-compat">
<hmtl>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>New Version!</title>
</head>
<aa>
<div class="section1">
<div class="Normal">
<p>
<imp-img height="260" alt="" hspace="6" width="310" align="left" vspace="6" src="/photo/a.cms">
ffff<br>
<br>
hh<br>
<br>
vvggg<br>
<br>
vv<br>
<br>
ftr<br>
<br>
fff
</p>
</div>
</div>
</aa>
</hmtl>
`轉換代碼
<?xml version="1.0" encoding="UTF-8" ?>
<xsl:transform xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="2.0">
<xsl:output method="html" doctype-public="XSLT-compat" omit-xml-declaration="yes" encoding="UTF-8" indent="yes" />
<xsl:template match="/">
<hmtl>
<head>
<title>New Version!</title>
</head>
<xsl:apply-templates/>
</hmtl>
</xsl:template>
<xsl:template match="@*|node()">
<xsl:copy>
<xsl:apply-templates select="@*|node()"/>
</xsl:copy>
</xsl:template>
</xsl:transform>
電流輸出
<!DOCTYPE html
PUBLIC "XSLT-compat">
<hmtl>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>New Version!</title>
</head>
<aa>
<div class="section1">
<div class="Normal">
<p>
<span class="Drop-Film" multiline="0">
<span class="italic" multiline="0">
\xxxcc
</span>
</span>
</p>
<p>
xxx
</p>
<p>
xxxx
</p>
</div>
</div>
</aa>
</hmtl>
更新
http://xsltransform.net/bwdwsT/2
更新的鏈接http://xsltransform.net/bwdwsT/2 – user5711656