Page 1 of 1

Namespace Confusion

Posted: Wed Sep 29, 2004 9:23 pm
by Guest
In the following test document

Code: Select all


<?xml version="1.0" encoding="UTF-8"?>
<xhtml:html
xmlns:xforms="http://www.w3.org/2002/xforms"
xmlns:f="http://orbeon.org/oxf/xml/formatting"
xmlns:xhtml="http://www.w3.org/1999/xhtml"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://www.w3.org/1999/xhtml
http://www.w3.org/2002/08/xhtml/xhtml1-transitional.xsd">
<xhtml:head>
<xhtml:title>A Title</xhtml:title>
</xhtml:head>
<xhtml:body>
<xforms:group ref="/credit-card">
<table border="1">
<tr>
<td>datum1</td>
<td >datum2</td>
</tr>
</table>
</xforms:group>
</xhtml:body>
</xhtml:html>
I'm getting this validation error.

Code: Select all


Severity        2
Description cvc-complex-type.2.4.a: Invalid content was found
starting with element 'xforms:group'. One of '{
"http://www.w3.org/1999/xhtml":p,
"http://www.w3.org/1999/xhtml":h1,
... etc ...
}' is expected.
Resource debug-xml-view.xml
In Folder vendorSite/webRoot/WEB-INF/resources/pagesets/checkout
Location line 13
Creation Time September 29, 2004 11:01:30 AM
What must I do to be able to validate the above document?

Posted: Thu Sep 30, 2004 6:38 am
by george
Hi,

You need a schema that will accept xforms:group in the content of xhtml:body. The http://www.w3.org/2002/08/xhtml/xhtml1-transitional.xsd allows only some elements from the http://www.w3.org/1999/xhtml namespace inside xhtml:body.

Best Regards,
George

Posted: Thu Sep 30, 2004 6:48 am
by george
Hi again,

There are basically two options here. One is to make your schema allow xforms elements (or any elements from other namespaces) and the other is to validate the part of the document from a certain namespace with its own schema. The latter is what NRL (Namespace Routing Language) schemas do. Oxygen has support for NRL so you may consider that as an option. See http://www.thaiopensource.com/relaxng/nrl.html for more details about NRL.
It should allow to validate the xhtml part against the xhtml schema and also the xforms part against an xforms schema if you have one.

Best Regards,
George

Posted: Thu Sep 30, 2004 7:36 am
by bwinspur
George,
Thanks for the NRL and custom-schema suggestions.

For your info, I am learning Orbeon's Open Integration Suite (OIS) (http://www.orbeon.com/ & http://sourceforge.net/projects/orbeon/).

OIS is an open source server-side implementation of xforms, pipelines, and pageflows, that is functionally similar to cocoon.

Although orbeon's eclipse plugin does have editors, I'm happy with the oxygen tools so I'm trying to use oxygen for coding and orbeon's plugin for pipeline debugging. I think I can get the appropriate custom schemas from the OIS project.