[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] Re: Source code formatting
I recently thought about this when I wondered how we can preserve
whitespace in attributes when migrating XProc 1.0 documents (that often
include inline XSLT with multi-line attributes, in addition to their own
multiline attributes) to XProc 3.0.
At first I thought that the easiest solution would be to patch xerces so that it optionally doesnbt perform whitespace normalization in attributes any more. But for migrating XProc it might be useful to parse the XPath expressions anyway, because they sometimes need to be modified in a non-trivial way. And once you parse them, you can reformat them. Possibly not at the original locations, but after iteration 2 it will be idempotent. And thatbs what you probably want, an XPath linter within your XSLT linter. People I know of who recently parsed XPath 3.1 (with XSLT and probably also other languages, maybe with REx-generated parsers) are Wendell Piez and Phil Fearon. Maybe they can point you to a readily available REx-generated parser in XSLT. A poor man's solution could be to use string-based preprocessing (be it unparsed-text() from within XSLT, Perl, ...) in order to substitute whitespace in the attributes with other characters (maybe from the private use area), lint the XSLT, and then revert the replacements. Gerrit On 28.07.2020 23:17, Willem Van Lishout willemvanlishout@xxxxxxxxx wrote: Hi list,
|
PURCHASE STYLUS STUDIO ONLINE TODAY!Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced! Download The World's Best XML IDE!Accelerate XML development with our award-winning XML IDE - Download a free trial today! Subscribe in XML format
|