rspec/rules/S3843/xml/rule.adoc

25 lines
858 B
Plaintext
Raw Normal View History

2021-04-28 16:49:39 +02:00
Certain prefixes are widely recognized and expected to correspond to specific namespaces. For instance, most users will expect "xs" to correspond to "http://www.w3.org/2001/XMLSchema". If you subvert that expected correspondence, you run the risk of severely confusing the users of your XSD.
2021-04-28 16:49:39 +02:00
== Noncompliant Code Example
----
<xs:schema targetNamespace="http://www.codeSamples.com/fruit"
elementFormDefault="qualified" version="1"
xmlns:xs="http://www.w3.org/2001/XMLSchema"
xmlns:wsdl="http://CodeSamples.com/animal> <!-- Noncompliant -->
...
----
2021-04-28 16:49:39 +02:00
== Compliant Solution
----
<xs:schema targetNamespace="http://www.codeSamples.com/fruit"
elementFormDefault="qualified" version="1"
xmlns:xs="http://www.w3.org/2001/XMLSchema"
xmlns:animal="http://CodeSamples.com/animal>
...
----