Optional new-style syntax for WebCatalog 4.0

This WebDNA talk-list message is from

2000


It keeps the original formatting.
numero = 31072
interpreted = N
texte = To give everyone a head-start on playing with the new-style syntax, here's a primer. We are calling it XML syntax only because it's not HTML, and it tends to follow the guidelines of XML, and it looks a lot like XML. It's basically just the type of syntax that most graphical editors like DreamWeaver tend to expect, and *not* chew up like the original [classic] syntax. I still prefer classic syntax, because I think it's easier to pick pick out of a bunch of HTML, and it's a bit tighter.The general rule is to substitute [ with , and use named quoted-value pairs instead of ampersand-delimited pairs. No, we haven't forgotten the comment about the shifted underscore; just still trying to work out what's best to do (maybe a dash instead?) You can see new syntax in the included TeaRoomXML example, which has been ported to XML syntax. So the following classic syntax: [loop start=1&end=10] [index] [/loop]becomes All parameters *must* be named, and *must* be quoted, even if they are numeric or have no spaces in them (this is also a rule of XML). At some point we may even go so far as to require lowercase tag and parameter names, as XML does, in order to help out with future XML editors.Certain contexts such as [ShowIf] are required to have a named parameter, so they become:...You can't get away with unnamed parameters for [include] either:Again, all of these named things may look funny when you type them out, but they help products like DreamWeaver immensely.In order to make it easier for you to port sites one-page-at-a-time, we have gone to great lengths to let you intermix the syntax. [include], for instance, automatically assumes the file you're including will be the same syntax as the template you're including *from*. means classic syntax for this whole page means XML syntax for this whole page[include file=fred.inc] will parse fred.inc using classic syntax [include file=fred.inc&xmlSyntax=T] will parse fred.inc using XML syntax will parse fred.inc using XML syntax will parse fred.inc using classic syntaxIt was really hard to implement this. You're welcome.Be careful with quotes! It's easy to forget and write something like[include file=fred.inc] <-- those quotes are literal in classic syntaxEmbedded quotes need to be escaped, also to help with DreamWeaver parsers:>The idea here is that expr=...a bunch of stuff... must know when it's hit the ending quote. So any embedded quotes you put inside have to be preceded by \, just like you do in JavaScript.Arrays: the old trick of using [interpert][array[index]][/interpret] still works in XML syntax, but we had to do some fancy footwork to recognize it. Now that we know when it's happening, we might decide to do the interpret for you. Anyway the syntax looks like this:>Undefined variables: classic syntax still treats undefined [x] as literally [x], in order to handle the case where you're just typing some plain text on a page that happens to have brackets around it. We of course did this because we have no way of knowing when you mean literal text and when you mean WebDNA variables. But under XML syntax, we know for certain that you're trying to get at a variable, because there's no ambiguity about being a WebDNA construct. So in that case we output undefined in its place. We are planning to add a preference that lets you set this to blank or undefined or whatever else you want.Hope that gets you started!Grant Hulbert, Director of Engineering ********************************** Smith Micro, Internet Solutions Div | eCommerce (WebCatalog) 16855 West Bernardo Drive, #380 | ------------------------- San Diego, CA 92127 | Software & Site Development Main Line: (858) 675-1106 | http://www.smithmicro.com Fax: (858) 675-0372 **********************************############################################################# This message is sent to you because you are subscribed to the mailing list . To unsubscribe, E-mail to: To switch to the DIGEST mode, E-mail to To switch to the INDEX mode, E-mail to Send administrative queries to Associated Messages, from the most recent to the oldest:

    
  1. Re: Optional new-style syntax for WebCatalog 4.0 (Thomas Wedderburn-Bisshop 2000)
  2. Optional new-style syntax for WebCatalog 4.0 (Grant Hulbert 2000)
To give everyone a head-start on playing with the new-style syntax, here's a primer. We are calling it XML syntax only because it's not HTML, and it tends to follow the guidelines of XML, and it looks a lot like XML. It's basically just the type of syntax that most graphical editors like DreamWeaver tend to expect, and *not* chew up like the original [classic] syntax. I still prefer classic syntax, because I think it's easier to pick pick out of a bunch of HTML, and it's a bit tighter.The general rule is to substitute [ with , and use named quoted-value pairs instead of ampersand-delimited pairs. No, we haven't forgotten the comment about the shifted underscore; just still trying to work out what's best to do (maybe a dash instead?) You can see new syntax in the included TeaRoomXML example, which has been ported to XML syntax. So the following classic syntax: [loop start=1&end=10] [index] [/loop]becomes All parameters *must* be named, and *must* be quoted, even if they are numeric or have no spaces in them (this is also a rule of XML). At some point we may even go so far as to require lowercase tag and parameter names, as XML does, in order to help out with future XML editors.Certain contexts such as [showif] are required to have a named parameter, so they become:...You can't get away with unnamed parameters for [include] either:Again, all of these named things may look funny when you type them out, but they help products like DreamWeaver immensely.In order to make it easier for you to port sites one-page-at-a-time, we have gone to great lengths to let you intermix the syntax. [include], for instance, automatically assumes the file you're including will be the same syntax as the template you're including *from*. means classic syntax for this whole page means XML syntax for this whole page[include file=fred.inc] will parse fred.inc using classic syntax [include file=fred.inc&xmlSyntax=T] will parse fred.inc using XML syntax will parse fred.inc using XML syntax will parse fred.inc using classic syntaxIt was really hard to implement this. You're welcome.Be careful with quotes! It's easy to forget and write something like[include file=fred.inc] <-- those quotes are literal in classic syntaxEmbedded quotes need to be escaped, also to help with DreamWeaver parsers:>The idea here is that expr=...a bunch of stuff... must know when it's hit the ending quote. So any embedded quotes you put inside have to be preceded by \, just like you do in JavaScript.Arrays: the old trick of using [interpert][array[index]][/interpret] still works in XML syntax, but we had to do some fancy footwork to recognize it. Now that we know when it's happening, we might decide to do the interpret for you. Anyway the syntax looks like this:>Undefined variables: classic syntax still treats undefined [x] as literally [x], in order to handle the case where you're just typing some plain text on a page that happens to have brackets around it. We of course did this because we have no way of knowing when you mean literal text and when you mean WebDNA variables. But under XML syntax, we know for certain that you're trying to get at a variable, because there's no ambiguity about being a WebDNA construct. So in that case we output undefined in its place. We are planning to add a preference that lets you set this to blank or undefined or whatever else you want.Hope that gets you started!Grant Hulbert, Director of Engineering ********************************** Smith Micro, Internet Solutions Div | eCommerce (WebCatalog) 16855 West Bernardo Drive, #380 | ------------------------- San Diego, CA 92127 | Software & Site Development Main Line: (858) 675-1106 | http://www.smithmicro.com Fax: (858) 675-0372 **********************************############################################################# This message is sent to you because you are subscribed to the mailing list . To unsubscribe, E-mail to: To switch to the DIGEST mode, E-mail to To switch to the INDEX mode, E-mail to Send administrative queries to Grant Hulbert

DOWNLOAD WEBDNA NOW!

Top Articles:

Talk List

The WebDNA community talk-list is the best place to get some help: several hundred extremely proficient programmers with an excellent knowledge of WebDNA and an excellent spirit will deliver all the tips and tricks you can imagine...

Related Readings:

More on the email templates (1997) WebCat2final1 crashes (1997) Major Security Hole IIS NT (1998) [OT] Australian Dial-Up Access (2006) Help with Shipping Costs (1997) MacWEEK article help needed (1996) Why won't this work (2005) Lookup Notfound (1998) Which GUI HTML editors work with WC ? (1997) [WebDNA] Sorry, WebCatalog server not running. (2008) IE Cache Problems... (1999) Bug or syntax error on my part? (1997) SQL Connections (2004) Separate SSL Server (1997) How flexible is Shipping? (1997) Record size (1998) WC2b15 - [HTMLx]...[/HTMLx] problems (1997) WebCatalog memory error. (1998) Multiple prices (1997) Laying an egg. (1998)