Subject: Generating ODF
From: Michael B Allen <mba2000@xxxxxxxxxx>
Date: Tue, 13 Mar 2007 23:00:19 -0400
|
Does anyone have experience emitting ODF?
I have the basics working but now I'm into tables and things that are
clearly not elegantly handled due to excentricities in ODF's schema.
For example, my master doc uses a 'pre' tag to format code fragments
and such like:
<pre>
// find accounts with a logonCount of 0
$params = array(
'base' => 'CN=Users,DC=example,DC=com',
'scope' => 'sub',
'filter' => '(&(objectClass=user)(logonCount=0))'
);
$objs = foo_search_objects($px, $params);
</pre>
The target ODF output is:
<text:p text:style-name="Code_20_Sample">// find accounts with a logonCount of 0</text:p>
<text:p text:style-name="Code_20_Sample">$params = array(</text:p>
<text:p text:style-name="Code_20_Sample"><text:s text:c="4"/>'base' => 'CN=Users,DC=example,DC=com',</text:p>
<text:p text:style-name="Code_20_Sample"><text:s text:c="4"/>'scope' => 'sub',</text:p>
<text:p text:style-name="Code_20_Sample"><text:s text:c="4"/>'filter' => '(&(objectClass=user)(logonCount=0))'</text:p>
<text:p text:style-name="Code_20_Sample">);</text:p>
<text:p text:style-name="Code_20_Sample">$objs = foo_search_objects($px, $params);</text:p>
There several hurdles in generating this.
1. Every line is text:p tagged separately
2. Indenting is represented using text:s tags.
I've done this sort of thing enough before that I'm optimistic that I
can make it work but I was hoping someone else has already done this
sort of thing and had some template fragments they could share?
Mike
--
Michael B Allen
PHP Active Directory SSO
http://www.ioplex.com/
|