History | Log In     View a printable version of the current page.  
Issue Details (XML | Word | Printable)

Key: IDEADEV-20358
Type: New Feature New Feature
Status: Open Open
Priority: Normal Normal
Assignee: Dmitry Avdeev
Reporter: Taras Tielkes
Votes: 0
Watchers: 1
Operations

If you were logged in you would be able to see more operations.
IDEA: Development

XML code style: different formatting options for xsi:schemaLocation

Created: 12 Aug 07 18:24   Updated: 23 Sep 08 20:58
Component/s: Code Formatting and Code Style, XML editing
Fix Version/s: None

Original Estimate: Unknown Remaining Estimate: Unknown Time Spent: Unknown

Build: 7,118


 Description  « Hide
Some XML formats often import other namespaces, and use a "xsi:schemaLocation" attribute to specify (real or virual) schema locations.
One very common example these days is the Spring Framework, which already has 7 different schemas, and requires "xsi:schemaLocation" pairs to be present for all namespaces that have a schema available.

There are 3 ways to format a "xsi:schemaLocation" attribute:

  • whole attribute on one line
  • every pair on a separate line
  • every namespace or schemaLocation on a separate line (2 lines for each pair)

Such a preference/option could be added to the "Code Style" tab for XML, and used by the formatter.

When the attribute value is spread over multiple lines, it's common to indent all subsequent lines to align them to the first line. For example:

<?xml version="1.0" encoding="UTF-8" ?>
<beans.xmlns="http://www.springframework.org/schema/beans"
.......xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
.......xmlns:aop="http://www.springframework.org/schema/aop"
.......xmlns:tx="http://www.springframework.org/schema/tx"
.......xsi:schemaLocation="http://www.springframework.org/schema/beans.http://www.springframework.org/schema/beans/spring-beans-2.0.xsd
...........................http://www.springframework.org/schema/aop.http://www.springframework.org/schema/aop/spring-aop-2.0.xsd
...........................http://www.springframework.org/schema/tx.http://www.springframework.org/schema/tx/spring-tx-2.0.xsd">
</beans>


 All   Comments   Work Log   Change History      Sort Order:
There are no comments yet on this issue.