Next in thread → Next in month →

Re: [dita] Namespaces and Schemas: Some Initial Findings andXSLT Implications

From
Paul Grosso <>
Date
2004-06-29T15:35:54+00:00
ID
[email protected]
Thread
Re: [dita] Namespaces and Schemas: Some Initial Findings andXSLT Implications
At 19:27 2004-06-29 +0400, Paul Antonov wrote:

>On Tue, 29 Jun 2004, Eliot Kimber wrote:
>>
>> The whole issue of defaulted attributes in XML is one of the XML Big
>> Lies, namely the assertion that there is no markup minimization in XML.
>> There isn't *except* for defaulted attributes. In thinking about it now
>> this suggests that there ought to be a simple, schema-compatible, way to
>> define attribute defaults that is separate from the larger function of
>> defining data types and content constraints so that processors could
>> easily implement attribute defaulting without having to step up to full
>> schema awareness, but it appears that this idea got lost in schema land
>> (not surprisingly). Hmmm.
>
>This is another good reason for having a formal, XML-based format for DITA
>specializations. From this, it will be pretty easy to generate XSLT
>stylesheet which sets class attributes for further processing (both
>steps can be done in a single XSLT processor run because most XSLT
>implementations allow apply-templates on result tree fragments).

Replying just to the parenthetical statement, you have to be very careful
about using apply-templates on result tree fragments (e.g., using the
exslt:node-set() function) because you lose context.  That is, when you
process a node that has been passed to exslt:node-set(), the "root" of
the context is the top level node passed to exslt:node-set(), and any
nodes that were ancestors in the input document are not seen as ancestors
of the node that gets processed within exslt:node-set().  This can cause
subtle and sometimes unfixable bugs in your processing.  I'd be very 
careful about relying on such techniques for a robust DITA solution.

If necessary to do something like this, it would be better to plan to 
do two XSLT passes in series in a sort of pipeline.

paul
Next in thread → Next in month →