Talk:19757-8

From Wg1-wiki

Jump to: navigation, search

Contents

[edit] The Entity/Remapping Problem

As I understand it, the intention of DSRL is to allow users to specify a mixture of XML constructs in the replacement-text element content including elements, text, and entity references.

So,

<dsrl:replacement-text>it was a solution with some <i>&eacute;lan</i></dsrl:replacement-text>

The expectation in this case is that the instance resulting from the DSRL process will be governed by a DTD which declares any entities that are referenced in the DSRL map.

There are a number of problems realising this ambition:

  • Such content in the DSRL map is not well-formed XML (not XML), unless the entities referenced are declared in a DTD which governs the DSRL map
  • Even then, many XML processors will not recognise the existence of the lexical construct (the entity reference) and merely pass through the content to which it resolves

In an attempt to circumvent this, the current DSRL FDIS text mandates the used of CDATA marked sections for the replacement content, e.g.:

<dsrl:replacement-text>
 <![CDATA[it was a solution with some <i>&eacute;lan</i>]]>
</dsrl:replacement-text>

There are a number of problems with this, not least that to an XML processor the replacement content is an opaque string which cannot reliably be mapped to XML structures (DPC-11 raises a namespace problem, for example).

[edit] Proposed Solution

  • the replacement-text element (which would be better named "replacement-content") shall be declared to have any well-balanced content
  • content contained within this element shall become equivalent content in the instance adapted by DSRL (i.e. elements become elements) - the CDATA mechanism is not used
  • if it is desired to specify an entity reference in the replacement content, this shall be done using a new empty <dsrl:entity-ref> element, which has a single attribute, "name", giving the name of the entity to be referenced
  • DSRL processors may optionally recognise the <dsrl:entity-ref> element
  • If they do, a two stage processing model may resolve these <dsrl:entity-ref> into entity references

Note it is possible for implementations that support this to determine if any DTD governing the mapped instance does in fact declare the entities being referenced, and to fail if they are not. I do not believe it makes to sense to have a processing model that involves entity references without a such a "governing DTD" for the mapped instance being specified somewhere.

[edit] Entity references within replaced content

I am far from convinced that there is a specific need for replacement-content to contain entity references other than those for the 5 reserved characters required by XML. (lt, gt, amp, ?,?)

Entity definition within DSRL is simply a mechanism for declaring what the entity set required by the next process is. Nothing in the replacement text is meant to be processed as part of the mapping process. The only time a processor sees the contents of the replacement text is when it expands the entity reference at the start of the next process. The key fact is that entity reference expansion needs to be inhibited as part of DSRL processing. Where there was an entity reference in the source file it should be replaced by an identical entity reference in the result. I suspect that this fact needs to be made more explicit in Clause 7.

[edit] Visit do follow articles to post free do follow articles

Visit http://www.dofollowarticles.com to post articles in the following categories: Frutaiga, Roseville, print, involvement, pocketbikes, Eavesdropping, mistake and more...

Personal tools