Getting rid of pretty-print

Having trouble installing Oxygen? Got a bug to report? Post it all here.
martindholmes
Posts: 178
Joined: Wed Apr 20, 2005 5:43 pm
Location: Victoria, BC, Canada

Getting rid of pretty-print

Post by martindholmes »

I have a stack of documents that have been damaged by the use of pretty-print -- by which I mean that someone editing the files, who didn't really understand pretty-print and how to configure it, has pretty-printed thousands of instances of mixed content where spaces and returns shouldn't actually exist.

I thought I'd be able to fix this easily using regular expressions, but of course I can't, because oXygen regexp matches only work within lines, and pretty-rinting runs across lines.

Is there any other way to fix this in oXygen, or should I just move the files to another editor to do the work?

Cheers,
Martin
george
Site Admin
Posts: 2095
Joined: Thu Jan 09, 2003 2:58 pm

Post by george »

Hi,

A possible approach is to write an XSL and pass your damaged documents through that. You can start with an identity template (type ct followed by CTRL+Space in the oXygen XSL editor to get it) and add match rules to the elements you want to process differently (by normalizing the text for instance).
If you use XSLT 2.0 then you should be able to use regular expressions as XSLT 2.0 has regex support.
As a side note, it is best to use a versioning system like CVS or SVN. oXygen will offer SVN support soon and if you use the Eclipse plugin (note that the license covers both the standalone and the Eclipse plugin) then you should be able to use already the Eclipse versioning plugins for CVS, SVN, etc.

Best Regards,
George
Post Reply