C# 转换期间的XSLT问题
在xhtml的转换过程中我遇到了一个问题,像这样的一些元素:xmlns:ms=“urn:schemas-microsoft-com:xslt”插入了我的很多xhtml标记中 例:C# 转换期间的XSLT问题,c#,xml,xslt,namespaces,transform,C#,Xml,Xslt,Namespaces,Transform,在xhtml的转换过程中我遇到了一个问题,像这样的一些元素:xmlns:ms=“urn:schemas-microsoft-com:xslt”插入了我的很多xhtml标记中 例: 我正在研究IIS6。我没有任何解释 你已经有同样的问题了吗? 我的代码怎么了 谢谢。您可以通过排除结果前缀属性来排除这些名称空间。您需要列出由空格分隔的命名空间前缀: <script type="text/javascript" src="/style/js/etablissement/videos.js"
我正在研究IIS6。我没有任何解释
你已经有同样的问题了吗?
我的代码怎么了
谢谢。您可以通过
排除结果前缀属性来排除这些名称空间。您需要列出由空格分隔的命名空间前缀:
<script type="text/javascript" src="/style/js/etablissement/videos.js"
xmlns:infoRequest="ControlSkin3"
xmlns:ms="urn:schemas-microsoft-com:xslt" ></script>
您可以通过排除结果前缀
属性来排除这些名称空间。您需要列出由空格分隔的命名空间前缀:
<script type="text/javascript" src="/style/js/etablissement/videos.js"
xmlns:infoRequest="ControlSkin3"
xmlns:ms="urn:schemas-microsoft-com:xslt" ></script>
排除结果前缀=“xmlns”>
我的代码怎么了
这不是很有意义,因为XSLT样式表中没有任何名称空间前缀,名为“xmlns”
另一方面,现有的前缀是:“ms”
,“infoRequest”
和“xsl”
如果将这些前缀指定为空白分隔列表作为排除结果前缀
属性的值,则它们将不会出现在任何文字结果元素的序列化(输出)中
例如:
<xsl:stylesheet xmlns="http://www.w3.org/1999/xhtml"
version="1.0"
xmlns:ms="urn:schemas-microsoft-com:xslt"
xmlns:infoRequest="ControlSkin3"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
exclude-result-prefixes="infoRequest ms">
<xsl:stylesheet xmlns="http://www.w3.org/1999/xhtml"
version="1.0"
xmlns:ms="urn:schemas-microsoft-com:xslt"
xmlns:infoRequest="ControlSkin3"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
exclude-result-prefixes="ms infoRequest xsl">
<xsl:output omit-xml-declaration="yes" method="xml" encoding="utf-8" />
<xsl:template match="/">
<html>
<head>
<script type="text/javascript" src="/style/js/etablissement/videos.js">
/* Script code here */
</script>
</head>
</html>
</xsl:template>
</xsl:stylesheet>
/*这里的脚本代码*/
执行此转换时(在任何源XML文档上——未使用),结果不包含任何不需要的名称空间:
<xsl:stylesheet xmlns="http://www.w3.org/1999/xhtml"
version="1.0"
xmlns:ms="urn:schemas-microsoft-com:xslt"
xmlns:infoRequest="ControlSkin3"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
exclude-result-prefixes="infoRequest ms">
<xsl:stylesheet xmlns="http://www.w3.org/1999/xhtml"
version="1.0"
xmlns:ms="urn:schemas-microsoft-com:xslt"
xmlns:infoRequest="ControlSkin3"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
exclude-result-prefixes="ms infoRequest xsl">
<xsl:output omit-xml-declaration="yes" method="xml" encoding="utf-8" />
<xsl:template match="/">
<html>
<head>
<script type="text/javascript" src="/style/js/etablissement/videos.js">
/* Script code here */
</script>
</head>
</html>
</xsl:template>
</xsl:stylesheet>
/*这里的脚本代码*/
排除结果前缀=“xmlns”>
我的代码怎么了
这不是很有意义,因为XSLT样式表中没有任何名称空间前缀,名为“xmlns”
另一方面,现有的前缀是:“ms”
,“infoRequest”
和“xsl”
如果将这些前缀指定为空白分隔列表作为排除结果前缀
属性的值,则它们将不会出现在任何文字结果元素的序列化(输出)中
例如:
<xsl:stylesheet xmlns="http://www.w3.org/1999/xhtml"
version="1.0"
xmlns:ms="urn:schemas-microsoft-com:xslt"
xmlns:infoRequest="ControlSkin3"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
exclude-result-prefixes="infoRequest ms">
<xsl:stylesheet xmlns="http://www.w3.org/1999/xhtml"
version="1.0"
xmlns:ms="urn:schemas-microsoft-com:xslt"
xmlns:infoRequest="ControlSkin3"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
exclude-result-prefixes="ms infoRequest xsl">
<xsl:output omit-xml-declaration="yes" method="xml" encoding="utf-8" />
<xsl:template match="/">
<html>
<head>
<script type="text/javascript" src="/style/js/etablissement/videos.js">
/* Script code here */
</script>
</head>
</html>
</xsl:template>
</xsl:stylesheet>
/*这里的脚本代码*/
执行此转换时(在任何源XML文档上——未使用),结果不包含任何不需要的名称空间:
<xsl:stylesheet xmlns="http://www.w3.org/1999/xhtml"
version="1.0"
xmlns:ms="urn:schemas-microsoft-com:xslt"
xmlns:infoRequest="ControlSkin3"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
exclude-result-prefixes="infoRequest ms">
<xsl:stylesheet xmlns="http://www.w3.org/1999/xhtml"
version="1.0"
xmlns:ms="urn:schemas-microsoft-com:xslt"
xmlns:infoRequest="ControlSkin3"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
exclude-result-prefixes="ms infoRequest xsl">
<xsl:output omit-xml-declaration="yes" method="xml" encoding="utf-8" />
<xsl:template match="/">
<html>
<head>
<script type="text/javascript" src="/style/js/etablissement/videos.js">
/* Script code here */
</script>
</head>
</html>
</xsl:template>
</xsl:stylesheet>
/*这里的脚本代码*/
好问题(+1)。有关问题的解释和完整解决方案,请参见我的答案。:)好问题(+1)。有关问题的解释和完整解决方案,请参见我的答案。:)我认为您需要将第一句话改为“您可以为文字结果元素排除这些名称空间”。我认为您需要将第一句话改为“您可以为文字结果元素排除这些名称空间”。