Quick Search
Browse
Pages
Blog
Labels
Attachments
Mail
Advanced
What’s New
Space Directory
Feed Builder
Keyboard Shortcuts
Confluence Gadgets
Log In
Sign Up
Dashboard
Sonar
Copy Page
You are not logged in. Any changes you make will be marked as
anonymous
. You may want to
Log In
if you already have an account. You can also
Sign Up
for a new account.
This page is being edited by
.
Paragraph
Paragraph
Heading 1
Heading 2
Heading 3
Heading 4
Heading 5
Heading 6
Preformatted
Quote
Bold
Italic
Underline
More colours
Strikethrough
Subscript
Superscript
Monospace
Clear Formatting
Bullet list
Numbered list
Outdent
Indent
Align left
Align center
Align right
Link
Table
Insert
Insert Content
Image
Link
Attachment
Symbol
Emoticon
Wiki Markup
Horizontal rule
tinymce.confluence.insert_menu.macro_desc
Info
JIRA Issue
Status
Gallery
Tasklist
Table of Contents
Other Macros
Page Layout
No Layout
Two column (simple)
Two column (simple, left sidebar)
Two column (simple, right sidebar)
Three column (simple)
Two column
Two column (left sidebar)
Two column (right sidebar)
Three column
Three column (left and right sidebars)
Undo
Redo
Find/Replace
Keyboard Shortcuts Help
<table class="wysiwyg-macro" data-macro-name="unmigrated-inline-wiki-markup" data-macro-parameters="atlassian-macro-output-type=BLOCK" style="background-image: url(/plugins/servlet/confluence/placeholder/macro-heading?definition=e3VubWlncmF0ZWQtaW5saW5lLXdpa2ktbWFya3VwOmF0bGFzc2lhbi1tYWNyby1vdXRwdXQtdHlwZT1CTE9DS30&locale=en_GB&version=2); background-repeat: no-repeat;" data-macro-body-type="PLAIN_TEXT"><tr><td class="wysiwyg-macro-body"><pre>{iframe:src=http://update.sonarsource.org/plugins/xml.html|width=700|height=250|frameborder=0} Your browser does not support iframes. {iframe}</pre></td></tr></table><h1>Description / Features</h1><p>This plugin enables analysis of XML files within Sonar.</p><p><span style="font-size: 10.0pt;line-height: 13.0pt;">Some common use cases are:</span></p><ul><li>Validation of XHTML files against<span style="font-size: 10.0pt;line-height: 13.0pt;"> schemas provided by the W3C (strict, transitional, and others)</span></li><li>Validation of XML files against a<span style="font-size: 10.0pt;line-height: 13.0pt;"> provided XML schema</span></li><li><span style="font-size: 10.0pt;line-height: 13.0pt;">Validation of rules in XML files (</span><span style="font-size: 10.0pt;line-height: 13.0pt;">ex: validate the Maven pom files against coding standards)</span></li></ul><div>It is compatible with the <a href="http://docs.codehaus.org/display/SONAR/Issues+Report+Plugin" rel="nofollow">Issues Report plugin</a> to run pre-commit local analysis.</div><h1>Installation</h1><ol><li>Install the XML plugin through the <a href="http://docs.codehaus.org/display/SONAR/Update+Center">Update Center</a> or download it into the SONAR_HOME/extensions/plugins directory</li><li>Restart the Sonar server</li></ol><h1>Usage</h1><h3>Run a Sonar Analysis with the Sonar Runner (Recommended Way)</h3><p>To launch a Sonar analysis of your XML project, use the <a class="confluence-link" href="/display/SONAR/Analyzing+with+Sonar+Runner" data-linked-resource-id="192872482" data-linked-resource-type="page" data-linked-resource-default-alias="Analyzing with Sonar Runner" data-base-url="http://docs.codehaus.org">Sonar Runner</a>.</p><p>A sample project is available on github that can be <a class="external-link" href="https://github.com/SonarSource/sonar-examples" rel="nofollow">browsed</a> or <a class="external-link" href="https://github.com/SonarSource/sonar-examples/zipball/master" rel="nofollow">downloaded</a>: /projects/languages/xml/xml-sonar-runner.</p><h3>Run a Sonar Analysis with the other Analyzers</h3><p><a class="confluence-link" href="/display/SONAR/Analyzing+with+Maven" data-linked-resource-id="193888393" data-linked-resource-type="page" data-linked-resource-default-alias="Analyzing with Maven" data-base-url="http://docs.codehaus.org">Maven</a> and <a class="confluence-link" href="/display/SONAR/Analyzing+with+Sonar+Ant+Task" data-linked-resource-id="210174228" data-linked-resource-type="page" data-linked-resource-default-alias="Analyzing with Sonar Ant Task" data-base-url="http://docs.codehaus.org">Ant</a> can also be used to launch analysis on XML projects.</p><div><h3>Validating Files Against Specific Schemas</h3></div><p>Files can be validated against specific schemas thanks to the <strong style="font-size: 10.0pt;line-height: 13.0pt;">XML Schema Validation </strong>rule.</p><p><span style="font-size: 10.0pt;line-height: 13.0pt;">Within the same project some files can be validated against schema 'S1', others against schema 'S2', others against schemas 'S3' and 'S4', and so on. So, this rule has to be copied and configured as many times as you have pairs of files/schemas.</span></p><p><span style="font-size: 10.0pt;line-height: 13.0pt;">Notes:</span></p><ul><li><span style="color: rgb(0,0,0);"><span style="font-size: 10.0pt;line-height: 13.0pt;color: rgb(51,51,51);">Schema validation is performed by the </span><a href="http://xerces.apache.org/xerces-j/" style="font-size: 10.0pt;line-height: 13.0pt;">Xerces</a><span style="font-size: 10.0pt;line-height: 13.0pt;color: rgb(51,51,51);"> parser using XML schemas (XSDs).</span></span></li><li><span style="font-size: 10.0pt;line-height: 13.0pt;">For validation of XHTML files it is recommended to use <strong>autodetect</strong>, <strong>xhtml1-transitional</strong> or <strong>xhtml1-strict</strong>.</span></li></ul><h3>Custom Checks Using XPath Expressions</h3><p>The <strong>XPath rule</strong> allows to define custom rules on XML documents using <a href="http://en.wikipedia.org/wiki/XPath">XPath</a> expressions.</p><p>Within the same project some files can be checked against XPath rules 'R1', 'R2', etc., others against rules 'R6', 'R7', etc. and so on. So, this rule has to be copied and configured as many times as you have pairs of files/rule.</p><h1>Metrics</h1><p>See <a href="http://docs.codehaus.org/display/SONAR/Metrics">Metrics documentation page</a>.</p><h1>Change Log</h1><p><img class="editor-inline-macro" src="/plugins/servlet/confluence/placeholder/macro?definition=e2ppcmFpc3N1ZXM6YW5vbnltb3VzPXRydWV8dGl0bGU9UmVsZWFzZSAxLjAgKG5vdCB5ZXQgcmVsZWFzZWQpfHJlbmRlck1vZGU9c3RhdGljfHdpZHRoPTkwMHxjb2x1bW5zPXR5cGU7a2V5O3N1bW1hcnk7cHJpb3JpdHl8dXJsPWh0dHA6Ly9qaXJhLmNvZGVoYXVzLm9yZy9zci9qaXJhLmlzc3Vldmlld3M6c2VhcmNocmVxdWVzdC14bWwvdGVtcC9TZWFyY2hSZXF1ZXN0LnhtbD9maXhmb3I9MTg0NTImcGlkPTExOTExJnNvcnRlci9maWVsZD1wcmlvcml0eSZzb3J0ZXIvb3JkZXI9REVTQyZ0ZW1wTWF4PTEwMDB9&locale=en_GB&version=2" data-macro-name="jiraissues" data-macro-parameters="anonymous=true|columns=type;key;summary;priority|renderMode=static|title=Release 1.0 (not yet released)|url=http://jira.codehaus.org/sr/jira.issueviews:searchrequest-xml/temp/SearchRequest.xml?fixfor\=18452&pid\=11911&sorter/field\=priority&sorter/order\=DESC&tempMax\=1000|width=900"></p><p> </p><p><img class="editor-inline-macro" src="/plugins/servlet/confluence/placeholder/macro?definition=e2ppcmFpc3N1ZXM6YW5vbnltb3VzPXRydWV8dGl0bGU9UmVsZWFzZSAwLjJ8cmVuZGVyTW9kZT1zdGF0aWN8d2lkdGg9OTAwfGNvbHVtbnM9dHlwZTtrZXk7c3VtbWFyeTtwcmlvcml0eXx1cmw9aHR0cDovL2ppcmEuY29kZWhhdXMub3JnL3NyL2ppcmEuaXNzdWV2aWV3czpzZWFyY2hyZXF1ZXN0LXhtbC90ZW1wL1NlYXJjaFJlcXVlc3QueG1sP2ZpeGZvcj0xNzM1MyZwaWQ9MTE5MTEmc29ydGVyL2ZpZWxkPXByaW9yaXR5JnNvcnRlci9vcmRlcj1ERVNDJnRlbXBNYXg9MTAwMH0&locale=en_GB&version=2" data-macro-name="jiraissues" data-macro-parameters="anonymous=true|columns=type;key;summary;priority|renderMode=static|title=Release 0.2|url=http://jira.codehaus.org/sr/jira.issueviews:searchrequest-xml/temp/SearchRequest.xml?fixfor\=17353&pid\=11911&sorter/field\=priority&sorter/order\=DESC&tempMax\=1000|width=900"></p><p> </p><p><img class="editor-inline-macro" src="/plugins/servlet/confluence/placeholder/macro?definition=e2ppcmFpc3N1ZXM6YW5vbnltb3VzPXRydWV8dGl0bGU9UmVsZWFzZSAwLjF8cmVuZGVyTW9kZT1zdGF0aWN8d2lkdGg9OTAwfGNvbHVtbnM9dHlwZTtrZXk7c3VtbWFyeTtwcmlvcml0eXx1cmw9aHR0cDovL2ppcmEuY29kZWhhdXMub3JnL3NyL2ppcmEuaXNzdWV2aWV3czpzZWFyY2hyZXF1ZXN0LXhtbC90ZW1wL1NlYXJjaFJlcXVlc3QueG1sP2ZpeGZvcj0xNzM0NSZwaWQ9MTE5MTEmc29ydGVyL2ZpZWxkPXByaW9yaXR5JnNvcnRlci9vcmRlcj1ERVNDJnRlbXBNYXg9MTAwMH0&locale=en_GB&version=2" data-macro-name="jiraissues" data-macro-parameters="anonymous=true|columns=type;key;summary;priority|renderMode=static|title=Release 0.1|url=http://jira.codehaus.org/sr/jira.issueviews:searchrequest-xml/temp/SearchRequest.xml?fixfor\=17345&pid\=11911&sorter/field\=priority&sorter/order\=DESC&tempMax\=1000|width=900"></p>
Please type the word appearing in the picture.
Attachments
Labels
Location
Watch this page
< Edit
Preview >
Loading…
Save
Cancel
Next hint
search
attachments
weblink
advanced