Long select attributes of xsl:variable and xsl:value-of

Oxygen general issues.
alyxandr
Posts: 18
Joined: Sat Aug 01, 2009 7:52 pm

Long select attributes of xsl:variable and xsl:value-of

Post by alyxandr »

This might be more of a general XML/XSL question than one specific to oXygen, for which i apologize, but is there an aesthetically acceptable way to format long bits of xpath (which can happen a lot in XSLT 2.0) in select attributes, in a way that will be preserved? The XML spec apparently states that CRs in attributes can be stripped, but spaces aren't, which makes for long single lines with large areas of whitespace intermingled, which "Format and Indent" won't touch.

Any ideas appreciated,

--alex.
sorin_ristache
Posts: 4141
Joined: Fri Mar 28, 2003 2:12 pm

Re: Long select attributes of xsl:variable and xsl:value-of

Post by sorin_ristache »

Hello,

You can enable the option Break long attributes that is available in Preferences -> Editor -> Format -> XML if you want to break a long XPath expression when applying the action Format and Indent. That option inserts newline characters in attribute values if the maximum line width set in the option Line width - Format and Indent (available in Preferences -> Editor -> Format) is exceeded.


Regards,
Sorin
alyxandr
Posts: 18
Joined: Sat Aug 01, 2009 7:52 pm

Re: Long select attributes of xsl:variable and xsl:value-of

Post by alyxandr »

Awesome, thanks!
Post Reply