From: "Alex Brown" <alexb@griffinbrown.co.uk>
> Concurrent (overlapping) structures happen and need processing in many
> (most?) publishing applications.
I certainly don't agree "most" or "need": the fact that almost no documents are
published using concurrent markup demonstrates that.
> Has anybody any idea about how DSDL might address validation of
> concurrent/overlapping structures?
Schematron can be used for many concurrent markup structures.
Here is one way.
Our document is XML. We have a primary structure, which is made
with just normal synchronous elements. Lets give it this structure.
<!ELEMENT play ( title, line+)>
<!ELEMENT title ( #PCDATA )>
<!ELEMENT line ( #PCDATA | part-start | part-end )*>
<!ELEMENT part-start EMPTY>
<!ELEMENT part-end EMPTY>
<!ATTLIST part-start
character CDATA #REQUIRED>
So the markup might look like
...
<line><part-start character="FlowerPot">Weeed<part-end><part-start character="Ben">Hello</line
<line>Ben<part-end><part-start character="narator">And there they all were</line>
...
Schematron then expresses the constraints:
<rule context="line/part-end>
<assert test="count(previous::line-start) = count(previous::line-end) +1">
At all stages in the document, every line-end will have a matching line-start.
</assert>
</rule>
<rule context="poem/line/line-start/last()">
<assert test="count(following::line-end) = 1">
The last line-start must be matched by a line-end.
</assert>
</rule>
I expect there are more efficient ways to do this. Without checking it, maybe this
would work in a single pass:
<rule context="poem">
<report test="line/*[self::line-start or self::line-end]
[not(self::line-start[position() mod 2 = 0]
or self::line-end[position() mod 2 = 1]])">
The line starts should always be in even positions,
paired with line-ends always in odd positions.
</report>
</rule>
> With DSDL as it's currently envisaged, we seem to be producing something
> that will be less sophisticated than SGML in this respect...
From the POV of validating concurrent structures in the XML, ISO DSDL
is much more advanced than SGML.
Cheers
Rick Jelliffe
-- DSDL members discussion list To unsubscribe, please send a message with the command "unsubscribe" to dsdl-discuss-request@dsdl.org (mailto:dsdl-discuss-request@dsdl.org?Subject=unsubscribe)Received on Tue Jun 3 17:55:06 2003
This archive was generated by hypermail 2.1.8 : Fri Dec 03 2004 - 14:00:27 UTC