Page 1 of 1

Warning about validation when loading framework files

Posted: Tue May 10, 2022 2:50 pm
by Johann
Hello,

I am using Author web 24.1.0.0 version.

When my custom framework files are loaded, I got multiple warnings in the console.
ro.sync.options.n - Invalid field : validationSchema for class ro.sync.exml.editor.validate.ValidationUnit. ro.sync.options.InvalidPersistentObjException: Schema URI must be specified
I exported the validationScenarios from Oxygen Editor so I do not see what is wrong.

Code: Select all

<field name="validationScenarios">
	<validationScenario-array>
		<validationScenario>
			<field name="pairs">
				<list>
					<validationUnit>
						<field name="validationType">
							<validationUnitType>
								<field name="validationInputType">
									<String>text/xml</String>
								</field>
							</validationUnitType>
						</field>
						<field name="url">
							<String>${currentFileURL}</String>
						</field>
						<field name="validationEngine">
							<validationEngine>
								<field name="engineType">
									<String>Xerces</String>
								</field>
								<field name="allowsAutomaticValidation">
									<Boolean>true</Boolean>
								</field>
							</validationEngine>
						</field>
						<field name="allowAutomaticValidation">
							<Boolean>true</Boolean>
						</field>
						<field name="validationSchema">
							<validationUnitSchema>
								<field name="dtdSchemaPublicID">
									<String>-//MYPUBLICID</String>
								</field>
								<field name="type">
									<Integer>1</Integer>
								</field>
							</validationUnitSchema>
						</field>
					</validationUnit>
					<validationUnit>
						<field name="validationType">
							<validationUnitType>
								<field name="validationInputType">
									<String>text/xml</String>
								</field>
							</validationUnitType>
						</field>
						<field name="url">
							<String>${currentFileURL}</String>
						</field>
						<field name="validationEngine">
							<validationEngine>
								<field name="engineType">
									<String>&lt;Default engine></String>
								</field>
								<field name="allowsAutomaticValidation">
									<Boolean>true</Boolean>
								</field>
							</validationEngine>
						</field>
						<field name="allowAutomaticValidation">
							<Boolean>true</Boolean>
						</field>
						<field name="extensions">
							<null/>
						</field>
						<field name="validationSchema">
							<validationUnitSchema>
								<field name="dtdSchemaPublicID">
									<null/>
								</field>
								<field name="schematronPhase">
									<null/>
								</field>
								<field name="type">
									<Integer>7</Integer>
								</field>
								<field name="uri">
									<String>${framework}/schemas/schematron/href-attribute-rules.sch</String>
								</field>
							</validationUnitSchema>
						</field>
					</validationUnit>
				</list>
			</field>
			<field name="type">
				<String>Validation_scenario</String>
			</field>
			<field name="name">
				<String>My validation scenario</String>
			</field>
		</validationScenario>
	</validationScenario-array>
</field>

Can you help me with that ?

Thank you,

Johann

Re: Warning about validation when loading framework files

Posted: Wed May 11, 2022 4:49 pm
by mihaela
Hello,

This warning is related to the "uri" field from the validationUnitSchema and it is presented when the uri cannot be resolved.
Can you please check if the provided location points to an existing schema (${framework}/schemas/schematron/href-attribute-rules.sch)?

Code: Select all

<field name="uri">
    <String>${framework}/schemas/schematron/href-attribute-rules.sch</String>
</field>
Best Regards,
Mihaela

Re: Warning about validation when loading framework files

Posted: Wed May 11, 2022 6:24 pm
by Johann
Hello,

yes, the schema exists and I can see that the validation for this schema works well.

That's why I do not understand the WARNING.

Regards,

Johann

Re: Warning about validation when loading framework files

Posted: Thu May 12, 2022 4:49 pm
by mihaela
Hello,

Thank you for your response.
We checked again and the warning appears because the following validation unit schema does not specify a "uri" field:

Code: Select all

<field name="validationSchema">
    <validationUnitSchema>
        <field name="dtdSchemaPublicID">
            <String>-//MYPUBLICID</String>
        </field>
        <field name="type">
            <Integer>1</Integer>
        </field>
    </validationUnitSchema>
</field>
This serialization means that you have a validation scenario that uses a custom DTD schema (not detected schema) that does not specify the schema URL. How did you set up the validation configuration? Did you manually modified the .framework file or did you used the UI from the Oxygen XML Editor?

Best Regards,
Mihaela

Re: Warning about validation when loading framework files

Posted: Fri May 13, 2022 6:19 pm
by Johann
Hello,

You are right.
This part is not necessary:

Code: Select all

<field name="validationSchema">
    <validationUnitSchema>
        <field name="dtdSchemaPublicID">
            <String>-//MYPUBLICID</String>
        </field>
        <field name="type">
            <Integer>1</Integer>
        </field>
    </validationUnitSchema>
</field>
because I used:

Code: Select all

<field name="allowAutomaticValidation">
    <Boolean>true</Boolean>
</field>
If I remove it, no more WARNINGS.

This code is quite old with us. It was certainly originally generated using the GUI of an old version of oxygen editor.

Thank you for your help,

Johann

Re: Warning about validation when loading framework files

Posted: Mon May 16, 2022 3:36 pm
by mihaela
Hello,

We are glad that the problem is solved.
Please let us know if you encounter any other problem.

Best Regards,
Mihaela