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

This should cover W3C XML Schema, Relax NG and DTD related problems.
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


i use following schematron schema:

<?xml version="1.0" encoding="UTF-8"?>
<sch:schema xmlns:sch="">


<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>

i get this error description...
W cvc-complex-type.2.4.a: Invalid content was found starting with element 'sch:value-of'. One of '{"":name, "":emph, "":dir, "":span, WC[##other:""]}' is expected.

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

any help would be appreciated,
gerd f.

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

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

Oxygen validates your Schematron schema according with Schematron 1.5 XSD schema located at

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 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