我想使用XslCompiledTransform
使用xsl转换xml。但是我发现脚本块的格式为<script src="..."/>
而非<script src="..." ></script>
,如何使其正确?
即使我的xsl文件如下:
<html>
<head>
<title>Hello iCore Project</title>
<link rel="stylesheet" href="http://code.jquery.com/mobile/1.3.2/jquery.mobile-1.3.2.min.css"/>
<script src="http://code.jquery.com/jquery-1.8.3.min.js" ></script>
<script src="http://code.jquery.com/mobile/1.3.2/jquery.mobile-1.3.2.min.js"></script>
</head>
<body>
...
答案 0 :(得分:1)
在XML格式中,<script ...></script>
和<script ... />
两种格式均有效且等效。
强制结束标记将<xsl:output method="html"/>
添加到样式表。