texinfo-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: proposals for new XML


From: Patrice Dumas
Subject: Re: proposals for new XML
Date: Tue, 6 Sep 2011 11:59:02 +0200
User-agent: Mutt/1.4.2.2i

On Mon, Sep 05, 2011 at 11:58:10PM +0000, Karl Berry wrote:
> 
>     Have only <image> and no <inlineimage>.
> 
> Doesn't that make it harder, if not impossible, for the XML-processor to
> figure out how to output the image, something you already know (don't
> you?)?  How about <image where="inline"> or something?

Good idea.

>     Use <pre> for preformatted portions of text, and use the
>     xml:space="preserve" on <pre>, for example
> 
> There are no special rules about <pre> that would get in the way?  E.g.,
> that it can't contain other environments?  I believe there are in HTML
> .. that is, I seem to recall HTML documents not validating because of
> stuff inside <pre>.

Indeed, but in the Parser, the 'preformatted' types do not hold block
commands, it is similar with 'paragraphs'.  So this limitation is already
taken care of, as it is required for HTML.  But I think that it makes
much sense to have the text and inline things in 'preformatted' and not
right in @example since it leads to a tree with a better structure where
we can be sure that there all the significant text and inline stuff is 
within a limited subset of types and @commands (paragraph, preformatted, 
on some command line, so in misc_command_arg...).

As an example:

 @example
 tex in in example

 more text
 @multitable @columnfraction 0.5 0.5
 @item text in item @tab in tab
 @end multitable
 @end example

would lead to (notice that the pre is closed before the multitable and a new
one is opened within @tab or @item).

 <example>
 <pre>tex in in example

 more text
 </pre><multitable><columnfractions><columnfraction 
fraction="0.5"><columnfraction fraction="0.5"></columnfractions>
 <tbody><row><entry command="item"><pre>text in item </pre></entry><entry 
command="tab"><pre>in tab
 </pre></entry></row></tbody></multitable>

>     rename, for @itemize the argument <itemfunction> -> <itemprepend>
> 
> See below.
> 
>     For @itemize, add a <prepend> element, so for example
> 
> Looks sensible to me in general.
> 
>     <itemize commandarg="&minus;"><itemprepend>&minus;</itemprepend>

(I figured this is not right, it should be the real command name in 
commandarg:
  <itemize commandarg="minus"><itemprepend>&minus;</itemprepend>
).

> 
> So we're specifying the arg to @itemize as both an attribute and an
> element?  Why?

Because one could also have something like

 @itemize +
 @item it
 @end itemize

which would lead to

 <itemize><itemprepend>+</itemprepend>
 <item><prepend>+</prepend><para>in item

>     <item><prepend>&minus;</prepend><para>in item
> 
> Is there a reason to use an element instead of an attribute?

The @itemize argument may, in theory be anything.  For example the following 
do not trigger an error, even if it is certainly not correct

@itemize we prepend @code{somethng}

It is not possible to keep the information of @code{} in an attribute. 

This example was not a real one, but in my opinion, an acceptable 
example could be something along

@itemize @code{>}



>     <tableitem><tableterm command="item"> ...
> 
> Why <tableitem><tableterm command="item"> here,
> but simply <item> for @itemize?

That's what was in Texinfo XML previously.  In that case <item> is 
for the text of the table.

> And, when @itemx is used, where does the x show up in these cases?

It is <tableterm command="itemx">

> Just trying to understand ...

Here is an example

@table @code
@item it
@itemx itx
In item
@item it2
@end table


<table commandarg="code">
<tableitem><tableterm command="item" itemfunction="code">it</tableterm>
<tableterm command="itemx" itemfunction="code">itx</tableterm>
<item><para>In item
</para></item></tableitem><tableitem><tableterm command="item" 
itemfunction="code">it2</tableterm>
</tableitem></table>


In the tree, the names are different, and the nesting is the following

@table
  table_entry
    table_term
      @item
        -> it
      @itemx
        -> itx
    table_item
      paragraph
        -> In item
  table_entry
    table_term
      @item
        -> it2

It could be possible to have something more consistent with that tree
in xml, along
<table>
<tableentry><tableterm><item> ....
</item><itemx> ...
</itemx><tableitem><para>
....
</para></tableitem></tableentry><tableentry>.....


Would you prefer that?


-- 
Pat



reply via email to

[Prev in Thread] Current Thread [Next in Thread]