我们正在升级当前用于将内容从第三方系统导入Tridion的应用程序。目前的CMS是Tridion 2009,新实例将是Tridion 2011 SP1 HR1。
我们遇到的挑战是我们无法获得复杂架构来验证。我在下面列出了一个工作示例(在2009年工作),这在SDL Tridion 2009中验证。但是,当我尝试通过Tridion 2011中的CME创建相同的模式时,当我选择“验证”指示时出现错误
'ref'属性的值无效='xlink:href'是 “ref”属性的值无效。
我花了一些时间阅读(这是一个手工制作的复杂架构,已经有很多内容被压在它上面了!)并相信?我们不能只是坚持一个名称和类型(或者以某种方式在本地定义这个'全局'参数 - 如果可以的话 - 这不是'不那么好'的做法吗?我相信这可以解决更新XML(来自xml problem with <attribute ref="...">),但这是我们无法修改的。
任何评论/指示都会非常精彩! 感谢
<xs:schema targetNamespace="http://www.ccc.com/tridion/pelements" elementFormDefault="qualified" xmlns:tcm="http://www.tridion.com/ContentManager/5.0" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:tcmapi="http://www.tridion.com/ContentManager/5.0/TCMAPI" xmlns="http://www.ccc.com/tridion/pelements" xmlns:mstns="http://tempuri.org/XMLSchema.xsd" xmlns:xs="http://www.w3.org/2001/XMLSchema">
<xs:import namespace="http://www.w3.org/1999/xlink" schemaLocation="cm_lnk.xsd"/>
<!--maps to DITA element: xref -->
<xs:element name="link" type="reference"/>
<xs:complexType name="reference">
<xs:sequence>
<xs:element name="title" minOccurs="1" maxOccurs="1" type="xs:string"/>
<xs:choice>
<xs:element name="internal">
<xs:complexType>
<xs:attribute ref="xlink:href" use="required"/>
<xs:attribute ref="xlink:title" use="optional"/>
</xs:complexType>
</xs:element>
<xs:element name="external">
<xs:complexType>
<xs:attribute name="href" use="required"/>
</xs:complexType>
</xs:element>
</xs:choice>
<xs:element name="text" minOccurs="0" maxOccurs="1" type="xs:string"/>
</xs:sequence>
<xs:attribute name="type" type="referenceType" use="required"/>
</xs:complexType>
<!-- ******************** Enumerations ************************** -->
<xs:simpleType name="referenceType">
<xs:restriction base="xs:string">
<xs:enumeration value="normal"/>
<xs:enumeration value="binary"/>
<xs:enumeration value="embedded"/>
<xs:enumeration value="reusable"/>
<xs:enumeration value="component"/>
</xs:restriction>
</xs:simpleType>
</xs:schema>
更新 为了能够继续,我们对xsd架构进行了更改:
<xs:attribute ref="xlink:href" use="required"/>
<xs:attribute ref="xlink:title" use="optional"/>
到
<xs:attribute name="href" type="xs:anyURI" use="required"/>
<xs:attribute name="title" type="xs:string" use="optional"/>
这实际上来自2011版本的 cm_lnk.xsd 。 ref实际上应该是对xlink:href属性的引用,所以这可能仍然是错误的 - 任何人都知道我们可能测试/注意这个改变的任何陷阱?
更新(来自CS) CS已表示他们将与R&amp; D进行调查并且似乎已经同意它在2009年是一个有效的架构,现在它在2011年无效。机票已经关闭但是有趣的是跟进这个并看看这是否有效在2013年解决或接受为不同的方法?
答案 0 :(得分:2)
使用
<xs:attribute name="href" type="xs:anyURI" use="required"/>
<xs:attribute name="title" type="xs:string" use="optional"/>
而不是
<xs:attribute ref="xlink:href" use="required"/>
<xs:attribute ref="xlink:title" use="optional"/>
完全没问题,因为您打算引用cm_lnk.xsd
,这只是意味着如果cm_lnk.xsd
会发生变化,您也应该相应地更改您的架构。但这只是理论上的,因为cm_lnk.xsd
模式永远不会改变它的定义。
更有趣的是,你提到这在2009版本中有效,这表明2011版本似乎无法处理你的导入
<xs:import namespace="http://www.w3.org/1999/xlink" schemaLocation="cm_lnk.xsd"/>
正如多米尼克已经提到的那样,我确实会为此提出一张CS票,以便可以查看。您的解决方法完全有效,但报告缺陷以便在将来的版本中修复它们总是好的。