我正在处理从 ArgoUML 导出的 XMI 文档。它具有表单元素
<UML:DataType href='http://argouml.org/profiles/uml14/default-uml14.xmi#-84-17--56-5-43645a83:11466542d86:-8000:000000000000087C'/>
它指向表单的一个项目
<UML:DataType xmi.id="-84-17--56-5-43645a83:11466542d86:-8000:000000000000087C"
name="Integer"
isSpecification="false"
isRoot="false"
isLeaf="false"
isAbstract="false"/>
我已经在 xslt 文件的顶部声明了 xmlns:UML="org.omg.xmi.namespace.UML" 。我想我应该使用类似的东西:
<xsl:variable name="typeref" select="@href"/>
<xsl:variable name="ns" select='substring-before($typeref, "#")'/>
<xsl:variable name="identifier" select='substring-after($typeref, "#")'/>
<xsl:value-of xmlns:UML="$ns"
select='//UML:DataType[@xmi.id="$identifier"]/@name'/>
推断我的 UML 属性类型是整数,但这给了我
SystemId Unknown; Line #136; Column #94; A location step was expected following the '/' or '//' token.
如果我将 xmlns 更改为 AAA,那么我不会收到任何错误,而是一个空标签。我在 Debian 挤压上使用 Xalan2。我错过了什么?