This is the mail archive of the docbook@lists.oasis-open.org mailing list for the DocBook project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

RFE #480954: Extend textobject to insert external files


Here is a revised proposal for this RFE.

Proposal: extend textobject to allow references to external text files

The following trick is a common way to insert external sources
directly into a DocBook document:

<inlinemediaobject>
<imageobject>
<imagedata format="linespecific" fileref="filename"/>
</imageobject>
</inlinemediaobject>

Several people have suggested that it would make more sense to
allow a <textobject> to do this:

<inlinemediaobject>
<textobject>
<textdata fileref="filename"/>
</textobject>
</inlinemediaobject>

This proposal is superior to relying on XInclude for this
functionality for three reasons.

1. It's the logical extension of existing DocBook features and
replaces a hack with proper semantic markup.

2. It will allow entityref, which is possibly a requirement for some
authors (and is not provided by XInclude).

3. XInclude will require namespace support in DocBook. This is
probably a minor inconvenience for XML, but could potentially be
troubling for SGMLers.

I propose:

1. Change the content model of textobject to:

<!ELEMENT textobject (objectinfo?, (phrase|textdata|(%textobject.mix;)+))>

2. Add a textdata element:

<!ENTITY % local.textdata.attrib "">
<!ENTITY % textdata.attrib
	"
	entityref	ENTITY		#IMPLIED
	fileref 	CDATA		#IMPLIED
	%local.textdata.attrib;"
>

<!ELEMENT textdata EMPTY>
<!ATTLIST textdata
		encoding	CDATA	#IMPLIED
		%common.attrib;
		%textdata.attrib;
		%textdata.role.attrib;
>

The encoding attribute indicates the encoding of the file to be
included. If not present, the system is expected to determine it by
whatever means it can.

The textdata element does not have format or srccredit attributes.

3. Allow textobject as the only child of {inline}mediaobject. (Currently
the media objects require at least one image, audio, or video.

That's the minimum required, I think. It would also be possible to
allow <textobject> or <textdata> in more content models (to avoid the
somewhat odd <inlinemediaobject> wrapper inside, for example,
<programlisting>. Perhaps textobject should be allowed anywhere
inlinemediaobject is allowed...but that would be a separate proposal :-)

                                        Be seeing you,
                                          norm

-- 
Norman Walsh <ndw@nwalsh.com>      | We have fewer friends than we
http://www.oasis-open.org/docbook/ | imagine, but more than we
Chair, DocBook Technical Committee | know.--Hugo Von Hofmannsthal


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]