Extended HTML not validating
Posted: Tue Apr 12, 2011 8:56 pm
Hello,
I'm trying to extend XHTML to use custom tags. I'm unfamiliar with this process, so I've started by using the simpleml example from the W3C: http://www.w3.org/TR/xhtml-modularizati ... oping.html
The first issue I encountered was outlined in post #14933 (http://www.oxygenxml.com/forum/post14933.html). The fix in that post's reply took care of the issue, but now I'm getting more errors when validating the simpleml-1_0.xsd document.
Here are the errors from Oxygen:
My first question is, is it possible to resolve these errors?
And the second questions is, if not, can I point to the xhtml1 schemas included in the OXYGEN_INSTALL_DIR/frameworks/xhtml1/schema directory? If so, what do I need to change?
Here are the three files:
simple-prefixed.xml
simpleml-1_0.xsd
simpleml-module-1.xsd
Thank you
I'm trying to extend XHTML to use custom tags. I'm unfamiliar with this process, so I've started by using the simpleml example from the W3C: http://www.w3.org/TR/xhtml-modularizati ... oping.html
The first issue I encountered was outlined in post #14933 (http://www.oxygenxml.com/forum/post14933.html). The fix in that post's reply took care of the issue, but now I'm getting more errors when validating the simpleml-1_0.xsd document.
Here are the errors from Oxygen:
Code: Select all
SystemID: http://www.w3.org/MarkUp/SCHEMA/xhtml-basic10-modules-1.xsd
Engine name: Xerces
Severity: error
Description: derivation-ok-restriction.2.1.2: Error for type 'xhtml.version.attrib'. The attribute use 'version' in this type has type 'FPI', which is not validly derived from 'CDATA', the type of the matching attribute use in the base type.
Start location: 121:42
End location: 121:53
URL: http://www.w3.org/TR/xmlschema-1/#derivation-ok-restriction
Code: Select all
SystemID: http://www.w3.org/MarkUp/SCHEMA/xhtml-basic10-modules-1.xsd
Engine name: Xerces
Severity: error
Description: src-redefine.7.2.2: AttributeGroup 'xhtml.version.attrib' does not properly restrict the attributeGroup it redefines; constraint violated: 'derivation-ok-restriction.2.1.2'.
Start location: 121:9
End location: 121:21
URL: http://www.w3.org/TR/xmlschema-1/#src-redefine
And the second questions is, if not, can I point to the xhtml1 schemas included in the OXYGEN_INSTALL_DIR/frameworks/xhtml1/schema directory? If so, what do I need to change?
Here are the three files:
simple-prefixed.xml
Code: Select all
<?xml version="1.0" encoding="UTF-8"?>
<html xmlns="http://www.w3.org/1999/xhtml"
xmlns:simpleml="http://www.example.com/xmlns/simpleml1"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://www.w3.org/1999/xhtml simpleml-1_0.xsd">
<head>
<title>An example using defaults</title>
</head>
<body>
<p>This is content in the XHTML namespace</p>
<simpleml:element>
This is content in the SimpleML namespace.
<simpleml:otherelement/>
</simpleml:element>
</body>
</html>
Code: Select all
<?xml version="1.0" encoding="UTF-8"?>
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema"
targetNamespace="http://www.w3.org/1999/xhtml"
xmlns:simpleml="http://www.example.com/xmlns/simpleml1"
xmlns="http://www.w3.org/1999/xhtml"
blockDefault="#all">
<xs:annotation>
<xs:documentation>
This is the XML Schema Driver for new
Document Type XHTML Basic 1.0 + SimpleML
$Id: simpleml-1_0.xsd,v 1.2 2008/10/08 20:27:39 smccarro Exp $
</xs:documentation>
<xs:documentation source="http://www.w3.org/MarkUp/SCHEMA/xhtml-copyright-1.xsd"/>
</xs:annotation>
<xs:import namespace="http://www.example.com/xmlns/simpleml1"
schemaLocation="simpleml-module-1.xsd"/>
<xs:redefine schemaLocation="http://www.w3.org/MarkUp/SCHEMA/xhtml-basic10.xsd">
<xs:group name="xhtml.Misc.class">
<xs:choice>
<xs:group ref="xhtml.Misc.class"/>
<xs:element ref="simpleml:element"/>
</xs:choice>
</xs:group>
<xs:attributeGroup name="xhtml.img.attlist">
<xs:attributeGroup ref="xhtml.img.attlist"/>
<xs:attribute ref="simpleml:myattr"/>
</xs:attributeGroup>
</xs:redefine>
<xs:element name="html" type="xhtml.html.type"/>
</xs:schema>
Code: Select all
<?xml version="1.0" encoding="UTF-8"?>
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema"
targetNamespace="http://www.example.com/xmlns/simpleml1"
xmlns="http://www.example.com/xmlns/simpleml1">
<xs:annotation>
<xs:documentation>
This is the XML Schema module for module SimpleML
$Id: simpleml-module-1.xsd,v 1.2 2008/10/08 20:27:27 smccarro Exp $
</xs:documentation>
<xs:documentation source="http://www.w3.org/MarkUp/SCHEMA/xhtml-copyright-1.xsd"/>
</xs:annotation>
<xs:attributeGroup name="xhtml.Common.attrib">
<xs:attribute name="id" type="xs:ID"/>
</xs:attributeGroup>
<xs:group name="otherelement.content">
<xs:sequence/>
</xs:group>
<xs:attributeGroup name="otherelement.attlist">
<xs:attributeGroup ref="xhtml.Common.attrib"/>
</xs:attributeGroup>
<xs:complexType name="otherelement.type">
<xs:group ref="otherelement.content"/>
<xs:attributeGroup ref="otherelement.attlist"/>
</xs:complexType>
<xs:element name="otherelement" type="otherelement.type"/>
<xs:group name="element.content">
<xs:choice>
<xs:element ref="otherelement" minOccurs="0" maxOccurs="unbounded"/>
</xs:choice>
</xs:group>
<xs:attributeGroup name="element.attlist">
<xs:attributeGroup ref="xhtml.Common.attrib"/>
</xs:attributeGroup>
<xs:complexType name="element.type" mixed="true">
<xs:group ref="element.content"/>
<xs:attributeGroup ref="element.attlist"/>
</xs:complexType>
<xs:element name="element" type="element.type"/>
<!-- Note: Global attribute -->
<xs:attribute name="myattr" type="xs:string"/>
</xs:schema>