rspec/rules/S1120/xml/rule.adoc
Sylvain Kuchen 03b6321d0f
Modify rule S1120: Migrate to LaYC format (#3195)
Co-authored-by: Anton Haubner <anton.haubner@sonarsource.com>
2023-10-04 12:30:43 +02:00

94 lines
2.2 KiB
Plaintext

include::../introduction.adoc[]
== Why is this an issue?
include::../why.adoc[]
=== What is the potential impact?
include::../impact.adoc[]
== How to fix it
include::../how-to-fix.adoc[]
=== Code examples
==== Noncompliant code example
With an indent size of 2:
[source,xml,diff-id=1,diff-type=noncompliant]
----
<?xml version="1.0"?>
<catalog>
<book id="bk101">
<author>Gambardella, Matthew</author>
<title>XML Developer's Guide</title> <!-- Noncompliant, expected to start at column 4 -->
<genre>Computer</genre>
<price>44.95</price>
<publish_date>2000-10-01</publish_date>
<description>An in-depth look at creating applications
with XML.</description>
</book>
<book id="bk102"> <!-- Noncompliant, expected to start at column 2 -->
<author>Ralls, Kim</author>
<title>Midnight Rain</title>
<genre>Fantasy</genre>
<price>5.95</price>
<publish_date>2000-12-16</publish_date>
<description>A former architect battles corporate zombies,
an evil sorceress, and her own childhood to become queen
of the world.</description>
</book>
</catalog>
----
==== Compliant solution
[source,xml,diff-id=1,diff-type=compliant]
----
<?xml version="1.0"?>
<catalog>
<book id="bk101">
<author>Gambardella, Matthew</author>
<title>XML Developer's Guide</title>
<genre>Computer</genre>
<price>44.95</price>
<publish_date>2000-10-01</publish_date>
<description>An in-depth look at creating applications
with XML.</description>
</book>
<book id="bk102">
<author>Ralls, Kim</author>
<title>Midnight Rain</title>
<genre>Fantasy</genre>
<price>5.95</price>
<publish_date>2000-12-16</publish_date>
<description>A former architect battles corporate zombies,
an evil sorceress, and her own childhood to become queen
of the world.</description>
</book>
</catalog>
----
=== Going the extra mile
include::../extra-mile.adoc[]
ifdef::env-github,rspecator-view[]
'''
== Implementation Specification
(visible only on this page)
include::../message.adoc[]
'''
== Comments And Links
(visible only on this page)
include::../comments-and-links.adoc[]
endif::env-github,rspecator-view[]