2

我试图让 XForms 在我的 Ubuntu 桌面上运行。目前 XForms 上似乎没有太多活动,我正试图让 Backplanejs 运行。它不起作用,在检查 javascript 后,我​​发现它依赖于 Microsoft 库和 activex。

我决定继续我的 erlang 教育,而不是学习 javascript,而是在 xmerl 上苦苦挣扎。我为带有索引文件的模式创建了一个目录。这个目录的内容是:

tony@blessing:~/workspace/myXformProject$ ls schemas
SchemaList.txt   XForms-Schema.xsd  xhtml-lat1.ent     xml-events.xsd
SchemaList.txt~  xhtml1-strict.dtd  xhtml-special.ent

这些模式已从 w3c 下载。然而,这些模式不会编译产生错误 wfc_PEs_In_Internal_Subset。我本来希望这些完善的 w3c 模式可以用 xmerl 编译。

我究竟做错了什么?

托尼·华莱士

6> B.
[{"http://www.w3.org/1999/xhtml",
  "schemas/xhtml1-strict.dtd"},
 {"http://www.w3.org/2001/xml-events",
  "schemas/xml-events.xsd"},
 {"http://www.w3.org/2002/xforms",
 "schemas/XForms-Schema.xsd"}]

9> {ok,S1} = xmerl_xsd:process_schemas(B).          
3450- fatal: {error,{wfc_PEs_In_Internal_Subset}}
** exception exit: {fatal,{{error,{wfc_PEs_In_Internal_Subset}},
                       {file,"schemas/xhtml1-strict.dtd"},
                       {line,628},
                       {col,89}}}
 in function  xmerl_scan:fatal/2
 in call from xmerl_scan:scan_entity/2
 in call from xmerl_scan:scan_markup_decl/2
 in call from xmerl_scan:scan_ext_subset/2
 in call from xmerl_scan:scan_document/2
 in call from xmerl_scan:file/2
 in call from xmerl_xsd:process_schemas/2

3450 指的是 xmerl_scan 中的代码行:

scan_entity_value("%" ++ _T,S=#xmerl_scanner{environment=prolog},_,_,_,_,_) ->
    ?fatal({error,{wfc_PEs_In_Internal_Subset}},S);

并且该错误似乎与 xhtml1-strict.dtd 的第 628 行有关。第 89 列似乎很可疑,因为第 628 行不是那么宽:

621 <!--
622   param is used to supply a named property value.
623   In XML it would seem natural to follow RDF and support an
624   abbreviated syntax where the param elements are replaced
625   by attribute value pairs on the object start tag.
626 -->
627 <!ELEMENT param EMPTY>
628 <!ATTLIST param
629   id          ID             #IMPLIED
630   name        CDATA          #IMPLIED
631   value       CDATA          #IMPLIED
632   valuetype   (data|ref|object) "data"
633   type        %ContentType;  #IMPLIED
634   >
635 

如果你把这篇文章写得这么远,非常感谢!托尼

4

1 回答 1

0

您似乎在一组架构文档上调用 xmerl_xsd:process_schemas,其中一些是 XSD 架构文档,其中一个根本不是 XSD 架构文档,而是文档类型定义文件 (xhtml1-strict.dtd)。process_schemas 函数需要 XSD 模式文档,它们是 XML 文档实例,但 DTD 文件不是 XML 文档实例。如果你想做你想做的事,你需要为 XHTML 获取一个 XSD 模式,而不是 DTD。不幸的是,XHTML WG 的 XSD 模式文档并不是世界上最容易使用的东西。祝你好运。

如果您想使用 XForms,您可能会发现让 XSLTForms 或 Orbeon 或 BetterForms 或 EMC Formula 工作比让 backplane.js 工作更容易。

于 2012-12-10T23:25:46.017 回答