Processing mixed content
Problem
If you want to access the data of an mixed-content-model element,
(data nd) returns all child data.
E.g. if the content is "<MIXED>123<B>456</B>78</MIXED>"
(data nd) would return "12345678".
data returns all data of all child nodes.
You cannot determine which data is inside <B> and which data is outside.
Solution
The node-property content returns the child-elements and data in one single node-list.
These node-list exhibits the correct order of the data and nodes.
You access these node-list by calling (node-property 'content (current-node))
Example
Stylesheets
SGML-document mixed.sgml, output type rtf
- Usually it is no problem to format a mixed-content model in the correct way as
mixed1.dsl shows.
- But if you want to access the data and determine data inside and outside of child elements,
you get problems as mixed2.dsl shows.
- mixed3.dsl can determine data inside and outside
of child elements.
- The stylesheet grove.dsl shows the structure of the grove.
Index