Customizable code formatting
Are you missing a feature? Request its implementation here.
Customizable code formatting
Currently the control over code formatting isn't as tweakable as I'd like in Oxygen. I was working on a project the other day when I suddenly had an epiphany: rule-based formatting!
Duh! It makes perfect sense. When I found myself wishing for a way to automate formatting of my code, I initially thought to myself, "Well, it will be boring and a diversion from my current projects, but I could write an XSL stylesheet to format code…" That way I would get all the control I need.
But then I realized that the control is coming from XPath. So, I would like to put in a request for XPath-based rules for code formatting. You've already got great XPath support built-in, so if I could just specify rules like, "Normalize all space within the text of <p> elements", then I could just type in "p/text()" and check a box that says "normalize".
Duh! It makes perfect sense. When I found myself wishing for a way to automate formatting of my code, I initially thought to myself, "Well, it will be boring and a diversion from my current projects, but I could write an XSL stylesheet to format code…" That way I would get all the control I need.
But then I realized that the control is coming from XPath. So, I would like to put in a request for XPath-based rules for code formatting. You've already got great XPath support built-in, so if I could just specify rules like, "Normalize all space within the text of <p> elements", then I could just type in "p/text()" and check a box that says "normalize".
-- Zearin
-
- Posts: 4141
- Joined: Fri Mar 28, 2003 2:12 pm
Re: Customizable code formatting
Post by sorin_ristache »
Hello,
Thank you for your request. We will consider it for a future version but the implementation of formatting of an XML document based on XPath rules seems very hard. You should create your own XSLT stylesheet for your tweaked XML formatting until we implement this type of XML formatting.
Regards,
Sorin
Thank you for your request. We will consider it for a future version but the implementation of formatting of an XML document based on XPath rules seems very hard. You should create your own XSLT stylesheet for your tweaked XML formatting until we implement this type of XML formatting.
Regards,
Sorin
-
- Posts: 4141
- Joined: Fri Mar 28, 2003 2:12 pm
Re: Customizable code formatting
Post by sorin_ristache »
If you want only the normalization of some elements specified by an XPath expression you can use the Strip space elements list available in Preferences -> Editor -> Format -> XML. In this list you can add XPath expressions for elements for which the Format and Indent action normalizes the whitespaces.
Regards,
Sorin
Regards,
Sorin
Jump to
- Oxygen XML Editor/Author/Developer
- ↳ Feature Request
- ↳ Common Problems
- ↳ DITA (Editing and Publishing DITA Content)
- ↳ SDK-API, Frameworks - Document Types
- ↳ DocBook
- ↳ TEI
- ↳ XHTML
- ↳ Other Issues
- Oxygen XML Web Author
- ↳ Feature Request
- ↳ Common Problems
- Oxygen Content Fusion
- ↳ Feature Request
- ↳ Common Problems
- Oxygen JSON Editor
- ↳ Feature Request
- ↳ Common Problems
- Oxygen PDF Chemistry
- ↳ Feature Request
- ↳ Common Problems
- Oxygen Feedback
- ↳ Feature Request
- ↳ Common Problems
- Oxygen XML WebHelp
- ↳ Feature Request
- ↳ Common Problems
- XML
- ↳ General XML Questions
- ↳ XSLT and FOP
- ↳ XML Schemas
- ↳ XQuery
- NVDL
- ↳ General NVDL Issues
- ↳ oNVDL Related Issues
- XML Services Market
- ↳ Offer a Service