【问题标题】:Tridion 'Complex Schema' upgrade issue with 'xlink:' and attribute 'ref'带有“xlink:”和属性“ref”的 Tridion“复杂架构”升级问题
【发布时间】:2012-11-14 04:04:39
【问题描述】:

我们正在升级当前用于将内容从 3rd 方系统导入 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="...">)来解决,但这是我们无法修改的。

任何 cmets/指针都会很棒! 谢谢

<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 表示他们将与研发部门对此进行调查,并且似乎已经同意它在 2009 年是一个有效的模式,现在它在 2011 年无效。票已关闭,但跟进此事并查看是否已解决将会很有趣2013 年还是被接受为不同的方法?

【问题讨论】:

  • cm_lnk.xsd 的架构位置是否正确?
  • 嗨 Dominic,我曾尝试在 Tridion 2009 实例中不使用 schemaLocation="cm_lnk.xsd",但它仍然得到验证 - 这是 Tridion CME 验证架构的一面。
  • 在 Tridion 2011 中,xlink 命名空间是通过“实例”导入来导入的。 &lt;xsd:import namespace="http://www.tridion.com/ContentManager/5.0/Instance"&gt;&lt;/xsd:import&gt; 如果你添加这个而不是 cm_lnk.xsd 导入,它有帮助吗?
  • 怕不是多米尼克。我将 xsd: 更改为 xs:。如果没有别的,我确实尝试了 schemaLocation 和标签自动关闭的测试。奇怪的是,从 ref= 到 name= & type= 的更改验证了 - 这与 Tridion XSD 内联,因此可能不支持 ref= (至少在预期的 Schema 的上下文发起者中)。另外-您能否确认您在哪里找到了对 xlink 命名空间导入的更新?我可以在移动架构的过程中进行更新,并且还可以使用相同的文档/方法来确保我们也检查其他项目。顺便感谢您对这个问题的回答!
  • 我对此的理解是 ref 需要引用范围内的类型。因此,我们寻找失败的导入。由于 schemaLocation 属性似乎无关紧要,我们必须假设位置是由 Tridion 在代码中提供的。也许您应该提出一张 CS 票,询问用于定位模式的算法,或者是否有跟踪定位过程的方法。您是否尝试过在 2011 年创建一个全新的模式,并检查它如何定位 xlink 定义?我就是这么做的。

标签: xsd tridion xlink


【解决方案1】:

使用

<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 票,以便可以查看。您的解决方法是完全有效的,但最好报告缺陷以便在未来的版本中修复它们。

【讨论】:

  • 非常感谢 Bart(和 Dominic)。我将通过 Tridion 支持报告这个问题,我们可以继续解决问题。
  • 问题报告给 CS,回复... 感谢您的反馈 - 因为它在 2009 年是有效的架构,现在在 2011 年无效,我们将就此事联系研发以了解是否有问题否则需要在 2011 或 2013 版本中使用。
猜你喜欢
  • 1970-01-01
  • 2012-03-11
  • 1970-01-01
  • 1970-01-01
  • 2014-12-03
  • 1970-01-01
  • 2017-11-28
  • 1970-01-01
  • 2018-11-29
相关资源
最近更新 更多