RE: [Zope] - XML-style DTML code
Chris wrote:
<?ztml #var arg ?>
Ahh, tis nuthin better than seeing a patch accompany a proposal :^) Here's my main beef with this. The ostensible goal of the XML syntax is to make it parse-able by new tools. Unfortunately, a valid use of the current syntax: <font size="<!--#var font_size-->"> which is legal, would become: <font size="<?ztml #var arg ?>"> which *not* valid XML...is it? That is, can you have markup inside markup? --Paul Paul Everitt Digital Creations paul@digicool.com 540.371.6909
Paul Everitt writes:
Chris wrote:
<?ztml #var arg ?>
Ahh, tis nuthin better than seeing a patch accompany a proposal :^)
Here's my main beef with this. The ostensible goal of the XML syntax is to make it parse-able by new tools. Unfortunately, a valid use of the current syntax:
<font size="<!--#var font_size-->">
which is legal, would become:
<font size="<?ztml #var arg ?>">
which *not* valid XML...is it? That is, can you have markup inside markup?
I don't believe so, but have CC'ed this to the XML-SIG where the real experts hang out. PIs have to be outside other markup; I suspect the XML way of handling your second case would be to define an entity: <font size="&arg;"> This is unfortunate for the application of HTML templating, because it collides with the use of entities in HTML. It also makes things difficult because the entity would have to be declared at the beginning of the file in the DOCTYPE declaration. Making the templating identical to XML, while keeping it conveniently human-editable, may not be possible. -- A.M. Kuchling http://starship.skyport.net/crew/amk/ "You? What are you?" "Me? Lady, I'm your worst nightmare -- a pumpkin with a gun." -- The Furies and Mervyn, in SANDMAN #66: "The Kindly Ones:10"
Paul Everitt writes:
<font size="<!--#var font_size-->">
which is legal, would become:
This is legal: The "<!--#var font_size-->" is the CDATA value of the size attribute, not a comment.
<font size="<?ztml #var arg ?>">
which *not* valid XML...is it? That is, can you have markup inside
The "<?ztml #var arg ?>" is a perfectly valid string value of the size attribute, just as before.
I don't believe so, but have CC'ed this to the XML-SIG where the real experts hang out. PIs have to be outside other markup; I suspect the XML way of handling your second case would be to define an entity:
<font size="&arg;">
In neither SGML nor XML can markup be nested like this. The use of entities is the proper way to do this in either case. Perhaps a processing tool needs to be available which can perform "entity expansion" for specified entity names only? -Fred -- Fred L. Drake, Jr. <fdrake@acm.org> Corporation for National Research Initiatives 1895 Preston White Dr. Reston, VA 20191
On Fri, Jan 29, 1999 at 10:07:40AM -0500, Fred L. Drake wrote:
Paul Everitt writes:
<font size="<!--#var font_size-->">
which is legal, would become:
This is legal: The "<!--#var font_size-->" is the CDATA value of the size attribute, not a comment.
Right this is the current scheme (note that this is one use of the DTML command set that is embedded in an HTML tag, a lot aren't). And this is also how I read the sstandard.
<font size="<?ztml #var arg ?>">
which *not* valid XML...is it? That is, can you have markup inside
The "<?ztml #var arg ?>" is a perfectly valid string value of the size attribute, just as before.
Wouldn't the DTD restrict the use of < inside? I thoguht the spec required that except inside a couple things ... like PIs... that the < and & characters must be escaped?
<font size="&arg;">
In neither SGML nor XML can markup be nested like this. The use of entities is the proper way to do this in either case. Perhaps a processing tool needs to be available which can perform "entity expansion" for specified entity names only?
I'm confused by what you mean here, being a newbie to XMLish things. Chris -- | Christopher Petrilli | petrilli@amber.org
Christopher G. Petrilli writes:
Wouldn't the DTD restrict the use of < inside? I thoguht the spec required that except inside a couple things ... like PIs... that the < and & characters must be escaped?
Hmm... not the DTD, but you got me: the XML spec may well restrict the use of < and & in quoted attribute values. While avoiding some of the delimiter-in-context rules from SGML for the benefit of parser implementors, we end up with some ugly markup. ;-(
<font size="&arg;">
In neither SGML nor XML can markup be nested like this. The use of entities is the proper way to do this in either case. Perhaps a processing tool needs to be available which can perform "entity expansion" for specified entity names only?
I'm confused by what you mean here, being a newbie to XMLish things.
I meant that '<foo bar="<!-- ... -->">' (SGML this time!) did not contain nested markup. (Same for the PI in an attribute value.) '<foo bar="&arg;">' does contain nested markup, but not nested structure. My thought was that a tool could be written which would convert: <!DOCTYPE thing PUBLIC "..." [ <!ENTITY frob CDATA "replacement text"> ]> <thing> &frob; & </thing> into this: <!DOCTYPE thing PUBLIC "..."> <thing> replacement text & </thing> Such a tool could perform expansion on either all the entities defined in the internal subset (the stuff in [ ... ] in the DOCTYPE declaration), or allow the user to specify a list of names (and possibly values) from another source. -Fred -- Fred L. Drake, Jr. <fdrake@acm.org> Corporation for National Research Initiatives 1895 Preston White Dr. Reston, VA 20191
On Fri, Jan 29, 1999 at 10:40:22AM -0500, Fred L. Drake wrote:
I meant that '<foo bar="<!-- ... -->">' (SGML this time!) did not contain nested markup. (Same for the PI in an attribute value.)
So my implementation of the <?ztml ... ?> is acceptable under XML guidelines? That was how I interpreted it, but gods only know!
'<foo bar="&arg;">' does contain nested markup, but not nested structure. My thought was that a tool could be written which would convert:
My head just exploded Thank you Very Much :-) Chris -- | Christopher Petrilli | petrilli@amber.org
Christopher G. Petrilli writes:
So my implementation of the <?ztml ... ?> is acceptable under XML guidelines? That was how I interpreted it, but gods only know!
(I didn't catch any of the discussion before Andrew CC'd the XML-SIG, so I think I'm missing some of the context here.) What you probably want to do is to pass an example that uses the PI syntax in all situations that you intend to support (including in attribute values if you want that), and pass it through a validating parser. If it complains, you'll know what's broken. If it doesn't, then go ahead and use it. I'd rather see PI syntax used over comment syntax for either SGML or XML for this sort of processing.
My head just exploded Thank you Very Much :-)
You're welcome. ;-) -Fred -- Fred L. Drake, Jr. <fdrake@acm.org> Corporation for National Research Initiatives 1895 Preston White Dr. Reston, VA 20191
On Fri, Jan 29, 1999 at 10:49:06AM -0500, Fred L. Drake wrote:
Christopher G. Petrilli writes:
So my implementation of the <?ztml ... ?> is acceptable under XML guidelines? That was how I interpreted it, but gods only know!
(I didn't catch any of the discussion before Andrew CC'd the XML-SIG, so I think I'm missing some of the context here.) What you probably want to do is to pass an example that uses the PI syntax in all situations that you intend to support (including in attribute values if you want that), and pass it through a validating parser. If it complains, you'll know what's broken. If it doesn't, then go ahead and use it. I'd rather see PI syntax used over comment syntax for either SGML or XML for this sort of processing.
Well, then I'll sit down and write a test suite as soon as I get the brainpower back from your exploding my head, and we can see what explodes and what doesn't. Also, I'm going to tweek the syntax since everyone seems to want to get rid of some vestigal old pieces... Also, I'm not sure it's intended to BE XML, more accurately it's intended to LOOK like XML to an XML editor, the move to full XML for this could be troublesome... for exmaple: <?ztml in variable ?> <!-- iterate over a sequence --> <?ztml if sequence-start ?> Print something here. <?ztml /if ?> <?ztml var foo ?> <!--Print a variable from the sequence itterated --> <?ztml /in ?> Yes I realise that XML has it's own constructs for doing things like this, BUT ... what I'm trying to do is create a migration path, and move it to something that starts to LOOK like XML, so that people using <?ztml var favorite-editor ?> can use it, and not have to worry about the troublesome side-effects of putting logic in comment code. Please no religious responses though :-) Chris -- | Christopher Petrilli | petrilli@amber.org
Christopher G. Petrilli writes:
Also, I'm not sure it's intended to BE XML, more accurately it's intended to LOOK like XML to an XML editor, the move to full XML for this could be troublesome... for exmaple:
If an XML editor is going to handle it, it better be XML! If it looks like XML, someone will want to use an editor for it, so.... -Fred -- Fred L. Drake, Jr. <fdrake@acm.org> Corporation for National Research Initiatives 1895 Preston White Dr. Reston, VA 20191
On Fri, Jan 29, 1999 at 11:17:59AM -0500, Fred L. Drake wrote:
Christopher G. Petrilli writes:
Also, I'm not sure it's intended to BE XML, more accurately it's intended to LOOK like XML to an XML editor, the move to full XML for this could be troublesome... for exmaple:
If an XML editor is going to handle it, it better be XML! If it looks like XML, someone will want to use an editor for it, so....
Well, my goal has not been to convert DTML to an XML, but to make it more LIKE XML, something that is familiar, and something that wouldn't look out of place. Honestly, I do not expect people to try and write HTML+ZTML with an XML tool, were such a beast to actually end up existing in the hands of a normal human... Chris -- | Christopher Petrilli | petrilli@amber.org
"Fred L. Drake" wrote:
In neither SGML nor XML can markup be nested like this. The use of entities is the proper way to do this in either case. Perhaps a processing tool needs to be available which can perform "entity expansion" for specified entity names only?
I discussed this a couple of months ago on the Zope list. I suggested that they use XSL template syntax. It's more verbose but it separates the levels more cleanly. The syntax for doing attributes would look something like this: <FONT> <xsl:attribute name="size">6</xsl:attribute> blah blah blah </FONT> The Zope equivalent would be: <FONT> <zope:attribute name="size">6</zope:attribute> blah blah blah </FONT> IMHO, the current Zope syntax cannot survive into the "XML age." People will want to author their templates in XML editors and Zope's illegal syntax will prevent this. Paul Prescod - ISOGEN Consulting Engineer speaking for only himself http://itrc.uwaterloo.ca/~papresco Don't you know that the smart bombs are so clever, they only kill bad people." - http://www.boingo.com/lyrics/WarAgain.html
On Fri, Jan 29, 1999 at 10:34:12AM -0600, Paul Prescod wrote:
IMHO, the current Zope syntax cannot survive into the "XML age." People will want to author their templates in XML editors and Zope's illegal syntax will prevent this.
I personally cannot forsee what "people" will want to do in 3 months, nor can anyone else. Today, XML is the trendy answer to every question asked regardless of its merit or robustness. I don't disagree that there will be people who want to do this, and I don't argue that such a system shouldn't be supported. But I do argue that for most everything people do today, wit hteh tools they have TODAY, that the current syntax is perfectly acceptable... Maybe we need to work seperately on an XML/XSL side, but that doesn't invalidate the current syntax, any more than the fact that you can't do proper lexical closures with Python invalidates its use today. My goal was to provide an obviously incomplete fix to the current problem of editing in HTML editors, which is what sparked this. The fix I proposed fixes that. Once I have a proper XML editor with full XSL support, it'll be easier to hypothesise about solutions, but until then, it's all hand waving. Chris -- | Christopher Petrilli | petrilli@amber.org
I didn't mean to step on your toes nor say anything for or against any proposal that you may have made regarding this issue. I've seen only half of this conversation and out-of-order. If the question is "how do I make DTML XML compliant" my answer is "use XSL-style templates." By the way you disparge XML in your message, I presume that XML compliance is *not* your current problem, but that leaves me rather confused about the subject line. Confusedly, Paul Prescod "Christopher G. Petrilli" wrote:
I personally cannot forsee what "people" will want to do in 3 months, nor can anyone else. Today, XML is the trendy answer to every question asked regardless of its merit or robustness. I don't disagree that there will be people who want to do this, and I don't argue that such a system shouldn't be supported. But I do argue that for most everything people do today, wit hteh tools they have TODAY, that the current syntax is perfectly acceptable... Maybe we need to work seperately on an XML/XSL side, but that doesn't invalidate the current syntax, any more than the fact that you can't do proper lexical closures with Python invalidates its use today.
My goal was to provide an obviously incomplete fix to the current problem of editing in HTML editors, which is what sparked this. The fix I proposed fixes that. Once I have a proper XML editor with full XSL support, it'll be easier to hypothesise about solutions, but until then, it's all hand waving.
Chris -- | Christopher Petrilli | petrilli@amber.org
-- Paul Prescod - ISOGEN Consulting Engineer speaking for only himself http://itrc.uwaterloo.ca/~papresco Don't you know that the smart bombs are so clever, they only kill bad people." - http://www.boingo.com/lyrics/WarAgain.html
On Fri, Jan 29, 1999 at 02:14:04PM -0600, Paul Prescod wrote:
I didn't mean to step on your toes nor say anything for or against any proposal that you may have made regarding this issue. I've seen only half of this conversation and out-of-order. If the question is "how do I make DTML XML compliant" my answer is "use XSL-style templates." By the way you disparge XML in your message, I presume that XML compliance is *not* your current problem, but that leaves me rather confused about the subject line.
Since you used to be on the Zope list, I had assumed you caught the whole conversation... it goes something like this. Someone asks why there isn't some neat GUI. Someone proposes Netscape/et al. Someone complains that using comments for DTML (<!--#var -->) makes it nearly impossible to use said tools. I do a tiny bit of looking, and propsose to modify the syntax to look more like XML, and also like PHP (which also uses the PI construct), never proposing that it's XML, just "XML-like"... also this will perhaps start to get people aclimated to typing <?ztml ?> rather than the existing one. Anyway, somehow that got copied to the XML list, trying to see if it was wellformed... it's not, nor valid, I know that, understood it from the start. It wasn't my intention to make well-formed nor valid XML. well, anyway, someone proposed an option that would translate to well-formed XML... (I forget the name, now, damned emailer), which comes to something like this, which si what I'm looking at now: <?ztml store("var name")?> Note that this is used for non-immediate insertion into the data-stream, and perhaps more accurately fits the use intended for PI elements. That shoves it into a "register" which can be later accessed using: &ztml; As an identity construct. This eeems to meet all the concerns except that it isn't XSL... but it's not meant ot be XSL, just an ultra-lightweight way to get 99% of the job done. You can then use it so: <A HREF="&ztml;/FolderishTHingHere"> which, according to what I read in the XML spec is totally acceptable :-) Now I'd like to be able to define a bunch of these things at the start of a template, but that's just too complex, I'm not sure that I like the results of &ztml0; &ztml1; etc., which create the effective result of single letter variables ... evil evil evil. Mkae sense now? Plus I needed to write this down for my own edification and education, so I understand what it is I'm trying to do :-) Chris -- | Christopher Petrilli | petrilli@amber.org
At 03:50 PM 1/29/99 -0500, Christopher G. Petrilli wrote:
Someone asks why there isn't some neat GUI.
Someone proposes Netscape/et al.
Someone complains that using comments for DTML (<!--#var -->) makes it nearly impossible to use said tools.
I do a tiny bit of looking, and propsose to modify the syntax to look more like XML, and also like PHP (which also uses the PI construct), never proposing that it's XML, just "XML-like"... also this will perhaps start to get people aclimated to typing <?ztml ?> rather than the existing one.
Anyway, somehow that got copied to the XML list, trying to see if it was wellformed... it's not, nor valid, I know that, understood it from the start. It wasn't my intention to make well-formed nor valid XML.
well, anyway, someone proposed an option that would translate to well-formed XML... (I forget the name, now, damned emailer), which comes to something like this, which si what I'm looking at now:
<?ztml store("var name")?>
Note that this is used for non-immediate insertion into the data-stream, and perhaps more accurately fits the use intended for PI elements. That shoves it into a "register" which can be later accessed using:
&ztml;
As an identity construct. This eeems to meet all the concerns except that it isn't XSL... but it's not meant ot be XSL, just an ultra-lightweight way to get 99% of the job done. You can then use it so:
<A HREF="&ztml;/FolderishTHingHere">
which, according to what I read in the XML spec is totally acceptable :-) Now I'd like to be able to define a bunch of these things at the start of a template, but that's just too complex, I'm not sure that I like the results of &ztml0; &ztml1; etc., which create the effective result of single letter variables ... evil evil evil.
Chris thanks for this excellent summary of the issues and thanks for leading the discussion and providing patches. Go Chris! Getting this right is an important project. I don't know enough about XML and XML editors to know what's necessary for them to edit DTML, but it would be great if they could. Otherwise, allowing more HTML editors to edit DTML would be the next best thing. Despite how sneaky and cool it is, from an esthetic point of view, I really dislike Carsten's entity defining hack. Maybe if entities could be used more generally in DTML, then this wouldn't seem so weird... Maybe there could be some general way to access variables in the template's name space using entities... Anyway, I don't have the answers, but I want to reiterate my support for Chris's and everyone else's efforts. Thanks! -Amos
On Fri, Jan 29, 1999 at 01:49:08PM -0800, Amos Latteier wrote:
Getting this right is an important project. I don't know enough about XML and XML editors to know what's necessary for them to edit DTML, but it would be great if they could. Otherwise, allowing more HTML editors to edit DTML would be the next best thing.
Well, incremental steps, grasshopper :-) My first goal was to simply make it work better in HTML editors, many of which I've seen (at least I think I've seen) support user-defined tags like this... BBedit certainly does, and so does Cyberstudio. Later comes delving into XSL and whether it can be made to work as another methodology.
Despite how sneaky and cool it is, from an esthetic point of view, I really dislike Carsten's entity defining hack. Maybe if entities could be used more generally in DTML, then this wouldn't seem so weird... Maybe there could be some general way to access variables in the template's name space using entities...
I have to agree here, it's a neat idea, but, after a lot of thought, I'm affraid it'll just confuse too many people, and also perhaps lead to problems down the road with further XML integration...
Anyway, I don't have the answers, but I want to reiterate my support for Chris's and everyone else's efforts. Thanks!
Well, thanks, I've uploaded a tweeked patch to the same location as before, which removes the # from the syntax... I think this really looks a lot cleaner... you can now just do: <?ztml var arg ?> I'm going to look into the SGML mode in Emacs see if I can teach it some more, so that it can look inside PI elements. Next on my step of items to blow up so as to make everyone's life more difficult is to get the following working, as proposed (slightly modified by me): <?ztml store var arg ?> What this does is shove the value of 'var arg' (or <!--#var arg--> in the existing dialect) into a register (that's only good for a single document session, i.e. not really global, nor in any way persistent), which you can then insert as you wish: <A HREF="&ztml;">Go here.</A> This seems to be the best way in my mind to fit into the XML world with least breakage, and least problem. NOW, that's not sayin that the existinting method: <A HREF="<?ztml var arg?>">Go here.</A> Will no longer work, it's just not the option you should use for maximum behavioural correctness. :-) Perhaps it can be deprecated at some point in the future (Zope 2?)... Now having blathered on and on and on, let me state I'm not working for DC, I'm not that cool :-) I'm just playing with ideas, and trying to clean up some things that bug me personally... doesn't mean it will be officially blessed in the end. One final note, looking at the DTML parser (which may require some heavy changes for the the &ztml; trick, since currently I don't think it handles such things, just <> thingies :-) ... BUT there's some cruft left in there that uses the old %() form of DTML... is this something we can remove? I'm curious, I don't know how much ofit there is, but I'm wondering if there's really anyone USING it?! :-) I understand it might be more natural for Python people, but... I fear that with the new syntax I'm proposing <?ztml ...?> that it will be too many options, and some users heads might explode... something I personally don't want to recover. Just my ramblings for the evening! Chris -- | Christopher Petrilli | petrilli@amber.org
Perhaps this is retreading old territory, but if the goal is to have DTML that "looks like" XML, I would say either make it XML or don't. It seems like it would be too confusing to those of us familiar with XML to try to get used to a "almost-XML" syntax. Why not do something like: <zope:if condition="total_votes"> <p> <zope:in var="choices"> <zope:var expr="percent_for(_['sequence-index'])" fmt="%2d"/> </zope:in> <br/> </p> <zope:else> <em>No votes have been cast yet</em> </zope:if> That's XML which represents HTML (a la XSL-- note the <br/> -- XML doesn't have unclosed tags). The only thing that might not work above is inserting & or < , etc. in certain places (they would normally have to be & or <) Then, the DTML interpreter would just be an XML app (and not that complicated I would think). I know there are reasons things weren't done this way -- I'm curious to hear what they are. -Gabe
On Fri, Jan 29, 1999 at 09:30:42PM -0800, Gabe Wachob wrote:
Perhaps this is retreading old territory, but if the goal is to have DTML that "looks like" XML, I would say either make it XML or don't. It seems like it would be too confusing to those of us familiar with XML to try to get used to a "almost-XML" syntax.
Well, actually I've figured out a way to make it well-formed, and largely compliant without having to add in all the XSL parsing BS that isn't ready for prime time yet, in my opinion. Remember, the goal is to get 99% of the functionality for 1% of the effort... I'm lazy, and well, if you wanna write it, please feel free :-)
Why not do something like:
<zope:if condition="total_votes"> <p> <zope:in var="choices"> <zope:var expr="percent_for(_['sequence-index'])" fmt="%2d"/> </zope:in> <br/> </p> <zope:else> <em>No votes have been cast yet</em> </zope:if>
Well, that's because this is a LOT more than what people feel like writing most of the time... it also requires a TOTAL rewrite of the parse, which i ssomething I don't want to do. The currentl DTML parser, even with my hacks is substantially faster (in scientific handwaving sessions) than any XML parser I know... it doesn't do a lot of stuff, but that's fine, neither does DTML, which it's attempting to fix.
That's XML which represents HTML (a la XSL-- note the <br/> -- XML doesn't have unclosed tags). The only thing that might not work above is inserting & or < , etc. in certain places (they would normally have to be & or <)
Also this isn't familiar to 99.999% of the populace, not yet anyway. What I'm trying to accomplish, AGAIN, is to get partway there, as that's 1/100th the work. As it goes, put your code where your mouth is.
Then, the DTML interpreter would just be an XML app (and not that complicated I would think).
You underestimate ;-) The existing DTML PARSER is only... 1400 lines of code, INCLUDING a bunch of headers, so probably more like 1000 lines of code (until you get into the implementation of the commands themselves). This is something that I've talked a little with Paul about, and I'm sure it's a great direction to go in... in good time.
I know there are reasons things weren't done this way -- I'm curious to hear what they are.
The existing syntax was written for speed, and for ease of use by users... also it was written not to break anything. I've got the same basic goals + 1 new one... be reasonably editable in a normal HTML editor... not be fully compliant with Interleaf's SGML editor so that full DOM trees can be built. WE're just not THERE yet, maybe one day, and I'm sure everyone would be happy to SEE the code for it... but I have a gut feeling that it's a lot more handwaving than reality. Chris -- | Christopher Petrilli | petrilli@amber.org
"Christopher G. Petrilli" wrote:
One final note, looking at the DTML parser (which may require some heavy changes for the the &ztml; trick, since currently I don't think it handles such things, just <> thingies :-) ... BUT there's some cruft left in there that uses the old %() form of DTML... is this something we can remove? I'm curious, I don't know how much ofit there is, but I'm wondering if there's really anyone USING it?! :-)
I have found it very useful when generating DTML templates. It would be a real pain to generate them using DTML itself, as it terminally confuses me (and probably the parser as well So - having two syntaxes for the same thing is A Good Thing, please dont drop it.
I understand it might be more natural for Python people, but... I fear that with the new syntax I'm proposing <?ztml ...?> that it will be too many options, and some users heads might explode... something I personally don't want to recover.
Three syntaxes may be an overkill, but we can allways declare one of them deprecated and not recommend it ;) ------------ Hannu
I'm in way over my head here, not having encompassed XML. Thus, apologies in advance for any clueless content here. What I think we might do is declare a number of entities that are bound to the time-varying string representations of Python objects, and free us from the rather clumsy-appearing var syntax (sorry!). My first question is whether we can declare an entity in-line using XML or if it must be declared in the DTD. What I really want to do is something like <!ENTITY big_font SYSTEM "./big_font"> where "foo" is a property of the folder object, and then be able to say: <font name="&big_font"> and have that bound to the run-time string representation of the property. If you do a subsequent <?zope expr "big_font="LucidaTypewriterSoAndSo"> a subsequent reference to the entity &big_font should return the new value. So, does that <!ENTITY> tag have to be in the DTD, or may I declare them on the fly? Thanks Bruce -- The $70 Billion US "budget surplus" hardly offsets our $5 Trillion national debt. The debt increased by $133 Billion in the same year we found a "surplus". More debt is predicted for 1999. See www.concordcoalition.org . Bruce Perens K6BP bruce@pixar.com 510-620-3502 NCI-1001
To correct some garble in my last message:
where "foo" is a property of the folder object, and then be able to say:
Should say
where "big_font" is a property of the folder object, and then be able to say: -- The $70 Billion US "budget surplus" hardly offsets our $5 Trillion national debt. The debt increased by $133 Billion in the same year we found a "surplus". More debt is predicted for 1999. See www.concordcoalition.org . Bruce Perens K6BP bruce@pixar.com 510-620-3502 NCI-1001
"Fred L. Drake" wrote:
Paul Everitt writes:
<font size="<!--#var font_size-->">
which is legal, would become:
This is legal: The "<!--#var font_size-->" is the CDATA value of the size attribute, not a comment.
That is legal SGML but not XML.
<font size="<?ztml #var arg ?>">
which *not* valid XML...is it? That is, can you have markup inside
The "<?ztml #var arg ?>" is a perfectly valid string value of the size attribute, just as before.
Ditto.
In neither SGML nor XML can markup be nested like this. The use of entities is the proper way to do this in either case. Perhaps a processing tool needs to be available which can perform "entity expansion" for specified entity names only?
In a valid XML document, all entities must be defined in the DTD. XML does not provide for them to be supplied by the containing application. SGML did, but XML does not. The usual way to do this is with elements, as described in XSL. Paul Prescod - ISOGEN Consulting Engineer speaking for only himself http://itrc.uwaterloo.ca/~papresco Don't you know that the smart bombs are so clever, they only kill bad people." - http://www.boingo.com/lyrics/WarAgain.html
* Paul Everitt | | <font size="<!--#var font_size-->"> | [...] | <font size="<?ztml #var arg ?>"> | | which *not* valid XML...is it? Neither of these are well-formed XML, since '<'s are not allowed in attribute values. The spec is less clear than it ought to be on this[1], perhaps, but xmlproc, XP, Lark and the Sun XML parser are all in agreement that this isn't allowed. AElfred allows it, but then some checks have been left out of AElfred, ostensibly for class file size reasons. | That is, can you have markup inside markup? No. Even if you write <font size="<?ztml #var arg ?>"> the PI in the attribute won't be recognized as one. However, not knowing Zope I don't think this is fatal if Zope substitutes this before any XML/HTML parsers see the result. If you're trying to use XML/HTML/SGML syntax for a preprocessor then maybe that isn't the way to go. * Andrew M. Kuchling | | I don't believe so, but have CC'ed this to the XML-SIG where the | real experts hang out. PIs have to be outside other markup; I | suspect the XML way of handling your second case would be to define | an entity: | | <font size="&arg;"> This is right, yes. --Lars M. [1] The relevant part is a WFC to production 41 in section 3.1.
On Fri, Jan 29, 1999 at 05:01:23PM +0100, Lars Marius Garshol wrote:
However, not knowing Zope I don't think this is fatal if Zope substitutes this before any XML/HTML parsers see the result. If you're trying to use XML/HTML/SGML syntax for a preprocessor then maybe that isn't the way to go.
Currently, and I can't speak for the future of this, but currently, Zope is designed to parse DTML (the current syntax, using comments) into pure raw HTML, and nothing else... it's not intended to go to XML/SGML, and quite honestly, I don't think it would be a good fit for that. What it is, quite honestly, is a tiny little scripting ability (like PHP), not a full blown mark-up language. I believe PHP also uses <?php ?> as it's syntax, and I've not seen any huge explosions of fire from that one. Chris -- | Christopher Petrilli | petrilli@amber.org
On Fri, Jan 29, 1999 at 09:21:10AM -0500, Paul Everitt wrote:
Chris wrote:
<?ztml #var arg ?>
Ahh, tis nuthin better than seeing a patch accompany a proposal :^)
One tries to be productive, no matter how boring the tweek :-)
Here's my main beef with this. The ostensible goal of the XML syntax is to make it parse-able by new tools. Unfortunately, a valid use of the current syntax:
<font size="<!--#var font_size-->">
which is legal, would become:
<font size="<?ztml #var arg ?>">
which *not* valid XML...is it? That is, can you have markup inside markup?
Well, my quick re-read of the XML spec is unclear in regards to the exact tag in question... It's most certainly NOT acceptable to put other tags inside say regular paired tag (start/end tag) or a standalone tag, but a PI tag is not really discussed, and it does have special dispensation according to the document, in that it is one of the few tags in which the < and & caharacters don't have to be escaped. It's clearly meant for what I've used it for... Now, whether XML parsers interpret this the same way, I don't know... BTW, the W3C really needs to NOT use hideously ugly backgrounds behind their standards... it's nearlyt impossible to read the XML standard online from the horrendous background pattern. Chris -- | Christopher Petrilli | petrilli@amber.org
participants (10)
-
Amos Latteier -
Andrew M. Kuchling -
bruce@pixar.com -
Christopher G. Petrilli -
Fred L. Drake -
Gabe Wachob -
Hannu Krosing -
Lars Marius Garshol -
Paul Everitt -
Paul Prescod