[XML-DEV Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

Re: scripts and PIs

  • From: "Rick Jelliffe" <ricko@a...>
  • To: "XML-Dev Mailing list" <xml-dev@i...>
  • Date: Fri, 15 Oct 1999 15:17:00 +0800

re scripts
 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!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
Email
First Name
Last Name
Company
Subscribe in XML format
RSS 2.0
Atom 0.3
 

Stylus Studio has published XML-DEV in RSS and ATOM formats, enabling users to easily subcribe to the list from their preferred news reader application.


Stylus Studio Sponsored Links are added links designed to provide related and additional information to the visitors of this website. they were not included by the author in the initial post. To view the content without the Sponsor Links please click here.

Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery ™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2013 All Rights Reserved.