Hello Fr�d�ric

Thank you for your helpful hints

---------------------
Wrapping elements
---------------------

Using XSLT to add structure to the flat XML structure of the OpenOffice
document is certainly only to a limited extent possible. 

In fact, I assume I have to use the OpenOffice API to write a filter and
create any missing structure.

Framemaker as authoring tool does offer a procedure (using a.k.a.
mapping files...) which you can use to add structure to some extent. But
I assume OpenOffice has nothing of the kind.



---------------------
XSLT problems
---------------------

Yes, I think I have to delve deeper into the XSLT part.

I am using:

        java org.apache.xalan.xslt.Process  



My problem (Perhaps this might amuse you!):


I can use "following-sibling" for a look-ahead. and find out that "the
next para will be the start of a para with the style "Preformatted Text"
, for example. (Then I can say "start CDATA!")

BUT: I cannot predict the results of using XPath axis preceding-sibling
- it never seems to return anything useful. So I will never find out,
for example, that the "Preformatted Text" I am already in has already
started -  a Heading (text:h) was the immediately preceding element.


Perhaps I have to find an XML parser that has a fully funkctioning
"preceding-sibling" axis (?)


---------------------
Can I look at your 
snippets (?)
---------------------

If you have public snippets, i am surely very interested - and motivated
- to understand these.





---------------------
CDATA
---------------------

The CDATA requirement is set by the open source project Apache Maven. 

I can reject this and remain satisified with the character escaping done
by OpenOffice.

Still we might have a requirement later to pass thru CDATA elements and
I will be alert to find an XSLT stylesheet processor which is capable of
"unescaping" characters for elements which are specified as CDATA.

Yes, <xsl:output cdata-section-elements="my:cdata"/> does work.

But in this case, instead of specify each and every paragraph as a CDATA
section, it would have been nice to wrap all paras into a <source>
element and then specify the <source> element as CDATA . But I will
still consider this approach



Thanks again Fr�d�ric 


and wishing you a nice start into the week



Valerie 






Fr�d�ric Glorieux wrote:
> 
> > I want to wrap all consecutive elements "text:p" with the attribute
> > "text:style-name='PreformattedText'" into a CDATA-section.
> 
> To group following-sibling elements with same style name could be quite
> tricky. I got some public snippets, but perhaps not trivial and not
> relevant to your context.
> 
> > The problem I
> > cannot solve at the moment is: to  prevent the OO-Writer from escaping
> > special characters (such as < and > with the entities "&lt;" and "&gt;")
> 
> It seems to me an xsl topic more than OOo. I'm not sure they will open
> soon CDATA elements (sad, but it's not yet a real XML editor)
> 
> For your need, if it is absolutely requested for your production chain,
> have a look there
> 
> <http://www.w3.org/TR/xslt#output>
> <xsl:output cdata-section-elements="my:cdata"/>
> 
> to create elements with CDATA inside
> 
> and
> 
> <http://www.w3.org/TR/xslt#section-Creating-Text>
> <xsl:text disable-output-escaping = "yes"/>
> 
> depending on xslt processor but may have the desired effect of
> unescaping entities (&lt;, &gt;)
> 
> --
> Fr�d�ric Glorieux ("AJLSM", <http://ajlsm.com>)
> "Transfolio" <http://transfolio.org>
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to