14
wanikoo
Re: Let's make XOOPS valid xhtml1.0 transitional!
  • 2005/4/5 10:44

  • wanikoo

  • Not too shy to talk

  • Posts: 129

  • Since: 2003/12/27


--------------------------
pages with id="xxxx[]"
-------------------------
Umm...
Pages with id="xxxx[]" always gives us some error messages when validation check.
--error messages--
character "[" is not allowed in the value of attribute "id"
ID "xxxx[]" already defined
------------------

ex)/html/notifications.php

system_notification_list.html
line 13
<td class="head"><input name="del_mod[<{$module.id}>]" id="del_mod[]" onclick="xoopsCheckGroup('notificationlist', 'del_mod[<{$module.id}>]', 'del_not[<{$module.id}>][]');" type="checkbox" value="<{$module.id}>" /></td>
line 21
<td class="<{$class}>"><input type="checkbox" name="del_not[<{$module.id}>][]" id="del_not[<{$module.id}>][]" value="<{$notification.id}>" /></td>

Line 132, column 57: character "[" is not allowed in the value of attribute "id"

...><input name="del_mod[2]" id="del_mod[]" onclick="xoopsCheckGroup('notificati

character "[" is not allowed in the value of attribute "id"

Umm...
in this case( input ), attribute "id" is not mandatorily requested and we have another identifier, attribute "name".
so..
just remove id="del_mod[]" and id="del_not[<{$module.id}>][]"
(or if you don't want to remove attribute "id", you can keep it by changing its value like the case,viewpmsg.php mentioned before)
------------------------------
After this modification,
we can get this message, "This Page(ex: notifications.php) Is Valid XHTML 1.0 Transitional!" from W3 validator.

Quote:

Fromhttp://www.w3.org/TR/xhtml1/

4.10. The elements with 'id' and 'name' attributes
HTML 4 defined the name attribute for the elements a, applet, form, frame, iframe, img, and map. HTML 4 also introduced the id attribute. Both of these attributes are designed to be used as fragment identifiers.

In XML, fragment identifiers are of type ID, and there can only be a single attribute of type ID per element. Therefore, in XHTML 1.0 the id attribute is defined to be of type ID. In order to ensure that XHTML 1.0 documents are well-structured XML documents, XHTML 1.0 documents MUST use the id attribute when defining fragment identifiers on the elements listed above. See the HTML Compatibility Guidelines for information on ensuring such anchors are backward compatible when serving XHTML documents as media type text/html.

Note that in XHTML 1.0, the name attribute of these elements is formally deprecated, and will be removed in a subsequent version of XHTML.


C.8. Fragment Identifiers
In XML, URI-references [RFC2396] that end with fragment identifiers of the form "#foo" do not refer to elements with an attribute name="foo"; rather, they refer to elements with an attribute defined to be of type ID, e.g., the id attribute in HTML 4. Many existing HTML clients don't support the use of ID-type attributes in this way, so identical values may be supplied for both of these attributes to ensure maximum forward and backward compatibility (e.g., <a id="foo" name="foo">...</a>).

Further, since the set of legal values for attributes of type ID is much smaller than for those of type CDATA, the type of the name attribute has been changed to NMTOKEN. This attribute is constrained such that it can only have the same values as type ID, or as the Name production in XML 1.0 Section 2.3, production 5. Unfortunately, this constraint cannot be expressed in the XHTML 1.0 DTDs. Because of this change, care must be taken when converting existing HTML documents. The values of these attributes must be unique within the document, valid, and any references to these fragment identifiers (both internal and external) must be updated should the values be changed during conversion.

Note that the collection of legal values in XML 1.0 Section 2.3, production 5 is much larger than that permitted to be used in the ID and NAME types defined in HTML 4. When defining fragment identifiers to be backward-compatible, only strings matching the pattern [A-Za-z][A-Za-z0-9:_.-]* should be used. See Section 6.2 of [HTML4] for more information.

Finally, note that XHTML 1.0 has deprecated the name attribute of the a, applet, form, frame, iframe, img, and map elements, and it will be removed from XHTML in subsequent versions.

13
ideiafacil
Re: Let's make XOOPS valid xhtml1.0 transitional!

ohhhhhhhhhh
GREAT!!

Many Thanks Wanikoo

Please post more. Post in the traker and in this forum for reference and help the users.

As many modules (no core ) with invalid output.Really bad


Xoops 2.1 XHTML 1 Strict..


this I want to see
God in helps them to arrive there

12
giba
Re: Let's make XOOPS valid xhtml1.0 transitional!
  • 2005/4/4 23:39

  • giba

  • Just can't stay away

  • Posts: 638

  • Since: 2003/4/26


Quote:

Herko Coomans wrote:
Wanikoo: PLEASE PLEASE PLEASE ADD THESE TO THE CORE DEVELOPMENT PATCH TRACKERS ON SF.NET! We will not be able to fix all these if this isn't submitted to the trackers...

Herko


Wanikoo, thanks for instructions

Contact-Us me in www.xoops.net.br

I can correct this in XOOPS for we version.
Very good

Congratulations Wanikoo
look: Validar Xhtml by wanikoo (perfect)

11
gecko
Re: Let
  • 2005/4/4 22:40

  • gecko

  • Not too shy to talk

  • Posts: 152

  • Since: 2004/10/11


I agree lets aim for complete validation, strict.

10
wanikoo
Re: Let
  • 2005/4/4 20:45

  • wanikoo

  • Not too shy to talk

  • Posts: 129

  • Since: 2003/12/27


Quote:

submit them to the trackers, so we can deal with them

I did right now.
Umm..
btw..
this has just started..
and..
still going on ..
so..
just for reference

9
WarDick
Re: Let
  • 2005/4/4 20:11

  • WarDick

  • Just can't stay away

  • Posts: 890

  • Since: 2003/9/13


Wanikoo

Thank you for posting this valuable information here. It is very educational. As we all know the posting of information on the tracker is much like posting in a black hole. What goes in doesn't always come out.

You contributions are awesome. Thank You!

8
Herko
Re: Let's make XOOPS valid xhtml1.0 transitional!
  • 2005/4/4 20:03

  • Herko

  • XOOPS is my life!

  • Posts: 4238

  • Since: 2002/2/4 1


Wanikoo: PLEASE PLEASE PLEASE ADD THESE TO THE CORE DEVELOPMENT PATCH TRACKERS ON SF.NET! We will not be able to fix all these if this isn't submitted to the trackers...

Herko

7
wanikoo
Re: Let's make XOOPS valid xhtml1.0 transitional!
  • 2005/4/4 19:51

  • wanikoo

  • Not too shy to talk

  • Posts: 129

  • Since: 2003/12/27


-----------------------------------
pages with form class (ex: edituser.php)
--------------------------------

</td></tr><input type='hidden' name='uid' id='uid' value='1' /><tr><td>
or
</td></tr><tr><input type='hidden' name='uid' id='uid' value='1' /><td>
or
<table><input type='hidden' name='uid' id='uid' value='1' /><tr><td>
or
</td></tr><input type='hidden' name='uid' id='uid' value='1' /></table>

This kind of coding above always give us some error message like this....

document type does not allow element "input" here

The element named above was found in a context where it is not allowed. This could mean that you have incorrectly nested elements -- such as a "style" element in the "body" section instead of inside "head" -- or two elements that overlap (which is not allowed).

One common cause for this error is the use of XHTML syntax in HTML documents. Due to HTML's rules of implicitly closed elements, this error can create cascading

Refer to this page
http://www.w3.org/TR/2002/REC-xhtml1-20020801/DTD/xhtml1-transitional.dtd

So..
If we use form classes such as XoopsTableForm(tableform.php), XoopsThemeForm(themeform.php) with XoopsFormHidden(formhidden.php),
we can never get the message," "This Page Is Valid XHTML 1.0 Transitional!" from W3 validator.

ex)
tableform.php
function render()
    {
        
$ret $this->getTitle()."n<form name='".$this->getName()."' id='".$this->getName()."' action='".$this->getAction()."' method='".$this->getMethod()."'".$this->getExtra().">n<table border='0' width='100%'>n";
        foreach ( 
$this->getElements() as $ele ) {
            if ( !
$ele->isHidden() ) {
                
$ret .= "<tr valign='top' align='left'><td>".$ele->getCaption();
                if (
$ele->getDescription() != '') {
                    
$ret .= '<br /><br /><span style="font-weight: normal;">'.$ele->getDescription().'</span>';
                }
                
$ret .= "</td><td>".$ele->render()."</td></tr>";
            } else {
                
$ret .= $ele->render()."n";
            }
        }
        
$ret .= "</table>n</form>n";
        return 
$ret;
    }

if element is hidden,
it will be rendered like this!
$ret .= $ele->render()."\n";

formhidden.php
function render(){
        return 
"<input type='hidden' name='".$this->getName()."' id='".$this->getName()."' value='".$this->getValue()."' />";
    }


Umm...
I think there are some solutions for this problem..
At my first thought,
maybe...
the most simplest solution is to just remove if ( !$ele->isHidden() ) process like this below.
tableform.php
//if ( !$ele->isHidden() ) {
                
$ret .= "<tr valign='top' align='left'><td>".$ele->getCaption();
                if (
$ele->getDescription() != '') {
                    
$ret .= '<br /><br /><span style="font-weight: normal;">'.$ele->getDescription().'</span>';
                }
                
$ret .= "</td><td>".$ele->render()."</td></tr>";
            
//} else {
            //    $ret .= $ele->render()."n";
            //}

themeform.php
if (!is_object($ele)) {
                
$ret .= $ele;
            
//} elseif (!$ele->isHidden()) {
            
} else {
                
//if ($count % 2 == 0) {
                    
$class 'even';
                
//} else {
                //    $class = 'odd';
                //}
                
$ret .= "<tr valign='top' align='left'><td class='head'>".$ele->getCaption();
                if (
$ele->getDescription() != '') {
                    
$ret .= '<br /><br /><span style="font-weight: normal;">'.$ele->getDescription().'</span>';
                }
                
$ret .= "</td><td class='$class'>".$ele->render()."</td></tr>";
                
//$count++;
            //} else {
            //    $ret .= $ele->render();
            
}


------------------------------
After this modification,
(......although we use form classes.....)
we can get this message, "This Page(ex: edituser.php) Is Valid XHTML 1.0 Transitional!" from W3 validator.

--------To be continued--------------

6
wanikoo
Re: Let's make XOOPS valid xhtml1.0 transitional!
  • 2005/4/4 19:50

  • wanikoo

  • Not too shy to talk

  • Posts: 129

  • Since: 2003/12/27


-------------------------------------------
system_userinfo.html(userinfo.php)
------------------------------------------

document type does not allow element "h4" here; missing one of "object", "applet", "map", "iframe", "button", "ins", "del" start-tag

<h4>Downloads</h4>

The mentioned element is not allowed to appear in the context in which you've placed it; the other mentioned elements are the only ones that are both allowed there

From:
<!-- start module search results loop -->
<{foreach 
item=module from=$modules}>

<
p>
<
h4><{$module.name}></h4>

  <!-- 
start results item loop -->
  <{foreach 
item=result from=$module.results}>

  <
img src="<{$result.image}>" alt="<{$module.name}>" /><b><a href="<{$result.link}>"><{$result.title}></a></b><br /><small>(<{$result.time}>)</small><br />

  <{/foreach}>
  <!-- 
end results item loop -->

<{
$module.showall_link}>
</
p>

<{/foreach}>
<!-- 
end module search results loop -->

To:
<!-- start module search results loop -->
<{foreach 
item=module from=$modules}>

<
p></p>
<
h4><{$module.name}></h4>

  <!-- 
start results item loop -->
  <{foreach 
item=result from=$module.results}>

  <
img src="<{$result.image}>" alt="<{$module.name}>" /><b><a href="<{$result.link}>"><{$result.title}></a></b><br /><small>(<{$result.time}>)</small><br />

  <{/foreach}>
  <!-- 
end results item loop -->

<{
$module.showall_link}>
<
p></p>

<{/foreach}>
<!-- 
end module search results loop -->

or
instead of <p></p>, we can use other tags such as <br />...etc.

----------

After this modification,
we can get this message, "This Page(userinfo.php) Is Valid XHTML 1.0 Transitional!" from W3 validator.

5
Mithrandir
Re: Let's make XOOPS valid xhtml1.0 transitional!

Quote:
submit them to the trackers, so we can deal with them

Trackers are here

Login

Who's Online

148 user(s) are online (87 user(s) are browsing Support Forums)


Members: 0


Guests: 148


more...

Donat-O-Meter

Stats
Goal: $100.00
Due Date: May 31
Gross Amount: $0.00
Net Balance: $0.00
Left to go: $100.00
Make donations with PayPal!

Latest GitHub Commits