不能在包含元素的子元素之后创建 XSLT 属性节点 (id) [英] XSLT attribute node (id) cannot be created after the children of the containing element
本文介绍了不能在包含元素的子元素之后创建 XSLT 属性节点 (id)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
通常我在 Weblogic12 服务器上执行 XSLT 过程.我一直遇到这个问题
net.sf.saxon.trans.DynamicError:一个属性节点(id) 不能在包含元素的子元素之后创建
在迁移之前,我们的团队完全没有问题...
知道为什么吗?我最近从 BEA Weblogic3 升级到 Oracle Enterprise Weblogic 12.还是我缺少一个库?
这困扰着我们整个团队!谢谢!
编辑 1:
错误指向
在
<xsl:copy-of select="@colspan | @align | @style | @valign | @class | @id | @name"/><xsl:if test="@colspan = '1' and $columnWidth != '' and not(@suppressColWidth='true')"><xsl:attribute name="width"><xsl:value-of select="$columnWidth"/></xsl:attribute></xsl:if><xsl:if test="@rowspan != '1'"><xsl:copy-of select="@rowspan"/></xsl:if><xsl:if test="descendant::ErrMsg"><xsl:call-template name="makeErrorDiv"/></xsl:if></td><xsl:template name="makeErrorDiv"><div style="display:none;"><xsl:when test="descendant::*[ParentId]"><xsl:attribute name="id"><xsl:value-of select="descendant::ParentId[position() = 1]"/><![CDATA[$err]]><<;/xsl:属性></xsl:when><xsl:when test="descendant::*[ErrMsg][Name]"><xsl:attribute name="id"><xsl:value-of select="descendant::*[ErrMsg][position() = 1]/Name"/<![CDATA[$err]]></xsl:attribute></xsl:when><xsl:when test="not(descendant::*[ErrMsg])"><xsl:variable name="name"><xsl:value-of select="descendant::*[Name][position() = 1]/Name"/></xsl:variable><xsl:variable name="parsed"><xsl:value-of select="substring-before($name, '!')"/></xsl:variable><xsl:attribute name="id"><!--这里有错误!--><xsl:when test="$parsed = ''"><xsl:value-of select="$name"/></xsl:when><xsl:otherwise><xsl:value-of select="$parsed"/></xsl:otherwise></xsl:选择><xsl:text><![CDATA[$err]]></xsl:text></xsl:attribute></xsl:when><xsl:when test="descendant::*[ErrMsg][not(Name)]"><xsl:variable name="name"><xsl:value-of select="descendant::*[Name][position() = 1]/Name"/></xsl:variable><xsl:variable name="parsed"><xsl:value-of select="substring-before($name, '!')"/></xsl:variable><xsl:attribute name="id"><xsl:when test="$parsed = ''"><xsl:value-of select="$name"/></xsl:when><xsl:otherwise><xsl:value-of select="$parsed"/></xsl:otherwise></xsl:选择><xsl:text><![CDATA[$err]]></xsl:text></xsl:attribute></xsl:when></xsl:选择><span style="color: #FF0000; font-family: Arial, Helvetica, sans-serif; font-size: 10px; font-weight: bold; text-decoration: none;"><xsl:value-select="descendant::ErrMsg[position() = 1]"/></span></xsl:模板>
XML 示例...不确定它是否有帮助...整个 XML 文件有 1000 多行
<Cell colspan="1"><ListBox onchange="toggleAddressByAjax();"><姓名>APPLICATION_CUSTOMER.EMPLOYED_SINCE_MM!YLI</姓名><尺寸>1</尺寸><默认 rtexprvalue="true">mb.getValue("APPLICATION_CUSTOMER.EMPLOYED_SINCE_MM!YLI", "A")</Default><Map rtexprvalue="true">mb.getGenericLookup("V_YEAR")</Map><ReadOnly rtexprvalue="true">mb.isReadonly(2)</ReadOnly></列表框><标签类="sTGBFBS"><标题>&nbsp;&nbsp;Jahre </Caption></标签><ListBox onchange="toggleAddressByAjax();"><姓名>APPLICATION_CUSTOMER.EMPLOYED_SINCE_MM!MLI</姓名><尺寸>1</尺寸><默认 rtexprvalue="true">mb.getValue("APPLICATION_CUSTOMER.EMPLOYED_SINCE_MM!MLI", "A")</Default><Map rtexprvalue="true">mb.getGenericLookup("V_MONTH")</Map><ReadOnly rtexprvalue="true">mb.isReadonly(2)</ReadOnly></列表框><标签类="sTGBGBS"><标题>&nbsp;&nbsp;Monate </Caption></标签><ErrMsg/></单元格></DisclosureRowColor>
解决方案 我认为你的问题可能是你的
节点在你的 >
元素
我认为应该只是说
<![CDATA[$err]]></xsl:attribute>
因为您创建的是属性,而不是文本节点.
更新:我试图重现错误,但不能.但是,我确实发现撒克逊人在属性中使用了空格.您可能想尝试去除一些 XSL 元素之间的一些空白.
<xsl:variable name="name"><xsl:value-of select="descendant::*[Name][position() = 1]/Name"/></xsl:variable><xsl:variable name="parsed"><xsl:value-of select="substring-before($name, '!')"/></xsl:variable><xsl:attribute name="id"><xsl:choose><xsl:when test="$parsed = ''"><xsl:value-of select="$name"/></xsl:when><xsl:otherwise><xsl:value-of select="$parsed"/></xsl:otherwise></xsl:choose><xsl:text><![CDATA[$err]]></xsl:text></xsl:attribute></xsl:when>
这可能会解决您看到的实际错误:
查看全文
登录
关闭
扫码关注1秒登录
发送“验证码”获取
|
15天全站免登陆