Allow validation of arbitrary xml files

git-svn-id: https://svn.apache.org/repos/asf/maven/maven-1/plugins/trunk@293181 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
ltheussl committed 2005-10-02 23:24:30 +00:00
1 parent c555368905
commit 0f800ed999
4 files changed
+24 -7

No files matched your search

+14 -3
View File
@@ -817,9 +817,20 @@
</j:otherwise>
</j:choose>
<j:forEach var="file" items="${xmlFiles.iterator()}">
<plugin:validate-xml
schema="${plugin.resources}/dtd/maven-xdoc-${currentRelease}.dtd"
file="${file}"/>
<util:replace var="dtdFile" old=".xml" new=".dtd" value="${file}"/>
<util:replace var="xsdFile" old=".xml" new=".xsd" value="${file}"/>
<j:set var="schema" value="${plugin.resources}/dtd/maven-xdoc-${currentRelease}.dtd"/>
<util:available file="${dtdFile}">
<j:set var="schema" value="${dtdFile}"/>
<echo>Using ${dtdFile} for validation</echo>
</util:available>
<util:available file="${xsdFile}">
<j:set var="schema" value="${xsdFile}"/>
<echo>Using ${xsdFile} for validation</echo>
</util:available>
<plugin:validate-xml
schema="${schema}"
file="${file}"/>
</j:forEach>
</j:if>
+1 -1
View File
@@ -19,4 +19,4 @@
# -------------------------------------------------------------------
maven.junit.fork=yes
maven.compile.encoding=UTF-8
maven.xdoc.validate.exclude=changes.xml,reference/escapeXml.xml
maven.xdoc.validate.exclude=changes.xml
+3
View File
@@ -0,0 +1,3 @@
<!ELEMENT example (text)>
<!ATTLIST example name CDATA #IMPLIED>
<!ELEMENT text (#PCDATA)>
+6 -3
View File
@@ -109,9 +109,12 @@
</p>
<source><escapeXml>&escapeXmlExample;</escapeXml></source>
<p>
<strong>Note</strong> that currently it is not possible to validate
arbitrary xml files with the <code>xdoc:validate</code> goal.
You can use the <code>maven.xdoc.validate.exclude</code>
<strong>Note</strong> that it is possible to validate the included
xml file with the <code>xdoc:validate</code> goal even if it is not
a valid xdoc document (like in the example above). You just have to
provide a custom <code>.dtd</code> or <code>.xsd</code> schema file
with the same base name in the same directory. Otherwise,
you should use the <code>maven.xdoc.validate.exclude</code>
property to exclude specific files from validation.
</p>
</subsection>