Hello Cefn,
You are trying to redefine a complex type with the name head from the
XHTML schema but there is no such complex type in that schema, there is
only an element with the name head.
If you look at the head element definition you see that it contains
references to the head.misc group and therefore a possible approach will
be to redefine that group to allow the xforms:model element. Note that
xsi:schemaLocation does not have an effect on XML Schema documents, you
need to use import in order to be able to make references to components
from another namespace. You can find a valid schema below.
<?xml version="1.0" encoding="UTF-8"?>
<xs:schema
targetNamespace="http://www.w3.org/1999/xhtml"
xmlns:xs="http://www.w3.org/2001/XMLSchema"
xmlns:xsi="http://www.w3.org/1999/XMLSchema/instance"
xmlns:xhtml="http://www.w3.org/1999/xhtml"
xmlns:xforms="http://www.w3.org/2002/xforms">
<xs:import namespace="http://www.w3.org/2002/xforms"
schemaLocation="http://www.w3.org/MarkUp/Forms/2002/XForms-Schema.xsd"/>
<xs:redefine
schemaLocation="http://www.w3.org/2002/08/xhtml/xhtml1-strict.xsd" >
<xs:group name="head.misc">
<xs:choice>
<xs:group ref="xhtml:head.misc"/>
<xs:element ref="xforms:model"/>
</xs:choice>
</xs:group>
</xs:redefine>
</xs:schema>
For compound documents that contain elements from different namespaces
there is an ISO standard that defines NVDL - Namespace-based Validation
and Dispatching Language. That allows to specify basically that sections
from a document should be validated with different schemas. We made
available an open source implementation of NVDL on top of Jing that
supports as schemas XML Schema, Relax NG and Schematron, see
http://www.oxygenxml.com/onvdl.html
oXygen includes oNVDL and in the oXygen samples you can find an NVDL
script for exactly XHTML with XForms and a sample XHTML+XForms file that
you can edit with content completion and continuous validation in oXygen
based on the sample NVDL script that combines XHTML and XForms.
Best Regards,
George
---------------------------------------------------------------------
George Cristian Bina
<oXygen/> XML Editor, Schema Editor and XSLT Editor/Debugger
http://www.oxygenxml.com
[EMAIL PROTECTED] wrote:
I'm getting a very weird error when using Xerces to parse an XSD
document (Xerces as embedded in Oxygen 8.1).
"E src-resolve: Cannot resolve the name 'xhtml:head_fn3dktizrknc9pi' to
a(n) 'type definition' component."
The full document is shown below as it's very simple. If anyone can make
out what's wrong with it, or make a modification to it which will make
it acceptable to the parser, or even point me to a useful resource for
extra knowledge I need to have to address these errors, I would be very
grateful.
I've tried every possible variant of various irrelevant namespace and
targetnamespace properties in response to a series of other silly
conformance errors raised. I get the fewest errors of all with this
configuration - only one error, but it's completely meaningless to me.
I know W3C standards aren't parsimonious and rarely have smart defaults,
but I've spent a long time on this - like 3 hours plus over a period of
a fortnight trying every possible combination of targetNamespace, with
imports, with schema locations, without schema locations. What I'm
trying to achieve is unbelievably straightforward. God help me if I try
to use XSD for anything major.
The document is attempting to combine XHTML and XFORMS components into
an XHTML variant which permits XFORMS 'model' elements to sit in the
'head' element of the XHTML. After this works, I'll also add XFORMS
'group' elements into the 'body' element of XHTML. In that way I hope to
generate an XSD which allows me to edit XHTML+XFORMS combined documents
in a validating XML editor. As I understand it, this schema definition
and recombination is exactly what XSD is intended to do.
I guess it's got to be just right. I'm sure there's some kind of error,
but the error reports I'm getting don't help me get to the bottom of it
at all. All help gratefully received.
Cefn
http://cefn.com
>>>>>>>>>
"E src-resolve: Cannot resolve the name 'xhtml:head_fn3dktizrknc9pi' to
a(n) 'type definition' component."
<?xml version="1.0" encoding="UTF-8"?>
<xs:schema
targetNamespace="http://www.w3.org/1999/xhtml"
xmlns:xs="http://www.w3.org/2001/XMLSchema"
xmlns:xsi="http://www.w3.org/1999/XMLSchema/instance"
xmlns:xhtml="http://www.w3.org/1999/xhtml"
xmlns:xforms="http://www.w3.org/2002/xforms"
xsi:schemaLocation="http://www.w3.org/1999/xhtml
http://www.w3.org/2002/08/xhtml/xhtml1-strict.xsd
http://www.w3.org/2002/xforms
http://www.w3.org/MarkUp/Forms/2002/XForms-Schema.xsd" >
<xs:redefine
schemaLocation="http://www.w3.org/2002/08/xhtml/xhtml1-strict.xsd" >
<xs:complexType name="head">
<xs:complexContent>
<xs:extension base="xhtml:head">
<xs:sequence>
<xs:element ref="xforms:model"/>
</xs:sequence>
</xs:extension>
</xs:complexContent>
</xs:complexType>
</xs:redefine>
</xs:schema>
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]