maven-doxia-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Vincent Siveton" <vincent.sive...@gmail.com>
Subject Re: svn commit: r700094 - /maven/doxia/doxia-tools/trunk/doxia-converter/src/main/java/org/apache/maven/doxia/DefaultConverter.java
Date Mon, 29 Sep 2008 17:15:13 GMT
2008/9/29 Hervé BOUTEMY <herve.boutemy@free.fr>:
> Hi Lukas,
>
> Thanks for pointing this out: I'm not a docbook expert neither, and did not
> know this explanation of *Simple* Docbook.
> This is not written in the docbook Doxia module code (or I didn't find it ;) )
> neither.
> I'll update the doc.

Go 4 it :)

> I got confused by 2 facts in the code:
> - these elements are in the DocBookParser class (as HIER_ELEMENTS constant)
> - test/resources/book.xml is a book, not an article
> Should I remove these parts?
> Or simply mark them as experimental since out of the strict scope of the
> module?

It is related to DOXIA-186. In fact, the DocBookSink uses wrong DTD
Also, the DocbookParser and DocbookMarkup specifies some unused tags
(like BOOK_TAG). It will be good to remove them to be sticked on the
simplified docbook definition [1].

Cheers,

Vincent

> Regards,
>
> Hervé
>
> Le lundi 29 septembre 2008, Lukas Theussl a écrit :
>> Hi Herve,
>>
>> I haven't looked at the doxia modules for a while, and I am not a
>> docbook expert but IIRC, the doxia docbook module is for Simplified
>> Docbook only and in Simplified DocBook the root element is always
>> <article>.
>>
>> Correct me if I'm wrong...
>>
>> Cheers,
>> -Lukas
>>
>> hboutemy@apache.org wrote:
>> > Author: hboutemy
>> > Date: Mon Sep 29 05:29:00 2008
>> > New Revision: 700094
>> >
>> > URL: http://svn.apache.org/viewvc?rev=700094&view=rev
>> > Log:
>> > there are multiple root element values possible for Docbook format
>> > (article, but also book, part, chapter, ...)
>> >
>> > Modified:
>> >
>> > maven/doxia/doxia-tools/trunk/doxia-converter/src/main/java/org/apache/ma
>> >ven/doxia/DefaultConverter.java
>> >
>> > Modified:
>> > maven/doxia/doxia-tools/trunk/doxia-converter/src/main/java/org/apache/ma
>> >ven/doxia/DefaultConverter.java URL:
>> > http://svn.apache.org/viewvc/maven/doxia/doxia-tools/trunk/doxia-converte
>> >r/src/main/java/org/apache/maven/doxia/DefaultConverter.java?rev=700094&r1
>> >=700093&r2=700094&view=diff
>> > =========================================================================
>> >===== ---
>> > maven/doxia/doxia-tools/trunk/doxia-converter/src/main/java/org/apache/ma
>> >ven/doxia/DefaultConverter.java (original) +++
>> > maven/doxia/doxia-tools/trunk/doxia-converter/src/main/java/org/apache/ma
>> >ven/doxia/DefaultConverter.java Mon Sep 29 05:29:00 2008 @@ -27,10 +27,12
>> > @@
>> >  import java.io.Reader;
>> >  import java.io.Writer;
>> >  import java.util.HashMap;
>> > +import java.util.HashSet;
>> >  import java.util.Iterator;
>> >  import java.util.List;
>> >  import java.util.Locale;
>> >  import java.util.Map;
>> > +import java.util.Set;
>> >  import java.util.regex.Matcher;
>> >  import java.util.regex.Pattern;
>> >
>> > @@ -111,6 +113,37 @@
>> >      public static final String[] SUPPORTED_TO_FORMAT =
>> >          { APT_SINK, DOCBOOK_SINK, FO_SINK, ITEXT_SINK, LATEX_SINK,
>> > RTF_SINK, XDOC_SINK, XHTML_SINK };
>> >
>> > +    private static final Set DOCBOOK_ROOT_ELEMENT = new HashSet();
>> > +
>> > +    static
>> > +    {
>> > +        DOCBOOK_ROOT_ELEMENT.add( "set" );
>> > +        DOCBOOK_ROOT_ELEMENT.add( "book" );
>> > +        DOCBOOK_ROOT_ELEMENT.add( "part" );
>> > +        DOCBOOK_ROOT_ELEMENT.add( "chapter" );
>> > +        DOCBOOK_ROOT_ELEMENT.add( "section" );
>> > +        DOCBOOK_ROOT_ELEMENT.add( "sect1" );
>> > +        DOCBOOK_ROOT_ELEMENT.add( "sect2" );
>> > +        DOCBOOK_ROOT_ELEMENT.add( "sect3" );
>> > +        DOCBOOK_ROOT_ELEMENT.add( "sect4" );
>> > +        DOCBOOK_ROOT_ELEMENT.add( "sect5" );
>> > +        DOCBOOK_ROOT_ELEMENT.add( "article" );
>> > +        DOCBOOK_ROOT_ELEMENT.add( "preface" );
>> > +        DOCBOOK_ROOT_ELEMENT.add( "partintro" );
>> > +        DOCBOOK_ROOT_ELEMENT.add( "appendix" );
>> > +        DOCBOOK_ROOT_ELEMENT.add( "bibliography" );
>> > +        DOCBOOK_ROOT_ELEMENT.add( "reference" );
>> > +        DOCBOOK_ROOT_ELEMENT.add( "bibliography" );
>> > +        DOCBOOK_ROOT_ELEMENT.add( "bibliodiv" );
>> > +        DOCBOOK_ROOT_ELEMENT.add( "glossary" );
>> > +        DOCBOOK_ROOT_ELEMENT.add( "refentry" );
>> > +        DOCBOOK_ROOT_ELEMENT.add( "refnamediv" );
>> > +        DOCBOOK_ROOT_ELEMENT.add( "refsection" );
>> > +        DOCBOOK_ROOT_ELEMENT.add( "refsect1" );
>> > +        DOCBOOK_ROOT_ELEMENT.add( "refsect2" );
>> > +        DOCBOOK_ROOT_ELEMENT.add( "refsect3" );
>> > +    }
>> > +
>> >      /** Plexus container */
>> >      private PlexusContainer plexus;
>> >
>> > @@ -614,7 +647,7 @@
>> >              {
>> >                  continue;
>> >              }
>> > -            else if ( firstTag.equals( "article" )
>> > +            else if ( DOCBOOK_ROOT_ELEMENT.contains( firstTag )
>> >                  && supportedFromFormat.equalsIgnoreCase( DOCBOOK_PARSER
>> > ) ) {
>> >                  return supportedFromFormat;
>
>
>

Mime
View raw message