Custom formatting code

Oxygen general issues.
Geoff16W
Posts: 8
Joined: Fri Mar 04, 2011 3:28 pm

Custom formatting code

Post by Geoff16W »

I have a question about how I can custom "join and normalize" within certain elements only.

When I hit "ctr+j" the entire text normalizes. But I would like to "join and normalize" only what is contained within each <p></p>. I can do this by hand, by selecting the individual paragraph and the hitting ctr+j. But I would rather not do this manually for each paragraph. Can you tell me how I can do this automatically for a specified element. (i.e. for the all my <p></p> elements.)

Thanks for your help :)
adrian
Posts: 2855
Joined: Tue May 17, 2005 4:01 pm

Re: Custom formatting code

Post by adrian »

Hello,

You can do this automatically for all <p></p> elements by using the Find/Replace(Ctrl+F) dialog.

Text to find: \s+
Replace with: <space>
Use the actual space character: ' '

XPath: //p

Enable:
Regular expression

Press "Replace All" and all whitespaces from <p></p> elements will be normalized

Regards,
Adrian
Adrian Buza
<oXygen/> XML Editor, Schema Editor and XSLT Editor/Debugger
http://www.oxygenxml.com
Post Reply