When I parse your XSD into a DOM, validate it, and serialize it back
to XML I get the following modified XML:
<?xml version="1.0" encoding="UTF-8"?>
<xs:schema targetNamespace="http://www.w3.org/1999/xhtml"
xmlns:xforms="http://www.w3.org/2002/xforms"
xmlns:xhtml="http://www.w3.org/1999/xhtml"
xmlns:xs="http://www.w3.org/2001/XMLSchema"
xmlns:xsi="http://www.w3.org/1999/XMLSchema/instance"
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_fn3dktizrknc9pi">
<xs:sequence>
<xs:element ref="xforms:model"/>
</xs:sequence>
</xs:extension>
</xs:complexContent>
</xs:complexType>
</xs:redefine>
</xs:schema>
Xerces (2.9.0) gives the following two errors:
[10:65]: src-redefine.5.b.d: 'extension' does not have a 'base'
attribute that refers to the redefined element, 'http://www.w3.org/
1999/xhtml,head'. <complexType> children of <redefine> elements must
have <extension> or <restriction> descendants, with 'base' attributes
that refer to themselves.
[10:65]: src-resolve: Cannot resolve the name
'xhtml:head_fn3dktizrknc9pi' to a(n) 'type definition' component.
Maybe this "extra" message heps to clearify your problem.
Regards
Dick Deneer
Op 1-feb-2007, om 18:04 heeft [EMAIL PROTECTED] het volgende
geschreven:
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>