您好我有以下代码,我想显示ProductRevision中的UserValue,它与Occurrence中的instancedRef相匹配。架构是plmxml ...
<ProductRevision id="id279" name="Intermediate Shaft" accessRefs="#id17" subType="M3HI_MPTRevision" masterRef="#id284" revision="A" source="unset">
<ApplicationRef version="gCVFl6cKY1F1YB" application="Teamcenter" label="Q_VFl6cKY1F1YB"></ApplicationRef>
<UserData id="id280">
<UserValue value="11111" title="m3hi_Order_No"></UserValue></UserData>
<AssociatedForm id="id283" role="IMAN_master_form" formRef="#id281"></AssociatedForm></ProductRevision>
我正在尝试使用以下XSLT获取UserValue的值
<xsl:variable name="mptRevID" select="substring-after(/plm:PLMXML/plm:ProductView/plm:Occurrence[@id=$mptId]/@instancedRef, '#')"/>
<xsl:variable name="RevTag" select="/plm:PLMXML/plm:ProductRevision[@id=$mptRevID]"/>
<xsl:variable name="Ord" select="$mptRevTag/plm:UserData/plm:UserValue/@value"/>
当我执行上述操作时,它会在输出中给我一个空白。
请告诉我我在代码中所犯的错误或如何从xml访问UserData和UserValue。
先谢谢
答案 0 :(得分:0)
我建议你使用PLMXML的特殊XSLT处理器。 http://plmski.webnode.com/plmxml-xslt-processor/ 处理器自动确定“ref-id”。您无需确定ID。
答案 1 :(得分:0)
我想你有两个问题:
此外,由于'title',我当然也会过滤UserValue,因为Teamcenter的所有属性都是使用此元素导出的。
问候,Loic