Question

I have the usual "schema.xml" in Propel and notice that there are some repeated blocks of XML markup. I have a table, which in turn has 10 child tables - and each child needs some code to specify that relationship (inside a <table>):

<column name="id" type="integer" required="true" primaryKey="true" />
<foreign-key foreignTable="process_step">
    <reference local="id" foreign="id" />
</foreign-key>
<behavior name="delegate">
    <parameter name="to" value="process_step" />
</behavior>

I'm therefore putting the above code in a separate file, "process-step-pk.xml", and then add the following to the start of my schema.xml:

<!DOCTYPE stylesheet [
    <!ENTITY process_step_pk SYSTEM "process-step-pk.xml">
]>

Finally where I wish to insert the XML snippet, I use an entity reference:

<table name="process_step_load">
    &process_step_pk;
    <column name="url" type="varchar" size="1024" />
    <column name="method" type="varchar" size="6" required="true" default="get" />
</table>

Here's what I get when I try to build my classes:

[PHP Error] DOMDocument::schemaValidate(): Internal error: xmlSchemaVDocWalk, there is at least one entity reference in the node-tree currently being validated. Processing of entities with this XML Schema processor is not supported (yet). Please substitute entities before validation.. [line 477 of (root)/vendor/propel/generator/lib/task/AbstractPropelDataModelTask.php]

Execution of target "sql-template" failed for the following reason: (root)/vendor/propel/generator/build-propel.xml:209:10: XML schema file ((root)/db/schema.xml) does not validate. See warnings above for reasons validation failed (make sure error_reporting is set to show E_WARNING if you don't see any).

[phingcall] (root)/vendor/propel/generator/build-propel.xml:209:10: XML schema file ((root)/db/schema.xml) does not validate. See warnings above for reasons validation failed (make sure error_reporting is set to show E_WARNING if you don't see any).

Execution of target "sql" failed for the following reason: (root)/vendor/propel/generator/build-propel.xml:194:26: Execution of the target buildfile failed. Aborting. [phing] (root)/vendor/propel/generator/build-propel.xml:194:26: Execution of the target buildfile failed. Aborting.

The key phrase is Processing of entities with this XML Schema processor is not supported (yet), so it knows what I am attempting to do! Has anyone a suggestion as to how I can accomplish this another way?

I'm using PHP 5.3.25 on the console, on OS X 10.6.8.

Was it helpful?

Solution

@Twigmac suggests in the comments that this problem is to do with libxml, and that Propel would need to read the schema using another mechanism if entity support is required. When I get a moment, I'll raise an enhancement ticket with the Propel project.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top