使用xsd架构验证xpdl

时间:2015-02-19 16:25:00

标签: xml xsd bizagi

我遇到以下问题:

我需要阅读一些xpdl格式的进程,该进程是一个特定于进程的xml。这些xpdl由Bizagi生成。

在xpdl的官方网站上,我发现了xml架构,但是当我尝试使用xml架构验证由bizagi生成的xpdl时,我发现了一个错误。

我试图了解哪些可以发生,但我不明白。

你可以帮我理解吗?

我发送错误:

 ["level"]=> int(2) 
 ["code"]=> int(1871)
 ["column"]=> int(0)
 ["message"]=> string(596) "Element '{http://www.wfmc.org/2009/XPDL2.2}Activities': This element is not expected. Expected is one of ( {http://www.wfmc.org/2009/XPDL2.2}DataStoreReferences, {http://www.wfmc.org/2009/XPDL2.2}Transitions, {http://www.wfmc.org/2009/XPDL2.2}DataAssociations, {http://www.wfmc.org/2009/XPDL2.2}ExtendedAttributes, {http://www.wfmc.org/2009/XPDL2.2}Assignments, {http://www.wfmc.org/2009/XPDL2.2}PartnerLinks, {http://www.wfmc.org/2009/XPDL2.2}Object, {http://www.wfmc.org/2009/XPDL2.2}Participants, {http://www.wfmc.org/2002/XPDL1.0}DataFields, {http://www.wfmc.org/2009/XPDL2.2}Applications ). "
 ["file"]=> string(66) "file:///C:/Users/dieferson.medeiros/AppData/Local/Temp/php1DBF.tmp"
 ["line"]=> int(117) 

按照我用于使用xml架构验证xpdl的代码:

libxml_use_internal_errors (true);
$xml = new \DOMDocument();
$xml->load($file->getPathname()); 
var_dump($xml->schemaValidate(__DIR__.'/../../../../web/uploads/xsd/xpdl.xsd')); 
var_dump(libxml_get_errors());

点击链接到xpdl:

https://drive.google.com/file/d/0B1uwndG8_xlZSHBzZHZMTUZ0dkk/view?usp=sharing

跟随xml架构的链接:

https://drive.google.com/file/d/0B1uwndG8_xlZblpZUmY2NkxXaGc/view?usp=sharing

感谢您的关注。

1 个答案:

答案 0 :(得分:0)

它说的是活动元素没有很好地定位。

我已针对XPDL 2.2 Standard by WFMC

验证您的.xpdl

我得到9个错误:

1. "Error: The required attribute 'Id' is missing."
2. "Error: The required attribute 'Id' is missing."
3. "Error: The required attribute 'Id' is missing."
4. "Error: The element 'Lane' in namespace 'http://www.wfmc.org/2009/XPDL2.2' has invalid child element 'ExtendedAttributes' in namespace 'http://www.wfmc.org/2009/XPDL2.2'. List of possible elements expected: 'Performers, NestedLane' in namespace 'http://www.wfmc.org/2009/XPDL2.2' as well as any element in namespace '##other'."
5. "Error: The element 'Lane' in namespace 'http://www.wfmc.org/2009/XPDL2.2' has invalid child element 'ExtendedAttributes' in namespace 'http://www.wfmc.org/2009/XPDL2.2'. List of possible elements expected: 'Performers, NestedLane' in namespace 'http://www.wfmc.org/2009/XPDL2.2' as well as any element in namespace '##other'."
6. "Error: The element 'Lane' in namespace 'http://www.wfmc.org/2009/XPDL2.2' has invalid child element 'ExtendedAttributes' in namespace 'http://www.wfmc.org/2009/XPDL2.2'. List of possible elements expected: 'Performers, NestedLane' in namespace 'http://www.wfmc.org/2009/XPDL2.2' as well as any element in namespace '##other'."
7. "Error: The element 'Associations' in namespace 'http://www.wfmc.org/2009/XPDL2.2' has incomplete content. List of possible elements expected: 'Association' in namespace 'http://www.wfmc.org/2009/XPDL2.2'."
8. "Error: The element 'Artifacts' in namespace 'http://www.wfmc.org/2009/XPDL2.2' has incomplete content. List of possible elements expected: 'Artifact' in namespace 'http://www.wfmc.org/2009/XPDL2.2'."
9. "Error: The element 'WorkflowProcess' in namespace 'http://www.wfmc.org/2009/XPDL2.2' has invalid child element 'Activities' in namespace 'http://www.wfmc.org/2009/XPDL2.2'. List of possible elements expected: 'DataStoreReferences, Transitions, DataAssociations, ExtendedAttributes, Assignments, PartnerLinks, Object, Extensions' in namespace 'http://www.wfmc.org/2009/XPDL2.2'."

...但不是您与我们分享的那个。正如我在您的文件中看到的,活动位置很好:

<WorkflowProcess>
    ...
    <Activities>...<Activities/>
</WorkflowProcess>

你能检查一下是正确的文件和/或验证我通过的错误吗?您的架构看起来没问题。