Issue 87731 - Export an XForm/Form as XHTML contains no content
Export an XForm/Form as XHTML contains no content
Status: ACCEPTED
Product: xml
Classification: Code
Component: external filters
OOo 2.4.0
All All
: P3 trivial (vote)
: AOO 4.x
Assigned To: AOO issues mailing list
:
: 47549 (view as issue list)
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2008-04-02 10:38 UTC by aflinton
Modified: 2013-03-11 15:01 UTC (History)
1 user (show)

See Also:
Issue Type: PATCH
Latest Confirmation on: ---
Developer Difficulty: ---


Attachments
Example ODT containing a form (8.48 KB, application/vnd.oasis.opendocument.text)
2008-04-02 10:39 UTC, aflinton
no flags Details
test sample used (13.08 KB, application/vnd.oasis.opendocument.text)
2008-09-15 18:49 UTC, xquery
no flags Details
result of export (12.19 KB, text/plain)
2008-09-15 18:57 UTC, xquery
no flags Details

Note You need to log in before you can comment on or make changes to this issue.
Description aflinton 2008-04-02 10:38:40 UTC
If you create a form/XForm in the writer & then chose File/Export and then
choose the file format of xhtml the output file looks like this:

<?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="http://www.w3.org/1999/xhtml"><head><meta http-equiv="content-type"
content="text/html; charset=utf-8" /><title /><meta name="generator"
content="StarOffice/OpenOffice.org XSLT (http://xml.openoffice.org/sx2ml)"
/><meta name="author" content="Adam Flinton" /><meta name="created"
content="2008-04-01T11:30:20" /><meta name="changedby" content="Adam Flinton"
/><meta name="changed" content="2008-04-01T14:29:56" /><base href="." /><style
type="text/css">
	@page { size: 20.999cm 29.699cm; margin-top: 2cm; margin-bottom: 2cm;
margin-left: 2cm; margin-right: 2cm }
	table { border-collapse:collapse; border-spacing:0; empty-cells:show }
	td, th { vertical-align:top; }
	h1, h2, h3, h4, h5, h6 { clear:both }
	ol, ul { padding:0; }
	* { margin:0; }
	*.gr1 { font-size:12pt; border-width:solidcm; border-style:; border-color:; }
	*.gr2 { font-size:12pt; }
	*.Caption { font-family:'Times New Roman'; font-size:12pt; margin-top:0.212cm;
margin-bottom:0.212cm; font-style:italic; }
	*.Heading { font-family:Arial; font-size:14pt; margin-top:0.423cm;
margin-bottom:0.212cm; }
	*.Index { font-family:'Times New Roman'; font-size:12pt; }
	*.List { font-family:'Times New Roman'; font-size:12pt; margin-top:0cm;
margin-bottom:0.212cm; }
	*.ListContents { font-family:'Times New Roman'; font-size:12pt;
margin-left:1cm; margin-right:0cm; text-indent:0cm; }
	*.P1 { font-family:'Times New Roman'; font-size:12pt; text-align:left !
important; font-style:normal; }
	*.P2 { font-family:'Times New Roman'; font-size:12pt; text-align:left !
important; }
	*.P3 { font-family:'Times New Roman'; font-size:12pt; text-align:left !
important; }
	*.Standard { font-family:'Times New Roman'; font-size:12pt; }
	*.Textbody { font-family:'Times New Roman'; font-size:12pt; margin-top:0cm;
margin-bottom:0.212cm; }
	*.EndnoteSymbol { }
	*.FootnoteSymbol { }
	*.Internetlink { color:#000080; text-decoration:underline; }
	*.VisitedInternetLink { color:#800000; text-decoration:underline; }
	</style></head><body dir="ltr"><p class="P2" /></body></html>


i.e. absolutely no content.
Comment 1 aflinton 2008-04-02 10:39:46 UTC
Created attachment 52458 [details]
Example ODT containing a form
Comment 2 michael.ruess 2008-04-02 14:46:34 UTC
Reassigned to JSI.
Comment 3 jogi 2008-09-12 16:14:02 UTC
Accepted, also in OOO300m5
Comment 4 jogi 2008-09-12 16:20:47 UTC
change components
Comment 5 jogi 2008-09-12 16:25:04 UTC
sub category: external filters
Comment 6 xquery 2008-09-15 18:48:03 UTC
first portion of XForms magic - enjoy

	<!-- XForms -->

	<xsl:template match="office:forms[xforms:*]">
		<xsl:apply-templates/>
	</xsl:template>

	<xsl:template match="xforms:*">
		<xsl:copy-of select="."/>
	</xsl:template>

	<xsl:template match="form:form"/>

	<xsl:template match="form:text | form:formatted-text | form:checkbox">
		<xforms:input bind="{@xforms:bind}">
			<xsl:apply-templates select="//form:fixed-text[@form:for 
eq current()/@form:id]"
				mode="forms-label"/>
		</xforms:input>
	</xsl:template>

	<xsl:template match="form:fixed-text" mode="forms-label">
		<xforms:label>
			<xsl:value-of select="@form:label"/>
		</xforms:label>
	</xsl:template>
	
	<xsl:template match="form:radio[@xforms:bind]">
		<xforms:select1 bind="{@xforms:bind}" appearance="full">
			<xsl:apply-templates select="../form:radio[@form:name eq 
current()/@form:name]" mode="radio-values"/>
		</xforms:select1>
	</xsl:template>
	
	<xsl:template match="form:radio" mode="radio-values">
		<xforms:item>
			<xforms:value><xsl:value-of 
select="@form:label"/></xforms:value>
			<xforms:label><xsl:value-of 
select="@form:label"/></xforms:label>
		</xforms:item>
	</xsl:template>
	
	<xsl:template match="form:button[@form:button-type='submit' ]">
		<xforms:submit submission="{@form:xforms-submission}">
			<xforms:label><xsl:value-of 
select="@form:label"/></xforms:label>
		</xforms:submit>
	</xsl:template>

	<xsl:template match="draw:g[draw:control]">
		<xsl:apply-templates/>
	</xsl:template>
	
	<xsl:template match="draw:control">
		<!-- possibly better to use index here, but form usually not so 
huge -->
		<xsl:apply-templates select="//form:*[@form:id eq 
current()/@draw:control][1]"></xsl:apply-templates>
	</xsl:template>

	<xsl:template match="form:frame">
		<xforms:group>
			<xsl:apply-templates/>
		</xforms:group>
	</xsl:template>
	
	<xsl:template match="form:combobox">
		<xforms:select1 bind="{@xforms:bind}" appearance="minimal">
			<xsl:apply-templates/>
		</xforms:select1>
	</xsl:template>
	
	<xsl:template match="form:item">
		<xforms:item>
			<xforms:value><xsl:value-of 
select="@form:label"/></xforms:value>
			<xforms:label><xsl:value-of 
select="@form:label"/></xforms:label>
		</xforms:item>
	</xsl:template>
	
	<xsl:template match="form:listbox">
		<xforms:select1 bind="{@xforms:bind}">
			<xforms:itemset bind="{@form:xforms-list-source}">
				<xforms:label ref="."/>
				<xforms:value ref="."/>
			</xforms:itemset>
		</xforms:select1>
	</xsl:template>

Comment 7 xquery 2008-09-15 18:49:13 UTC
Created attachment 56547 [details]
test sample used
Comment 8 xquery 2008-09-15 18:57:14 UTC
Created attachment 56548 [details]
result of export
Comment 9 xquery 2008-09-15 19:06:00 UTC
can`t add attachment with mimetype application/xhtml+xml

just got answer - "You must select a legal mime type. 'application/xhtml+xml' is 
not a legal mime type."

should i add bug for bugzilla? :)

by the way - i used for testing X-Smiles browser while XForms plugin for Firefox 
3.0 are broken (but at least in X-Smiles all work as expected)
Comment 10 svante.schubert 2008-09-16 09:42:30 UTC
*** Issue 47549 has been marked as a duplicate of this issue. ***
Comment 11 svante.schubert 2008-09-16 10:21:44 UTC
Adapt issue type to PATCH and target to OOo 3.0.1.
Add issue to CWS xsltfilter11 and going to review this issue soon..

Kind regards,
Svante
Comment 12 svante.schubert 2008-12-03 11:08:07 UTC
I am sorry. I have to postpone this, due to my work on the ODF 1.2 format and
the ODF toolkit.
 
PS: What MIME Type shall we use for the XHTML? We are currently using XHTML 1.1
with mathml, but there is AFAIK no XHTML with mathml & xforms..
Comment 13 xquery 2008-12-03 12:59:45 UTC
mathml already supported by current filter... just not every document contain 
equation(s)... IMHO: the best solution - implement some kind of "dynamic 
doctype" but this is out of XSLT scope

i hope find some time to adapt my path for ODF 1.2 filter in near future
Comment 14 svante.schubert 2009-02-02 15:40:12 UTC
As my daughter was born three days earlier than expected, I have to postpone
this CWS to the next OOo release. I will be in a parental absence till mid of March.

Sorry for the delay.
Svante
Comment 15 svante.schubert 2009-10-22 21:30:41 UTC
As there are no more parental absence months for me, I am pretty confident the
patch will make it to the OOo 3.3.
Sorry for the delay!
Svante
Comment 16 thorsten.ziehm 2010-11-09 08:36:01 UTC
OOo 3.3 is nearly final. I change the target of this issue to OOo 3.x. Please
find a solution and set a correct target, if you know when a fix can be integrated.
Comment 17 Rob Weir 2013-03-11 15:01:20 UTC
I'm adding this comment to all open issues with Issue Type == PATCH.  We have 220 such issues, many of them quite old.  I apologize for that.  

We need your help in prioritizing which patches should be integrated into our next release, Apache OpenOffice 4.0.

If you have submitted a patch and think it is applicable for AOO 4.0, please respond with a comment to let us know.

On the other hand, if the patch is no longer relevant, please let us know that as well.

If you have any general questions or want to discuss this further, please send a note to our dev mailing list:  dev@openoffice.apache.org

Thanks!

-Rob