I'm working on an application that embeds Orbeon XForms renderer. I'm using this to generate XHTML rather than HTML. We have a form that uses 2 custom XBL components.
The XHTML that we pass to orbeon is appears to be correct. But the resulting XHTML from Orbeon contains the definition of the xbl name-space on the <body>
element twice. This prevents it being parsed as valid XML.
This is actually a very complex form which I can't post here but the important bits for this question are:
<xhtml:html
xmlns:exf="http://www.exforms.org/exf/1-0"
xmlns:xs="http://www.w3.org/2001/XMLSchema"
xmlns:xxforms="http://orbeon.org/oxf/xml/xforms"
xmlns:ev="http://www.w3.org/2001/xml-events"
xmlns:xf="http://www.w3.org/2002/xforms"
xmlns:f="http://orbeon.org/oxf/xml/formatting"
xmlns:fw="http://orionhealth.com/forms/widgets" xmlns:xhtml="http://www.w3.org/1999/xhtml">
<xhtml:head>
<!-- Lots of stuff -->
<xbl:xbl xmlns:xbl="http://www.w3.org/ns/xbl">
<xbl:script src="...."/>
<xbl:binding id="fw-autocomplete" element="fw|autocomplete">
<xbl:template>
<!-- Lots of stuff -->
</xbl:template>
</xbl:binding>
</xbl:xbl>
<xbl:xbl xmlns:xbl="http://www.w3.org/ns/xbl">
<xbl:script src="...."/>
<xbl:binding id="fw-datetime" element="fw|datetime">
<xbl:template>
<!-- Lots of stuff -->
</xbl:template>
</xbl:binding>
<xbl:binding id="fw-date" element="fw|date">
<xbl:template>
<!-- Lots of stuff -->
</xbl:template>
</xbl:binding>
<xbl:binding id="fw-partial-date" element="fw|partial-date">
<xbl:template>
<!-- Lots of stuff -->
</xbl:template>
</xbl:binding>
</xbl:xbl>
</xhtml:head>
<xhtml:body id="body">
<!-- Lots of stuff -->
</xhtml:body>
</xhtml:html>
Of note, while both of the XBL components are defined, neither of them is actually used in the body of the document. The resulting XHTML from Orbon (again simplified) is:
<?xml version="1.0" encoding="utf-8"?><!DOCTYPE html
PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns:exf="http://www.exforms.org/exf/1-0"
xmlns:xs="http://www.w3.org/2001/XMLSchema"
xmlns:xxforms="http://orbeon.org/oxf/xml/xforms"
xmlns:ev="http://www.w3.org/2001/xml-events"
xmlns:xf="http://www.w3.org/2002/xforms"
xmlns:f="http://orbeon.org/oxf/xml/formatting"
xmlns:fw="http://orionhealth.com/forms/widgets"
xmlns:xhtml="http://www.w3.org/1999/xhtml"
xmlns="http://www.w3.org/1999/xhtml"
xxforms:noscript="true">
<head>
<!-- Lots of Stuff -->
</head>
<body xmlns:xbl="http://www.w3.org/ns/xbl" xmlns:xbl="http://www.w3.org/ns/xbl"
id="body"
class="yui-skin-sam">
<!-- Lots of Stuff -->
</body>
</html>
Note the duplicated xmlns:xbl="http://www.w3.org/ns/xbl"
on the body tag.
Googling I haven't found anything about this issue, does anyone know what would cause this and what I can to to fix it?
I have noticed that if I define the xbl prefix on the <xhtml:html>
element instead of each <xbl:xbl>
element this doesn't seem to be a problem and the resulting XHTML out of Orbeon only has this prefix defined once on the <xhtml:html>
element.