I noticed this reply to your message on the list (from mba). Seems like
you did not get it?


larrydlefever wrote:


> > per
> >  
> > http://svn.services.openoffice.org/opengrok/xref/DEV300_m59/sw/source/filter/html/htmlatr.cxx#1013
> > 
> > there seem to be certain rules regarding when a <P> tag is output when using
> > "Save as ..." in Writer (I tried to translate the German here into English
> > -- I need help with that, incidentally):
> > 
> > Ein <P> wird nur geschrieben, wenn
> > - wir in keiner OL/UL/DL sind, oder
> > - der Absatz einer OL/UL nicht numeriert ist, oder
> > - keine Styles exportiert werden und
> >      - ein unterer Abstand oder
> >      - eine Absatz-Ausrichtung existiert, ode
> > - Styles exportiert werden und,
> >      - die Textkoerper-Vorlage geaendert wurde, oder
> >      - ein Benutzer-Format exportiert wird, oder
> >      - Absatz-Attribute existieren
> > 
> > 
> > A <P> is written only if:
> >  - we're not in a list of any kind; or
> >  - the paragraph we're in is in an unordered list; or
> >  - no Styles are being exported and a (lower distance?) exists or
> >      a paragraph-adjustment exists; or
> >  - Styles are being exported and the text-body format/style? was changed; or
> >  - a User-defined format is being exported; or
> >  - paragraph-attributes exist
> > 
> > I want to know if I'd need to hack that native code there, in order to get
> > cleaner HTML-output than I'm currently getting from OpenOffice.
>   

Yes.


> > Incidentally, I've also tried Exporting as XHTML, but the resultant output
> > is even worse than that from "Save as ...": stuff that should not appear in
> > a list does so, etc.
>   

Could you create an issue with a sample document showing the problem and
assign it to "sus"?


> > I've tweaked the Java-example servlet for document-conversion, so it takes
> > an MS-Word doc as upload and returns (really just the file:/// URL of) an
> > HTML-document.
> > 
> > I do like so in my code:
> > 
> >             // Setting the filter name
> >             propertyvalue[1] = new PropertyValue();
> >             propertyvalue[1].Name = "FilterName";
> >             propertyvalue[1].Value = "HTML (StarWriter)";
> > 
> > ... which I believe means, effectively, "Save as ...", rather than "Export",
> > the latter involving a different area of the OpenOffice codebase, if I'm not
> > mistaken.
>   

Whether "SaveAs" or "Export" is chosen just depends on whether you use
"storeAsURL" or "storeToURL". The difference is only that in one case
the document takes over the new location while in the other it doesn't.
The GUI stuff around these two function also uses different filters in
both areas, but that's a limitation you don't have when using the API.
All filters suitable for "SaveAs" can be used for "Export" also (but not
the other way around as only filters for formats that OOo can load will
be accepted in "storeAsURL").


> > So, what's the best way to make the desired improvements in the HTML-output?
>   

As both filters (the C++ one for HTML as well as the xslt based one for
XHTML) seem to fail for you, the best way probably is the one you are
more familiar with. If you know something about xslt, perhaps hacking
the xslt for XHTML is better, because the "native" filter not only
requires good C++ knowledge but also getting familiar with an
unpredictable amount of OOo code (what exactly you will need to know
depends on where your journey will take you).

Regards,
Mathias

-- Mathias Bauer (mba) - Project Lead OpenOffice.org Writer
OpenOffice.org Engineering at Sun: http://blogs.sun.com/GullFOSS Please
don't reply to "nospamfor...@gmx.de". I use it for the OOo lists and
only rarely read other mails sent to it.
--------------------------------------------------------------------- To
unsubscribe, e-mail: dev-unsubscr...@openoffice.org For additional
commands, e-mail: dev-h...@openoffice.org


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscr...@openoffice.org
For additional commands, e-mail: dev-h...@openoffice.org

Reply via email to