[XML-DEV Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] Re: scripts and PIs
From: Marcus Carr <mrc@a...> >>"Simon St.Laurent" wrote: > >> Suppose I declare a notation like: >> <!NOTATION ECMAScript SYSTEM "http://www.ecma.ch/stand/ECMA-262.htm"> >> >> and then a PI like: >> <?ECMAScript {document.write("Hello, World!");}?> >> >> It seems more reasonable in many ways than >> <SCRIPT LANGUAGE="JAVASCRIPT"> >> <![CDATA[ >> {document.write("Hello, World!");} >> ]]> >> </SCRIPT> >> >> Any thoughts on the subject? > > I prefer PIs. I don't like the idea that the currrent mechanism to insert > script also carries an implied structural significance - that might > sometimes be true, but I'd prefer to be able > to make that decision. I think there is a programming factor too. Ask yourself, "Is the PI a child of the parent element or is it an effect at that point in the document?" If it is not an effect for that point in the document but has been bundled into a section perhaps with other similar markup (e.g. into <meta> in HTML) then I think it should be an element. Similarly, if you ask yourself "Does this have the same scope as an element, or is it scoped to one entity or to the document (regardless of the document element)?" In that case, it should be a PI not an element. For elements and attributes, there is also the factor that programmers often like to process XML so that elements "push" a function (in James Clark's terminology) while attributes are "pulled" from within that function. You will see in CSS stylesheets that people use element rules (or class rules) but rarely rules base solely on the existance of an attribute. So perhaps the following is true Element PI Attribute ----------------- -------- ------ --------- Push/pull Push Push Pull effect/structure structure effect structure More rules could be added to provide more guidence: in particular, whether the script was applicable to all uses of the document. But there is no reason why even all these rules will give a clear answer in all cases: in that case, house style will probably apply and W3C house-style is clearly to favour elements and to favour processing by element type (or HTML class) rather than supporting point-based markup. So, in the case of SCRIPT in HTML, I think it should be an element not a PI. There is no special processing that a PI invokes at the point of its declaration in an HTML document. Rick Jelliffe xml-dev: A list for W3C XML Developers. To post, mailto:xml-dev@i... Archived as: http://www.lists.ic.ac.uk/hypermail/xml-dev/ and on CD-ROM/ISBN 981-02-3594-1 To unsubscribe, mailto:majordomo@i... the following message; unsubscribe xml-dev To subscribe to the digests, mailto:majordomo@i... the following message; subscribe xml-dev-digest List coordinator, Henry Rzepa (mailto:rzepa@i...)
|
PURCHASE STYLUS STUDIO ONLINE TODAY!Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced! Download The World's Best XML IDE!Accelerate XML development with our award-winning XML IDE - Download a free trial today! Subscribe in XML format
|