[Date Index][Thread Index]
[Date Prev][Date Next][Thread Prev][Thread Next]

Re: Questions about wml

Hello Alvise Belotti, in a previous mail you wrote:

> I'm a absolute beginner with this toolkit and I'm definitively not a
> programmer at all.;-)
> But I'm actively learning ;-)

No problem, but perhaps expect some non-trivial problems of understanding when
you want to use WML in depth later. Because a lot of stuff is of

> Ok, my questions
> 1) wml::std:page appear not to include the <!DOCTYPE....> statement;
> is my impression correct? - If yes, is this a bug or a feature?

Correct. This was intended by me. Why? Hmmm... not easy to explain, but I try
it: The <!DOCTYPE> is a SGML feature specifing which particular Document Type
Description (DTD) should be used to parse the document itself. In SGML land
this is fine, because there the parsers are real SGML parsers which strictly
parse according to this DTD. So, when you say there that you are using XYZ V2
then this really means that the document is only accepted by the SGML parser
when it really conforms to XYZ V2. If not, your document is bad.

Now have a look at HTML land. Ok, while in the meantime HTML has a real
corresponding SGML DTD, the browsers parser are not strict SGML parsers. They
are fare away from a strict parser. So, the <!DOCTYPE> is practically useless
on the web, because

 1. When your document says its type is XYZ V.N and it is not 100% of this
    type your document is broken and would the browsers parsers 100% correct
    they would refuse it to render completely.

 2. When your document says its type is XYZ V.N and the browser
    (perhaps Lynx) only understands XYZ V.(N-1) your document
    theoretically should be refused too. But it isn't because
    the browsers parsers are not strict SGML parsers. 

So, whenever you are 100% sure your page is compliant to XYZ V.N, ok, then use
the <!DOCTYPE> tag for fun, even when you know that no browser is interested
in it. But when you are not 100% sure (which is 99% if the time on the web
because of proprietary tags, etc.) you should avoid to declare you are XYZ
V.N, because you aren't.

As a practical implication of this problem I and most other page writers
decided to completely avoid the <!DOCTYPE> because on the web it is de-facto

> 2) I like have the tags all in uppercase (i.e. <FOO></FOO>), but  I
> use elvis (a vi clone) and switching to uppercase is very annoying; is a
> bad idea to fix it in pass 7 ? (perhaps this is possible yet, but I'
> don't know how)

See wml::std::case(3). In short: Just add the line

  #use wml::std::case global=upper

to the top of your WML source file and all your tags are automatically
translated to upper case.

> 3) If I know well, in wml::des::navbar I can use <navbar
> imgstar=std:sel:ovr ...> then <nb_button img=foo-*.gif...> and
> the resulting tags are:<nb_button img=foo-std.gif..>, <nb_button
> img=foo-sel.gif..>, u.s.w., whith the asterisk substituded by the string
> in imgstar option.

Not exactly. The result is not three <nb_button> tags, the result is one tag

   <nb_button img="foo-std.gif:foo-sel.gif:foo-ovr.gif" ...>

The imgstar attribute is a shorthand to avoid those ugly reading img= tags.

>  ok, now i'm building a web site in three languages and I'm using a
>  lot of statements of wml::std::lang and wml::std::href; I'm writing
>  something like this:
>  <href="\
>  url="<it: index1.it.html>"\
>  "<en: index1.en.html>"\
>  "<es: index1.es.html>
>  ">
>  u.s.w.

Are you sure about your syntax? Because the above is incorrect syntax. 
I thing what you really mean is

   <href url="\
   <it: index1.it.html>\
   <en: index1.en.html>\
   <es: index1.es.html>\

>  I'd love a tag like <langstar=it:en:es> and then
>  <href="\
>  url="<it: index1.*.html>"\
>  "<en: index1.*.html>"\
>  "<es: index1.*.html>
>  ">
> Is this possible yet? Or maybe in the future?

Oh, I see the point. Good idea. But what you really want is this, isn't it?:
   <href url="<lang:star: index1.*.html>">

This should be no problem. Here it is:

    <define-tag lang:star:>
    <set-var __i=0>\
    <while <get-var __languages[__i]>>\
        "[LANG_<upcase <get-var __languages[__i]>>:%attributes:]"
        "\\*" "<get-var __languages[__i]>">\
    <increment __i>\

Because I find it cool and useful enough, I've added it to wml::std::lang for
WML 1.6.0 now. Thanks for the idea. I thing at least Fritz Zaucker likes this
new tag because he uses exactly such a <href ...> on his multi-lingual pages

> Last question: I could write to the ML, and read it on the web, but no
> mail reach my e-mail box;
> is this the right working mode of the ML?

As I can see in Majordomo's logfile you have send just the inital subscription
mail, but not replied to Majordomos reply asking you to confirm this
subscription. Look in your mail receive folder. Majordomo said what
confirmation you should send back or try again from the beginning.

                                       Ralf S. Engelschall
Website META Language (WML)                www.engelschall.com/sw/wml/
Official Support Mailing List                   sw-wml@engelschall.com
Automated List Manager                       majordomo@engelschall.com