我尝试验证下面的一些XML代码,但它引发了一个错误:
<m1-3-administrative-information>
<leaf ID="r4" checksum="da14dd2b9a71a8999b633cb7ab514d01" checksum-type="md5" operation="new" xlink:href="administrative-information.pdf" xlink:type="simple">
<title>Administrative Information</title>
</leaf>
<m1-3-2-field-copy-certification>
<leaf ID="r12" checksum="17bfd2aa55599391b7019e4160e58de5" checksum-type="md5" operation="new" xlink:href="field-copy-certification.pdf" xlink:type="simple">
<title>field-copy-certification</title>
</leaf>
</m1-3-2-field-copy-certification>
<m1-3-3-debarment-certification>
<leaf ID="r8" checksum="341ab4bfb48b939992a27d9bdbf5548c" checksum-type="md5" operation="new" xlink:href="debarment-certification.pdf" xlink:type="simple">
<title>debarment-certification</title>
</leaf>
</m1-3-3-debarment-certification>
</m1-3-administrative-information>
错误:期望元素m1-3-管理信息内容不遵循DTD (m1-3-1-联系 - 赞助商 - 申请人信息*,m1-3-2-现场复制 - 认证*,m1-3-3-禁止 - 认证*,m1-3-4-金融认证 - 和披露*,m1-3-5-专利和排他性*,m1-3-6-热带疾病 - 优先 - 审查 - 凭证*), 得到了(叶m1-3-2-field-copy-certification m1-3-3-debarment-certification m1-3-5-patent-and-exclusiveutivity)
如果我从脚本中删除下面这段代码,则错误消失:
<leaf ID="r4" checksum="da14dd2b9a71a8999b633cb7ab514d01" checksum-type="md5" operation="new" xlink:href="administrative-information.pdf" xlink:type="simple">
<title>Administrative Information</title>
</leaf>
这段代码是pdf的链接,但是我必须将它保存在脚本中。因此,我正在寻找一些帮助,如何在上面合并这个叶子,而不会在验证过程中抛出错误。我无法修改DTD文件。
因此,我最好的猜测是,有一些XML代码可以让我这样做,或者DTD不允许这样做,除了将链接放入子节点之外别无选择。
感谢您的帮助。 DTD在下面供参考。
<!ELEMENT m1-3-administrative-information (m1-3-1-contact-sponsor-applicant-
information*, m1-3-2-field-copy-certification*, m1-3-3-debarment-
certification*, m1-3-4-financial-certification-and-disclosure*, m1-3-5-
patent-and-exclusivity*, m1-3-6-tropical-disease-priority-review-voucher*)>
<!ATTLIST m1-3-administrative-information>
ID ID #IMPLIED
xml:lang CDATA #IMPLIED
<!ELEMENT m1-3-1-contact-sponsor-applicant-information (m1-3-1-1-change-of-
address-or-corporate-name*, m1-3-1-2-change-in-contact-agent*, m1-3-1-3-
change-in-sponsor*, m1-3-1-4-transfer-of-obligation*, m1-3-1-5-change-in
ownership-of-an-application-or-reissuance-of-license*)>
<!ATTLIST m1-3-1-contact-sponsor-applicant-information>
ID ID #IMPLIED
xml:lang CDATA #IMPLIED
<!ELEMENT m1-3-1-1-change-of-address-or-corporate-name ((leaf | node-
extension)*)>
<!ATTLIST m1-3-1-1-change-of-address-or-corporate-name>
ID ID #IMPLIED
xml:lang CDATA #IMPLIED
<!ELEMENT m1-3-1-2-change-in-contact-agent ((leaf | node-extension)*)>
<!ATTLIST m1-3-1-2-change-in-contact-agent>
ID ID #IMPLIED
xml:lang CDATA #IMPLIED
<!ELEMENT m1-3-1-3-change-in-sponsor ((leaf | node-extension)*)>
<!ATTLIST m1-3-1-3-change-in-sponsor>
ID ID #IMPLIED
xml:lang CDATA #IMPLIED
<!ELEMENT m1-3-1-4-transfer-of-obligation ((leaf | node-extension)*)>
<!ATTLIST m1-3-1-4-transfer-of-obligation>
ID ID #IMPLIED
xml:lang CDATA #IMPLIED
<!ELEMENT m1-3-1-5-change-in-ownership-of-an-application-or-reissuance-of-
license ((leaf | node-extension)*)>
<!ATTLIST m1-3-1-5-change-in-ownership-of-an-application-or-reissuance-of-
license>
ID ID #IMPLIED
xml:lang CDATA #IMPLIED
<!ELEMENT m1-3-2-field-copy-certification ((leaf | node-extension)*)>
<!ATTLIST m1-3-2-field-copy-certification>
ID ID #IMPLIED
xml:lang CDATA #IMPLIED
<!ELEMENT m1-3-3-debarment-certification ((leaf | node-extension)*)>
<!ATTLIST m1-3-3-debarment-certification>
ID ID #IMPLIED
xml:lang CDATA #IMPLIED
答案 0 :(得分:0)
我有问题的答案。我发现DTD现在允许我在我正在寻找的级别添加链接属性。
当它实际上有效时,DTD指定((leaf | node-extension)*)。换句话说,我想要使用的链接必须进一步嵌套到层次结构中才有效。