Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!swrinde!zaphod.mps.ohio-state.edu!think.com!snorkelwacker.mit.edu!bloom-beacon!eru!hagbard!sunic!ugle.unit.no!nuug!ifi.uio.no!enag From: enag@ifi.uio.no (Erik Naggum) Newsgroups: comp.text.sgml Subject: Re: A floating paired tag... Message-ID: Date: 9 Jun 91 00:08:06 GMT References: <932@bcstec.boeing.com> Sender: enag@ifi.uio.no (Erik Naggum) Organization: Naggum Software, Oslo, Norway Lines: 115 Nntp-Posting-Host: gyda.ifi.uio.no In-Reply-To: ruben@bcstec.boeing.com's message of 7 Jun 91 21: 07:15 GMT Originator: enag@gyda.ifi.uio.no Reuben Wachtfogel writes: | | This may be very basic question but I really did | try to find the answer independently and I'm stumped. Thanks for this courtesy to other news readers. | I wish to define a bracketing structure that could be inserted | around any of: | 1) blah | 2) <\b1> | 3) <\a1> | 4) <\a> If I may make some assumptions about what your problem is, here's my thoughts. The bracketing, floating element will be used to encode some information _about_ the data content found inside the elements it embraces. This suggests itself to attributes, and since you wish to have the attribute value remain across sub-elements, you can either (1) let the value be #IMPLIED by the application, so that the application will keep track of the nested elements, or (2) let the value be #CURRENT. The disadvantage with (1) is that you need a special mechanism in the application software to handle this (and other attributes). The disadvantage with (2) is that #CURRENT attribute values do not respect hierarchies, but are "current" for a given attribute when the element to which it was specified ends. I'm unclear on this point, myself, and would appreciate comments. Given the document type declaration fragment and the document instance fragment ha che good food kuluyuk what is the value of the language attribute when "kuluyuk" is seen? It seems clear that if the fragment ends with sweet-sour pork the second inner will have the language attribute value "english". The information you need to encode is somehow external to the document in which it applies, and should be regarded as a different "view" of the document. For this purpose, you could define a concurrent document type which deals with this information, and not the other structural information. Presented this way, the elements of one document type does not interfere with the other. One clear disadvantage with this approach is that you would not be able to relate the two document types very easily. For instance, the first document type's elements need not embrace complete elements of the second. Depending on your needs, this may be what you want. There are external requirements that force you to use an element for this purpose, and you very badly need to have defined regions within which the attributes are declared, so badly that you could dispense with the rigidity of the markup. You could declare the element with content model ANY, and enforce the rigidity in the application, instead: If you do this, you can open a new element inside a element and proceed inside that element according to its content model, and then close the element. I don't recommend this. An alternate solution would be to list all the valid sub-elements that language could possible embrace, e.g. but this quickly becomes difficult to maintain and understand, although it's better from a purist's view. Note: this works only if you allow to embrace only _one_ element at a time. If you need to embrace several elements things quickly get very difficult. I need more information on your problem to be able to evaluate each of these or perhaps think of other solutions. I can't readily see an elegant way to do this without floating attributes (such as #CURRENT) or a concurrent document, but there are many ways to specify attribute values, including link attributes. What we need (which may exist, but I may just have overlooked it), is a means to supply attribute values for the extent of an element and all sub-elements thereof. #CURRENT, in my reading, doesn't support this. I'd be happy to be proven wrong on this one. I'd especially like to know what's the right interpretation of a #CURRENT attribute which is changed inside an element. I'm sorry that I can't test this because the parser I've written is based on my own fuzzy assumptions on the treatment of CURRENT values. Can anybody help, either with theory or with practice? -- Erik Naggum Professional Programmer +47-2-836-863 Naggum Software Electronic Text 0118 OSLO, NORWAY Computer Communications