Turn off indentation for all text()-nodes

Having trouble installing Oxygen? Got a bug to report? Post it all here.
Hudi
Posts: 10
Joined: Thu Feb 09, 2006 3:19 pm

Turn off indentation for all text()-nodes

Post by Hudi »

Hi there,

Although I checked the forum for any hint on my prticular problem, I couldn't find what I was searching for.

I would like to use the pretty-pritn function as it is, but with a single change in its behavior. I just want to pretty-print my markup and leave the text content unchanged.
Using pretty-print now results in linefeed chrarcters within my text content. That has grave impacts on my further XML workflow.

Is there any way to only pretty print the XML markup?

wbr,
Roman
sorin_ristache
Posts: 4141
Joined: Fri Mar 28, 2003 2:12 pm

Post by sorin_ristache »

Hello,

The Preserve space elements list (Options -> Preferences -> Editor / Format) was introduced in <oXygen/> for this purpose. Usually the text nodes that should remain unformatted are contained in only one or two element types (for example programlisting and screen in DocBook). All you have to do is adding the element names to that list. Another option is to add the xml:space="preserve" attribute to the elements containing the text nodes which should not be changed, but this is not feasible if there are many preserve space elements.

Regards,
Sorin
Hudi
Posts: 10
Joined: Thu Feb 09, 2006 3:19 pm

Post by Hudi »

Hi Sorin,

Thank you very much for your quick reply.
Editing the preserve element list works fine, but is quite a lot of manual work, since there are quite a few elements to take into account.
Is it possible to export this list afterwards to avoid reentering these elements within the other OxygenXML installations?

wbr,
Roman
Hudi
Posts: 10
Joined: Thu Feb 09, 2006 3:19 pm

Post by Hudi »

Hi,

I just did some tests and realized that editing this exclusion list means that all elements which are allowed to include text must be entered... I don't think that this is doable for every new DTD....

wbr,
Roman
sorin_ristache
Posts: 4141
Joined: Fri Mar 28, 2003 2:12 pm

Post by sorin_ristache »

Hello,
Hudi wrote:Editing the preserve element list works fine, but is quite a lot of manual work, since there are quite a few elements to take into account.
Is it possible to export this list afterwards to avoid reentering these elements within the other OxygenXML installations?
Sure, export your <oXygen/> options with Options -> Export Options and import them in other installations with Options -> Import Options.

Regards,
Sorin
sorin_ristache
Posts: 4141
Joined: Fri Mar 28, 2003 2:12 pm

Post by sorin_ristache »

Hi Roman,
Hudi wrote:I just did some tests and realized that editing this exclusion list means that all elements which are allowed to include text must be entered... I don't think that this is doable for every new DTD....
I think you need some kind of schema-aware pretty-print operation, which should preserve whitespace in simple type elements and complex type elements with mixed content, and apply formatting only to complex type elements with element only content. We will consider it for implementation in a future version.

Regards,
Sorin
Hudi
Posts: 10
Joined: Thu Feb 09, 2006 3:19 pm

Post by Hudi »

Hi Sorin,

That sounds really promising. Since we are running in more and more problems using Altova's XML Spy for our stylesheet developments, we are really looking forward to changing to OxygenXML.
I hope to have found a work-around for the meantime. I created an xslt stylesheet, which extracts all element names from a XSD and inserts them into an exported OxygenXML property file. I have to do some test with it today, but I hope to get it working.
Thanks a lot for your help!

wbr,
Roman
Post Reply