error message - cvc-complex-type.2.4.a

This should cover W3C XML Schema, Relax NG and DTD related problems.
gfellner
Posts: 1
Joined: Fri Jul 22, 2005 11:04 pm

error message - cvc-complex-type.2.4.a

Post by gfellner » Fri Jul 22, 2005 11:29 pm

hello,

i use following schematron schema:

<?xml version="1.0" encoding="UTF-8"?>
<sch:schema xmlns:sch="http://www.ascc.net/xml/schematron">

....

</sch:pattern>
<sch:pattern name="The personnel number occurs several times!">
<sch:rule context="person">
<sch:report test="count(../person[@pno = current()/@pno]) > 1">The personnel number <sch:value-of select="@pno"/> at the element <sch:name/> occurs several times.</sch:report>
</sch:rule>
</sch:pattern>
</sch:schema>


i get this error description...
W cvc-complex-type.2.4.a: Invalid content was found starting with element 'sch:value-of'. One of '{"http://www.ascc.net/xml/schematron":name, "http://www.ascc.net/xml/schematron":emph, "http://www.ascc.net/xml/schematron":dir, "http://www.ascc.net/xml/schematron":span, WC[##other:"http://www.ascc.net/xml/schematron"]}' is expected.
URL: http://www.w3.org/TR/xmlschema-1/#cvc-complex-type

... but i don`t know the problem.

any help would be appreciated,
gerd f.

stefan
Posts: 45
Joined: Wed Jan 08, 2003 9:43 am
Contact:

Post by stefan » Mon Jul 25, 2005 5:53 pm

Oxygen validates your Schematron schema according with Schematron 1.5 XSD schema located at http://www.ascc.net/xml/schematron/schematron1-5.xsd

The error message reffers to the fact that the element sch:value-of should only appear inside the Schematron element diagnostic. (parent::sch:diagnostic)

However, many people requested the use of <value-of> inside <assert> or <report> (see http://xml.ascc.net/schematron/1.3/Schematron2000.html Apending G, first point).

Hint: Even if your Schematron schema is not valid according with Schematron 1.5 specs, so you can still use your Schematron schema having sch:value-of inside <assert> or <report> to validate other xml files properly.

Post Reply