[Date Prev] | [Thread Prev] | [Thread Next] | [Date Next] -- [Date Index] | [Thread Index] | [Elist Home]
Subject: Re: Issue: TREX elements appearing in foreign elements (Re: A TREX<documentation> element)
Michael Fitzgerald wrote: >What do you mean by "Some SAX programmers will fail to handle such patterns >correctly"? Did you mean "programs"? Can you give us an example? Suppose that you would like to make a list of names defined by <define> elements by using the SAX API. We create an event handler for start tags. If the tag name is "define", then this start tag represents a <define> element. Very simple. Wait! But this element might be embedded in a foreign element. For example: <define name="foo"> <foreign:foo> <define name="bar"/> </foreign:foo> ... </define> In this example, we have to skip the second <define>. Furthermore, consider another example. <define name="foo"> <foreign:foo> <foreign:foo> <define name="bar"/> </foreign:foo> <define name="bar"/> </foreign:foo> ... </define> In this example, the first </foreign:foo> does not correspond to the first <foreign:foo> but rather close the second <foreign:foo>. Both occurrences of <define name="bar"/> have to be skipped. To correctly skip foreign elements as well as their subordinate elements of the namespace for TREX, we have to count the nest level. That is, whenever we encounter start or end tags, we increment or decrement a counter. This is not difficult, but has to be implemented by ANY programs. James Clark wrote: >I don't see any need to treat TREX elements in foreign elements >specially. They are ignored just like any other elements. It is very >easy to implement this. What is very easy is a subjective issue. I think that most people do not count the nest level, but merely create an event handler for elements of the namespace of TREX. >I can well imagine wanting an annotation that >includes a TREX element. For example, I might want to have an >annotation on a URI reference that gives a pattern for the referenced >document. I understand that such annotations have some values. But I do not think they do not belong to 80%. Cheers, Makoto
[Date Prev] | [Thread Prev] | [Thread Next] | [Date Next] -- [Date Index] | [Thread Index] | [Elist Home]
Powered by eList eXpress LLC