情况:
我有一个包含图像信息的简单XML文档.我需要将其转换为HTML.但是,我看不到打开标记的位置,当我使用下面的XSL代码时,它显示以下错误消息:
"当没有元素开始标记打开时,无法写入属性节点."
XML内容:
<root>
<HeaderText>
<HeaderText>Dan Testing</HeaderText>
</HeaderText>
<Image>
<img width="100" height="100" alt="FPO lady" src="/uploadedImages/temp_photo_small.jpg"/>
</Image>
<BodyText>
<p>This is a test of the body text<br /></p>
</BodyText>
<ShowLinkArrow>false</ShowLinkArrow>
</root>
Run Code Online (Sandbox Code Playgroud)
XSL代码:
<xsl:stylesheet version="1.0" extension-element-prefixes="msxsl"
exclude-result-prefixes="msxsl js dl" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:js="urn:custom-javascript" xmlns:msxsl="urn:schemas-microsoft-com:xslt"
xmlns:dl="urn:datalist">
<xsl:output method="xml" version="1.0" omit-xml-declaration="yes" indent="yes" encoding="utf-8"/>
<xsl:template match="/" xml:space="preserve">
<img>
<xsl:attribute name="width">
100
</xsl:attribute>
<xsl:attribute name="height">
100
</xsl:attribute>
<xsl:attribute name="class">
CalloutRightPhoto
</xsl:attribute>
<xsl:attribute name="src">
<xsl:copy-of select="/root/Image/node()"/>
</xsl:attribute>
</img>
</xsl:template>
</xsl:stylesheet>
Run Code Online (Sandbox Code Playgroud) 我有一个复杂的查询,其中包含几个表,视图和函数.函数和视图分离为更多视图和函数,这些视图和函数可能会拆分为更多视图和函数.
此查询存在性能问题,因此我希望得到一个清晰简明的列表,列出我的查询中引用的所有对象,以便为调查提供依据.如何获取此对象列表?