[DOXIA-669] Improve/rework CachedFileEntityResolver
This closes #115
diff --git a/doxia-core/src/main/java/org/apache/maven/doxia/parser/AbstractXmlParser.java b/doxia-core/src/main/java/org/apache/maven/doxia/parser/AbstractXmlParser.java
index 61363bb..1cf38ad 100644
--- a/doxia-core/src/main/java/org/apache/maven/doxia/parser/AbstractXmlParser.java
+++ b/doxia-core/src/main/java/org/apache/maven/doxia/parser/AbstractXmlParser.java
@@ -21,17 +21,16 @@
import java.io.BufferedReader;
import java.io.ByteArrayInputStream;
-import java.io.File;
-import java.io.FileOutputStream;
import java.io.IOException;
import java.io.InputStream;
-import java.io.OutputStream;
import java.io.Reader;
import java.io.StringReader;
+import java.net.URI;
import java.net.URL;
+import java.nio.file.Paths;
+import java.util.HashMap;
import java.util.Hashtable;
import java.util.LinkedHashMap;
-import java.util.Locale;
import java.util.Map;
import java.util.regex.Matcher;
import java.util.regex.Pattern;
@@ -43,13 +42,13 @@
import org.apache.maven.doxia.util.HtmlTools;
import org.apache.maven.doxia.util.XmlValidator;
-import org.codehaus.plexus.util.FileUtils;
import org.codehaus.plexus.util.IOUtil;
import org.codehaus.plexus.util.StringUtils;
import org.codehaus.plexus.util.xml.pull.MXParser;
import org.codehaus.plexus.util.xml.pull.XmlPullParser;
import org.codehaus.plexus.util.xml.pull.XmlPullParserException;
-
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
import org.xml.sax.EntityResolver;
import org.xml.sax.InputSource;
import org.xml.sax.SAXException;
@@ -694,9 +693,25 @@
public static class CachedFileEntityResolver
implements EntityResolver
{
+ private static final Logger LOGGER = LoggerFactory.getLogger( CachedFileEntityResolver.class );
+
/** Map with systemId as key and the content of systemId as byte[]. */
protected static final Map<String, byte[]> ENTITY_CACHE = new Hashtable<>();
+ private static final Map<String, String> WELL_KNOWN_SYSTEM_IDS = new HashMap<>();
+
+ static
+ {
+ WELL_KNOWN_SYSTEM_IDS.put( "http://www.w3.org/2001/xml.xsd", "xml.xsd" );
+ WELL_KNOWN_SYSTEM_IDS.put( "https://www.w3.org/2001/xml.xsd", "xml.xsd" );
+ WELL_KNOWN_SYSTEM_IDS.put( "http://maven.apache.org/xsd/xdoc-2.0.xsd", "xdoc-2.0.xsd" );
+ WELL_KNOWN_SYSTEM_IDS.put( "https://maven.apache.org/xsd/xdoc-2.0.xsd", "xdoc-2.0.xsd" );
+ WELL_KNOWN_SYSTEM_IDS.put( "http://maven.apache.org/xsd/fml-1.0.1.xsd", "fml-1.0.1.xsd" );
+ WELL_KNOWN_SYSTEM_IDS.put( "https://maven.apache.org/xsd/fml-1.0.1.xsd", "fml-1.0.1.xsd" );
+ WELL_KNOWN_SYSTEM_IDS.put( "http://www.w3.org/TR/xhtml1/DTD/xhtml-lat1.ent", "xhtml-lat1.ent" );
+ WELL_KNOWN_SYSTEM_IDS.put( "https://www.w3.org/TR/xhtml1/DTD/xhtml-lat1.ent", "xhtml-lat1.ent" );
+ }
+
/** {@inheritDoc} */
public InputSource resolveEntity( String publicId, String systemId )
throws SAXException, IOException
@@ -705,44 +720,36 @@
// already cached?
if ( res == null )
{
- String systemName = FileUtils.getFile( systemId ).getName();
- File temp = new File( System.getProperty( "java.io.tmpdir" ), systemName );
- // maybe already as a temp file?
- if ( !temp.exists() )
+ if ( WELL_KNOWN_SYSTEM_IDS.containsKey( systemId ) )
{
- // is systemId a file or an url?
- if ( systemId.toLowerCase( Locale.ENGLISH ).startsWith( "file" ) )
+ String resource = "/" + WELL_KNOWN_SYSTEM_IDS.get( systemId );
+ URL url = getClass().getResource( resource );
+ if ( url != null )
{
- // Doxia XSDs are included in the jars, so try to find the resource systemName from
- // the classpath...
- String resource = "/" + systemName;
- URL url = getClass().getResource( resource );
- if ( url != null )
- {
- res = toByteArray( url );
- }
- else
- {
- throw new SAXException( "Could not find the SYSTEM entity: " + systemId
- + " because '" + resource + "' is not available of the classpath." );
- }
+ LOGGER.debug( "Resolving SYSTEM '{}' from well-known classpath resource '{}'",
+ systemId, resource );
+ res = toByteArray( url );
}
- else
+ }
+
+ if ( res == null )
+ {
+ URI uri = URI.create( systemId );
+ if ( uri.getScheme() == null )
{
- res = toByteArray( new URL( systemId ) );
+ uri = Paths.get( systemId ).toUri();
}
- // write systemId as temp file
- copy( res, temp );
- }
- else
- {
- // TODO How to refresh Doxia XSDs from temp dir?
- res = toByteArray( temp.toURI().toURL() );
+ LOGGER.debug( "Resolving SYSTEM '{}' from URI resource '{}'", systemId, uri );
+ res = toByteArray( uri.toURL() );
}
ENTITY_CACHE.put( systemId, res );
}
+ else
+ {
+ LOGGER.debug( "Resolved SYSTEM '{}' from cache", systemId );
+ }
InputSource is = new InputSource( new ByteArrayInputStream( res ) );
is.setPublicId( publicId );
@@ -778,37 +785,5 @@
IOUtil.close( is );
}
}
-
- /**
- * Wrap {@link IOUtil#copy(byte[], OutputStream)} to throw SAXException.
- *
- * @param res not null array of byte
- * @param f the file where to write the bytes
- * @throws SAXException if any
- * @see IOUtil#copy(byte[], OutputStream)
- */
- private void copy( byte[] res, File f )
- throws SAXException
- {
- if ( f.isDirectory() )
- {
- throw new SAXException( "'" + f.getAbsolutePath() + "' is a directory, can not write it." );
- }
-
- OutputStream os = null;
- try
- {
- os = new FileOutputStream( f );
- IOUtil.copy( res, os );
- }
- catch ( IOException e )
- {
- throw new SAXException( e );
- }
- finally
- {
- IOUtil.close( os );
- }
- }
}
}
diff --git a/doxia-core/src/main/java/org/apache/maven/doxia/util/XmlValidator.java b/doxia-core/src/main/java/org/apache/maven/doxia/util/XmlValidator.java
index 10cd906..32d6121 100644
--- a/doxia-core/src/main/java/org/apache/maven/doxia/util/XmlValidator.java
+++ b/doxia-core/src/main/java/org/apache/maven/doxia/util/XmlValidator.java
@@ -115,6 +115,7 @@
xmlReader = XMLReaderFactory.createXMLReader();
xmlReader.setFeature( "http://xml.org/sax/features/validation", true );
+ xmlReader.setFeature( "http://apache.org/xml/features/validation/dynamic", true );
xmlReader.setFeature( "http://apache.org/xml/features/validation/schema", true );
xmlReader.setErrorHandler( errorHandler );
xmlReader.setEntityResolver( new CachedFileEntityResolver() );
diff --git a/doxia-core/src/main/resources/xml.xsd b/doxia-core/src/main/resources/xml.xsd
new file mode 100644
index 0000000..543bda6
--- /dev/null
+++ b/doxia-core/src/main/resources/xml.xsd
@@ -0,0 +1,286 @@
+<?xml version='1.0'?>
+<?xml-stylesheet href="../../2008/09/xsd.xsl" type="text/xsl"?>
+<xs:schema targetNamespace="http://www.w3.org/XML/1998/namespace"
+ xmlns:xs="http://www.w3.org/2001/XMLSchema"
+ xmlns ="http://www.w3.org/1999/xhtml"
+ xml:lang="en">
+
+ <xs:annotation>
+ <xs:documentation>
+ <div>
+ <h1>About the XML namespace</h1>
+
+ <div class="bodytext">
+ <p>
+ This schema document describes the XML namespace, in a form
+ suitable for import by other schema documents.
+ </p>
+ <p>
+ See <a href="http://www.w3.org/XML/1998/namespace.html">
+ http://www.w3.org/XML/1998/namespace.html</a> and
+ <a href="http://www.w3.org/TR/REC-xml">
+ http://www.w3.org/TR/REC-xml</a> for information
+ about this namespace.
+ </p>
+ <p>
+ Note that local names in this namespace are intended to be
+ defined only by the World Wide Web Consortium or its subgroups.
+ The names currently defined in this namespace are listed below.
+ They should not be used with conflicting semantics by any Working
+ Group, specification, or document instance.
+ </p>
+ <p>
+ See further below in this document for more information about <a
+ href="#usage">how to refer to this schema document from your own
+ XSD schema documents</a> and about <a href="#nsversioning">the
+ namespace-versioning policy governing this schema document</a>.
+ </p>
+ </div>
+ </div>
+ </xs:documentation>
+ </xs:annotation>
+
+ <xs:attribute name="lang">
+ <xs:annotation>
+ <xs:documentation>
+ <div>
+
+ <h3>lang (as an attribute name)</h3>
+ <p>
+ denotes an attribute whose value
+ is a language code for the natural language of the content of
+ any element; its value is inherited. This name is reserved
+ by virtue of its definition in the XML specification.</p>
+
+ </div>
+ <div>
+ <h4>Notes</h4>
+ <p>
+ Attempting to install the relevant ISO 2- and 3-letter
+ codes as the enumerated possible values is probably never
+ going to be a realistic possibility.
+ </p>
+ <p>
+ See BCP 47 at <a href="http://www.rfc-editor.org/rfc/bcp/bcp47.txt">
+ http://www.rfc-editor.org/rfc/bcp/bcp47.txt</a>
+ and the IANA language subtag registry at
+ <a href="http://www.iana.org/assignments/language-subtag-registry">
+ http://www.iana.org/assignments/language-subtag-registry</a>
+ for further information.
+ </p>
+ <p>
+ The union allows for the 'un-declaration' of xml:lang with
+ the empty string.
+ </p>
+ </div>
+ </xs:documentation>
+ </xs:annotation>
+ <xs:simpleType>
+ <xs:union memberTypes="xs:language">
+ <xs:simpleType>
+ <xs:restriction base="xs:string">
+ <xs:enumeration value=""/>
+ </xs:restriction>
+ </xs:simpleType>
+ </xs:union>
+ </xs:simpleType>
+ </xs:attribute>
+
+ <xs:attribute name="space">
+ <xs:annotation>
+ <xs:documentation>
+ <div>
+
+ <h3>space (as an attribute name)</h3>
+ <p>
+ denotes an attribute whose
+ value is a keyword indicating what whitespace processing
+ discipline is intended for the content of the element; its
+ value is inherited. This name is reserved by virtue of its
+ definition in the XML specification.</p>
+
+ </div>
+ </xs:documentation>
+ </xs:annotation>
+ <xs:simpleType>
+ <xs:restriction base="xs:NCName">
+ <xs:enumeration value="default"/>
+ <xs:enumeration value="preserve"/>
+ </xs:restriction>
+ </xs:simpleType>
+ </xs:attribute>
+
+ <xs:attribute name="base" type="xs:anyURI"> <xs:annotation>
+ <xs:documentation>
+ <div>
+
+ <h3>base (as an attribute name)</h3>
+ <p>
+ denotes an attribute whose value
+ provides a URI to be used as the base for interpreting any
+ relative URIs in the scope of the element on which it
+ appears; its value is inherited. This name is reserved
+ by virtue of its definition in the XML Base specification.</p>
+
+ <p>
+ See <a
+ href="http://www.w3.org/TR/xmlbase/">http://www.w3.org/TR/xmlbase/</a>
+ for information about this attribute.
+ </p>
+ </div>
+ </xs:documentation>
+ </xs:annotation>
+ </xs:attribute>
+
+ <xs:attribute name="id" type="xs:ID">
+ <xs:annotation>
+ <xs:documentation>
+ <div>
+
+ <h3>id (as an attribute name)</h3>
+ <p>
+ denotes an attribute whose value
+ should be interpreted as if declared to be of type ID.
+ This name is reserved by virtue of its definition in the
+ xml:id specification.</p>
+
+ <p>
+ See <a
+ href="http://www.w3.org/TR/xml-id/">http://www.w3.org/TR/xml-id/</a>
+ for information about this attribute.
+ </p>
+ </div>
+ </xs:documentation>
+ </xs:annotation>
+ </xs:attribute>
+
+ <xs:attributeGroup name="specialAttrs">
+ <xs:attribute ref="xml:base"/>
+ <xs:attribute ref="xml:lang"/>
+ <xs:attribute ref="xml:space"/>
+ <xs:attribute ref="xml:id"/>
+ </xs:attributeGroup>
+
+ <xs:annotation>
+ <xs:documentation>
+ <div>
+
+ <h3>Father (in any context at all)</h3>
+
+ <div class="bodytext">
+ <p>
+ denotes Jon Bosak, the chair of
+ the original XML Working Group. This name is reserved by
+ the following decision of the W3C XML Plenary and
+ XML Coordination groups:
+ </p>
+ <blockquote>
+ <p>
+ In appreciation for his vision, leadership and
+ dedication the W3C XML Plenary on this 10th day of
+ February, 2000, reserves for Jon Bosak in perpetuity
+ the XML name "xml:Father".
+ </p>
+ </blockquote>
+ </div>
+ </div>
+ </xs:documentation>
+ </xs:annotation>
+
+ <xs:annotation>
+ <xs:documentation>
+ <div xml:id="usage" id="usage">
+ <h2><a name="usage">About this schema document</a></h2>
+
+ <div class="bodytext">
+ <p>
+ This schema defines attributes and an attribute group suitable
+ for use by schemas wishing to allow <code>xml:base</code>,
+ <code>xml:lang</code>, <code>xml:space</code> or
+ <code>xml:id</code> attributes on elements they define.
+ </p>
+ <p>
+ To enable this, such a schema must import this schema for
+ the XML namespace, e.g. as follows:
+ </p>
+ <pre>
+ <schema . . .>
+ . . .
+ <import namespace="http://www.w3.org/XML/1998/namespace"
+ schemaLocation="http://www.w3.org/2001/xml.xsd"/>
+ </pre>
+ <p>
+ or
+ </p>
+ <pre>
+ <import namespace="http://www.w3.org/XML/1998/namespace"
+ schemaLocation="http://www.w3.org/2009/01/xml.xsd"/>
+ </pre>
+ <p>
+ Subsequently, qualified reference to any of the attributes or the
+ group defined below will have the desired effect, e.g.
+ </p>
+ <pre>
+ <type . . .>
+ . . .
+ <attributeGroup ref="xml:specialAttrs"/>
+ </pre>
+ <p>
+ will define a type which will schema-validate an instance element
+ with any of those attributes.
+ </p>
+ </div>
+ </div>
+ </xs:documentation>
+ </xs:annotation>
+
+ <xs:annotation>
+ <xs:documentation>
+ <div id="nsversioning" xml:id="nsversioning">
+ <h2><a name="nsversioning">Versioning policy for this schema document</a></h2>
+ <div class="bodytext">
+ <p>
+ In keeping with the XML Schema WG's standard versioning
+ policy, this schema document will persist at
+ <a href="http://www.w3.org/2009/01/xml.xsd">
+ http://www.w3.org/2009/01/xml.xsd</a>.
+ </p>
+ <p>
+ At the date of issue it can also be found at
+ <a href="http://www.w3.org/2001/xml.xsd">
+ http://www.w3.org/2001/xml.xsd</a>.
+ </p>
+ <p>
+ The schema document at that URI may however change in the future,
+ in order to remain compatible with the latest version of XML
+ Schema itself, or with the XML namespace itself. In other words,
+ if the XML Schema or XML namespaces change, the version of this
+ document at <a href="http://www.w3.org/2001/xml.xsd">
+ http://www.w3.org/2001/xml.xsd
+ </a>
+ will change accordingly; the version at
+ <a href="http://www.w3.org/2009/01/xml.xsd">
+ http://www.w3.org/2009/01/xml.xsd
+ </a>
+ will not change.
+ </p>
+ <p>
+ Previous dated (and unchanging) versions of this schema
+ document are at:
+ </p>
+ <ul>
+ <li><a href="http://www.w3.org/2009/01/xml.xsd">
+ http://www.w3.org/2009/01/xml.xsd</a></li>
+ <li><a href="http://www.w3.org/2007/08/xml.xsd">
+ http://www.w3.org/2007/08/xml.xsd</a></li>
+ <li><a href="http://www.w3.org/2004/10/xml.xsd">
+ http://www.w3.org/2004/10/xml.xsd</a></li>
+ <li><a href="http://www.w3.org/2001/03/xml.xsd">
+ http://www.w3.org/2001/03/xml.xsd</a></li>
+ </ul>
+ </div>
+ </div>
+ </xs:documentation>
+ </xs:annotation>
+
+</xs:schema>
diff --git a/doxia-core/src/test/java/org/apache/maven/doxia/util/XmlValidatorTest.java b/doxia-core/src/test/java/org/apache/maven/doxia/util/XmlValidatorTest.java
index a08e653..b435123 100644
--- a/doxia-core/src/test/java/org/apache/maven/doxia/util/XmlValidatorTest.java
+++ b/doxia-core/src/test/java/org/apache/maven/doxia/util/XmlValidatorTest.java
@@ -36,9 +36,9 @@
public void testValidate()
throws Exception
{
- String xml = IOUtil.toString( new XmlStreamReader( this.getClass().getResourceAsStream( "/test.xhtml" ) ) );
+ String xml = IOUtil.toString( new XmlStreamReader( this.getClass().getResourceAsStream( "/test.xml" ) ) );
- XmlValidator validator = new XmlValidator( );
+ XmlValidator validator = new XmlValidator();
validator.validate( xml );
}
diff --git a/doxia-core/src/test/resources/test.xhtml b/doxia-core/src/test/resources/test.xhtml
index fc9f444..65911a4 100644
--- a/doxia-core/src/test/resources/test.xhtml
+++ b/doxia-core/src/test/resources/test.xhtml
@@ -1,50 +1,46 @@
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
- "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
-
-<!--
-Licensed to the Apache Software Foundation (ASF) under one
-or more contributor license agreements. See the NOTICE file
-distributed with this work for additional information
-regarding copyright ownership. The ASF licenses this file
-to you under the Apache License, Version 2.0 (the
-"License"); you may not use this file except in compliance
-with the License. You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
-Unless required by applicable law or agreed to in writing,
-software distributed under the License is distributed on an
-"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-KIND, either express or implied. See the License for the
-specific language governing permissions and limitations
-under the License.
--->
-
-<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
- <head>
- <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
- <title>XHTML 1.0 Strict Example</title>
- <script type="text/javascript">
- //<![CDATA[
- function loadpdf() {
- document.getElementById("pdf-object").src="http://www.w3.org/TR/xhtml1/xhtml1.pdf";
- }
- //]]>
- </script>
- </head>
- <body onload="loadpdf()">
- <p>This is an example of an
- <abbr title="Extensible HyperText Markup Language">XHTML</abbr> 1.0 Strict document.<br />
- <img id="validation-icon"
- src="http://www.w3.org/Icons/valid-xhtml10"
- alt="Valid XHTML 1.0 Strict" /><br />
- <object id="pdf-object"
- name="pdf-object"
- type="application/pdf"
- data="http://www.w3.org/TR/xhtml1/xhtml1.pdf"
- width="100%"
- height="500">
- </object>
- </p>
- </body>
-</html>
+<!DOCTYPE html>
+<!--
+Licensed to the Apache Software Foundation (ASF) under one
+or more contributor license agreements. See the NOTICE file
+distributed with this work for additional information
+regarding copyright ownership. The ASF licenses this file
+to you under the Apache License, Version 2.0 (the
+"License"); you may not use this file except in compliance
+with the License. You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing,
+software distributed under the License is distributed on an
+"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+KIND, either express or implied. See the License for the
+specific language governing permissions and limitations
+under the License.
+-->
+
+<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
+ <head>
+ <meta charset="utf-8" />
+ <title>XHTML 5 Example</title>
+ <script>
+ function loadpdf() {
+ document.getElementById("pdf-object").src="http://www.w3.org/TR/xhtml1/xhtml1.pdf";
+ }
+ </script>
+ </head>
+ <body onload="loadpdf()">
+ <p>This is an example of an
+ <abbr title="Extensible HyperText Markup Language">XHTML</abbr> 1.0 Strict document.<br />
+ <img id="validation-icon"
+ src="http://www.w3.org/Icons/valid-xhtml10"
+ alt="Valid XHTML 1.0 Strict" /><br />
+ <object id="pdf-object"
+ name="pdf-object"
+ type="application/pdf"
+ data="http://www.w3.org/TR/xhtml1/xhtml1.pdf"
+ width="100"
+ height="500">
+ </object>
+ </p>
+ </body>
+</html>
diff --git a/doxia-core/src/test/resources/test.xml b/doxia-core/src/test/resources/test.xml
new file mode 100644
index 0000000..8acb905
--- /dev/null
+++ b/doxia-core/src/test/resources/test.xml
@@ -0,0 +1,137 @@
+<?xml version="1.0" ?>
+<!--
+ Licensed to the Apache Software Foundation (ASF) under one
+ or more contributor license agreements. See the NOTICE file
+ distributed with this work for additional information
+ regarding copyright ownership. The ASF licenses this file
+ to you under the Apache License, Version 2.0 (the
+ "License"); you may not use this file except in compliance
+ with the License. You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing,
+ software distributed under the License is distributed on an
+ "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ KIND, either express or implied. See the License for the
+ specific language governing permissions and limitations
+ under the License.
+-->
+<document xmlns="http://maven.apache.org/XDOC/2.0"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://maven.apache.org/XDOC/2.0 https://maven.apache.org/xsd/xdoc-2.0.xsd">
+
+ <properties>
+ <title>Title</title>
+ <author>Author</author>
+ <date>Date</date>
+ </properties>
+
+ <body>
+
+ <section name="Some Paragraph">
+ <p>Paragraph 1, line 1. Paragraph 1, line 2.</p>
+ <p>Paragraph 2, line 1. Paragraph 2, line 2.</p>
+ </section>
+
+ <section name="Section title">
+ <subsection name="Sub-section title">
+ <h3>Sub-sub-section title</h3>
+ <h4>Sub-sub-sub-section</h4>
+ <h5>Sub-sub-sub-sub-section</h5>
+
+ <ul>
+ <li>List item 1.</li>
+ <li>List item 2. <p>Paragraph contained in list item 2.</p>
+ <ul>
+ <li>Sub-list item 1.</li>
+ <li>Sub-list item 2.</li>
+ </ul>
+ </li>
+ <li>List item 3. Force end of list:</li>
+ </ul>
+
+ <source>Verbatim text not contained in list item 3</source>
+
+ <ol style="list-style-type: decimal">
+ <li>Numbered item 1. <ol style="list-style-type: upper-alpha">
+ <li>Numbered item A.</li>
+ <li>Numbered item B.</li>
+ </ol>
+ </li>
+ <li>Numbered item 2.</li>
+ </ol>
+
+ <p>List numbering schemes: [[1]], [[a]], [[A]], [[i]], [[I]].</p>
+
+ <dl compact="compact">
+ <dt>
+ <b>Defined term 1</b>
+ </dt>
+ <dd>of definition list.</dd>
+ <dt>
+ <b>Defined term 2</b>
+ </dt>
+ <dd>of definition list. <source>Verbatim text in a box </source>
+ </dd>
+ </dl>
+
+ <p>--- instead of +-- suppresses the box around verbatim text.</p>
+
+ <img src="figure" alt="Figure caption"/>
+
+ <table align="center">
+ <caption>Table caption</caption>
+ <tr valign="top">
+ <th align="center">Centered<br/>cell 1,1</th>
+ <th align="left">Left-aligned<br/>cell 1,2</th>
+ <th align="right">Right-aligned<br/>cell 1,3</th>
+ </tr>
+ <tr valign="top">
+ <td align="center">cell 2,1</td>
+ <td align="left">cell 2,2</td>
+ <td align="right">cell 2,3</td>
+ </tr>
+ </table>
+
+ <p>No grid, no caption:</p>
+
+ <table align="center">
+ <tr valign="top">
+ <td align="center">cell</td>
+ <td align="center">cell</td>
+ </tr>
+ <tr valign="top">
+ <td align="center">cell</td>
+ <td align="center">cell</td>
+ </tr>
+ </table>
+
+ <p>Horizontal line:</p>
+ <hr/>
+
+ <p>New page.</p>
+
+ <p><i>Italic</i> font. <b>Bold</b> font. <tt>Monospaced</tt> font.</p>
+
+ <p>
+ <a id="anchor" name="anchor">Anchor</a>. Link to <a href="#anchor">Anchor</a>.
+ Link to <a href="http://www.pixware.fr">http://www.pixware.fr</a>. Link to <a
+ href="#anchor">showing alternate text</a>. Link to <a
+ href="http://www.pixware.fr">Pixware home page</a>. </p>
+
+ <p>Force line<br/>break.</p>
+
+ <p>Non breaking space.</p>
+
+ <p>Escaped special characters:<br/> ~<br/> =<br/> -<br/> +<br/> *<br/> [<br/> ]<br/>
+ <<br/> ><br/> {<br/> }<br/> \ </p>
+
+ <p>Copyright symbol: © © ©.</p>
+
+ </subsection>
+ </section>
+
+ </body>
+
+</document>
diff --git a/doxia-modules/doxia-module-fml/src/test/resources/macro.fml b/doxia-modules/doxia-module-fml/src/test/resources/macro.fml
index d7e997a..8d4553a 100644
--- a/doxia-modules/doxia-module-fml/src/test/resources/macro.fml
+++ b/doxia-modules/doxia-module-fml/src/test/resources/macro.fml
@@ -1,49 +1,49 @@
-<?xml version="1.0" encoding="ISO-8859-1"?>
-<!--
-Licensed to the Apache Software Foundation (ASF) under one
-or more contributor license agreements. See the NOTICE file
-distributed with this work for additional information
-regarding copyright ownership. The ASF licenses this file
-to you under the Apache License, Version 2.0 (the
-"License"); you may not use this file except in compliance
-with the License. You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
-Unless required by applicable law or agreed to in writing,
-software distributed under the License is distributed on an
-"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-KIND, either express or implied. See the License for the
-specific language governing permissions and limitations
-under the License.
--->
-
-<faqs xmlns="http://maven.apache.org/FML/1.0.1"
- xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
- xsi:schemaLocation="http://maven.apache.org/FML/1.0.1 file:../../main/resources/fml-1.0.1.xsd"
- title="Frequently Asked Questions">
-
- <part id="general">
- <title>Test the macro support</title>
-
- <faq id="test-macro">
- <question>Question</question>
- <answer>
- <p>Answer with macro</p>
- <macro name="snippet">
- <param name="id" value="superpom"/>
- <param name="file" value="src/test/resources/macro.fml"/>
- </macro>
- </answer>
+<?xml version="1.0" encoding="ISO-8859-1"?>
+<!--
+Licensed to the Apache Software Foundation (ASF) under one
+or more contributor license agreements. See the NOTICE file
+distributed with this work for additional information
+regarding copyright ownership. The ASF licenses this file
+to you under the Apache License, Version 2.0 (the
+"License"); you may not use this file except in compliance
+with the License. You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing,
+software distributed under the License is distributed on an
+"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+KIND, either express or implied. See the License for the
+specific language governing permissions and limitations
+under the License.
+-->
+
+<faqs xmlns="http://maven.apache.org/FML/1.0.1"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://maven.apache.org/FML/1.0.1 https://maven.apache.org/xsd/fml-1.0.1.xsd"
+ title="Frequently Asked Questions">
+
+ <part id="general">
+ <title>Test the macro support</title>
+
+ <faq id="test-macro">
+ <question>Question</question>
+ <answer>
+ <p>Answer with macro</p>
+ <macro name="snippet">
+ <param name="id" value="superpom"/>
+ <param name="file" value="src/test/resources/macro.fml"/>
+ </macro>
+ </answer>
</faq>
-
-<!-- START SNIPPET: fmlmacro -->
- <faq id="macro-definition">
- <question>Macro Question</question>
- <answer>
- <p>Macro Answer</p>
- </answer>
- </faq>
-<!-- END SNIPPET: fmlmacro -->
- </part>
-</faqs>
+
+<!-- START SNIPPET: fmlmacro -->
+ <faq id="macro-definition">
+ <question>Macro Question</question>
+ <answer>
+ <p>Macro Answer</p>
+ </answer>
+ </faq>
+<!-- END SNIPPET: fmlmacro -->
+ </part>
+</faqs>
diff --git a/doxia-modules/doxia-module-fml/src/test/resources/simpleFaq.fml b/doxia-modules/doxia-module-fml/src/test/resources/simpleFaq.fml
index aced132..27b7f0e 100644
--- a/doxia-modules/doxia-module-fml/src/test/resources/simpleFaq.fml
+++ b/doxia-modules/doxia-module-fml/src/test/resources/simpleFaq.fml
@@ -20,7 +20,7 @@
<faqs xmlns="http://maven.apache.org/FML/1.0.1"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
- xsi:schemaLocation="http://maven.apache.org/FML/1.0.1 file:../../main/resources/fml-1.0.1.xsd"
+ xsi:schemaLocation="http://maven.apache.org/FML/1.0.1 https://maven.apache.org/xsd/fml-1.0.1.xsd"
title="Frequently Asked Questions">
<part id="general">
diff --git a/doxia-modules/doxia-module-fml/src/test/resources/test.fml b/doxia-modules/doxia-module-fml/src/test/resources/test.fml
index 8128fe9..49e868a 100644
--- a/doxia-modules/doxia-module-fml/src/test/resources/test.fml
+++ b/doxia-modules/doxia-module-fml/src/test/resources/test.fml
@@ -21,7 +21,7 @@
<!-- TODO [later]: faqs need some sorting -->
<faqs xmlns="http://maven.apache.org/FML/1.0.1"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
- xsi:schemaLocation="http://maven.apache.org/FML/1.0.1 file:../../main/resources/fml-1.0.1.xsd"
+ xsi:schemaLocation="http://maven.apache.org/FML/1.0.1 https://maven.apache.org/xsd/fml-1.0.1.xsd"
title="Frequently Asked Questions">
<part id="general">
diff --git a/doxia-modules/doxia-module-xdoc/src/main/resources/xdoc-2.0.xsd b/doxia-modules/doxia-module-xdoc/src/main/resources/xdoc-2.0.xsd
index f24886d..5085002 100644
--- a/doxia-modules/doxia-module-xdoc/src/main/resources/xdoc-2.0.xsd
+++ b/doxia-modules/doxia-module-xdoc/src/main/resources/xdoc-2.0.xsd
@@ -39,7 +39,7 @@
</xs:documentation>
</xs:annotation>
- <xs:import namespace="http://www.w3.org/XML/1998/namespace" schemaLocation="http://www.w3.org/2001/xml.xsd"/>
+ <xs:import namespace="http://www.w3.org/XML/1998/namespace" schemaLocation="https://www.w3.org/2001/xml.xsd"/>
<xs:annotation>
<xs:documentation>
diff --git a/doxia-modules/doxia-module-xdoc/src/test/resources/macro.xml b/doxia-modules/doxia-module-xdoc/src/test/resources/macro.xml
index c99baee..16ec77d 100644
--- a/doxia-modules/doxia-module-xdoc/src/test/resources/macro.xml
+++ b/doxia-modules/doxia-module-xdoc/src/test/resources/macro.xml
@@ -20,7 +20,7 @@
<document xmlns="http://maven.apache.org/XDOC/2.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
- xsi:schemaLocation="http://maven.apache.org/XDOC/2.0 file:../../main/resources/xdoc-2.0.xsd">
+ xsi:schemaLocation="http://maven.apache.org/XDOC/2.0 https://maven.apache.org/xsd/xdoc-2.0.xsd">
<properties>
<title>Test DOXIA-77</title>
<author email="vsiveton@apache.org">Vincent Siveton</author>
diff --git a/doxia-modules/doxia-module-xdoc/src/test/resources/report.xml b/doxia-modules/doxia-module-xdoc/src/test/resources/report.xml
index 933ff94..b906821 100644
--- a/doxia-modules/doxia-module-xdoc/src/test/resources/report.xml
+++ b/doxia-modules/doxia-module-xdoc/src/test/resources/report.xml
@@ -19,7 +19,7 @@
<document xmlns="http://maven.apache.org/XDOC/2.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
- xsi:schemaLocation="http://maven.apache.org/XDOC/2.0 file:../../main/resources/xdoc-2.0.xsd">
+ xsi:schemaLocation="http://maven.apache.org/XDOC/2.0 https://maven.apache.org/xsd/xdoc-2.0.xsd">
<properties>
<title>Synchronization report for Codehaus</title>
<author>meeper</author>
diff --git a/doxia-modules/doxia-module-xdoc/src/test/resources/test.xml b/doxia-modules/doxia-module-xdoc/src/test/resources/test.xml
index d4fafcb..8acb905 100644
--- a/doxia-modules/doxia-module-xdoc/src/test/resources/test.xml
+++ b/doxia-modules/doxia-module-xdoc/src/test/resources/test.xml
@@ -19,7 +19,7 @@
-->
<document xmlns="http://maven.apache.org/XDOC/2.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
- xsi:schemaLocation="http://maven.apache.org/XDOC/2.0 file:../../main/resources/xdoc-2.0.xsd">
+ xsi:schemaLocation="http://maven.apache.org/XDOC/2.0 https://maven.apache.org/xsd/xdoc-2.0.xsd">
<properties>
<title>Title</title>
diff --git a/doxia-modules/doxia-module-xdoc/src/test/resources/toc.xml b/doxia-modules/doxia-module-xdoc/src/test/resources/toc.xml
index 0afe53b..265da10 100644
--- a/doxia-modules/doxia-module-xdoc/src/test/resources/toc.xml
+++ b/doxia-modules/doxia-module-xdoc/src/test/resources/toc.xml
@@ -20,7 +20,7 @@
<document xmlns="http://maven.apache.org/XDOC/2.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
- xsi:schemaLocation="http://maven.apache.org/XDOC/2.0 file:../../main/resources/xdoc-2.0.xsd">
+ xsi:schemaLocation="http://maven.apache.org/XDOC/2.0 https://maven.apache.org/xsd/xdoc-2.0.xsd">
<properties>
<title>Test DOXIA-40</title>
<author email="vsiveton@apache.org">Vincent Siveton</author>
diff --git a/doxia-modules/doxia-module-xhtml5/src/test/resources/test.xhtml b/doxia-modules/doxia-module-xhtml5/src/test/resources/test.xhtml
index 45f924d..a93e0d3 100644
--- a/doxia-modules/doxia-module-xhtml5/src/test/resources/test.xhtml
+++ b/doxia-modules/doxia-module-xhtml5/src/test/resources/test.xhtml
@@ -1,5 +1,4 @@
<!DOCTYPE html>
-
<!--
Licensed to the Apache Software Foundation (ASF) under one
or more contributor license agreements. See the NOTICE file
diff --git a/pom.xml b/pom.xml
index 87c5ea4..8c01e04 100644
--- a/pom.xml
+++ b/pom.xml
@@ -274,6 +274,7 @@
<artifactId>apache-rat-plugin</artifactId>
<configuration>
<excludes combine.children="append">
+ <exclude>src/main/resources/xml.xsd</exclude>
<exclude>src/test/resources/**/*.apt</exclude>
<exclude>src/test/resources/**/*.apt.vm</exclude>
<exclude>src/test/resources/**/*.md</exclude>