You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@ofbiz.apache.org by "Harmeet Bedi (JIRA)" <ji...@apache.org> on 2009/06/22 04:32:07 UTC

[jira] Created: (OFBIZ-2644)
syntax is incorrect

<div/> syntax is incorrect
--------------------------

                 Key: OFBIZ-2644
                 URL: https://issues.apache.org/jira/browse/OFBIZ-2644
             Project: OFBiz
          Issue Type: Bug
            Reporter: Harmeet Bedi
            Priority: Trivial
             Fix For: SVN trunk


use to be widespread earlier found this only in one spot in trunk. Attaching patch.
<div some-attribute="some-value"/> is incorrect syntax
but 
<div some-attribute="some-value"></div> is right


-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (OFBIZ-2644)
syntax is incorrect

Posted by "Joe Eckard (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/OFBIZ-2644?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12722678#action_12722678 ] 

Joe Eckard commented on OFBIZ-2644:
-----------------------------------

The following is considered valid XHTML according to: http://validator.w3.org/

{code:xml}
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
        <title>Test</title>
    </head>
    <body>
        <div id="banner" />
    </body>
</html>
{code}

> <div/> syntax is incorrect
> --------------------------
>
>                 Key: OFBIZ-2644
>                 URL: https://issues.apache.org/jira/browse/OFBIZ-2644
>             Project: OFBiz
>          Issue Type: Bug
>            Reporter: Harmeet Bedi
>            Priority: Trivial
>             Fix For: SVN trunk
>
>         Attachments: EditCategoryFeatureCats.ftl.diff
>
>
> use to be widespread earlier found this only in one spot in trunk. Attaching patch.
> <div some-attribute="some-value"/> is incorrect syntax
> but 
> <div some-attribute="some-value"></div> is right

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Closed: (OFBIZ-2644)
syntax is incorrect

Posted by "Scott Gray (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/OFBIZ-2644?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Scott Gray closed OFBIZ-2644.
-----------------------------

       Resolution: Fixed
    Fix Version/s: Release Branch 9.04

Thanks for reporting Harmeet, fixed in trunk r791038 and v9.04 r791039

I also checked v4 but the bug wasn't there

> <div/> syntax is incorrect
> --------------------------
>
>                 Key: OFBIZ-2644
>                 URL: https://issues.apache.org/jira/browse/OFBIZ-2644
>             Project: OFBiz
>          Issue Type: Bug
>            Reporter: Harmeet Bedi
>            Assignee: Scott Gray
>            Priority: Trivial
>             Fix For: Release Branch 9.04, SVN trunk
>
>         Attachments: EditCategoryFeatureCats.ftl.diff
>
>
> use to be widespread earlier found this only in one spot in trunk. Attaching patch.
> <div some-attribute="some-value"/> is incorrect syntax
> but 
> <div some-attribute="some-value"></div> is right

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Updated: (OFBIZ-2644)
syntax is incorrect

Posted by "Harmeet Bedi (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/OFBIZ-2644?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Harmeet Bedi updated OFBIZ-2644:
--------------------------------

    Attachment: EditCategoryFeatureCats.ftl.diff

> <div/> syntax is incorrect
> --------------------------
>
>                 Key: OFBIZ-2644
>                 URL: https://issues.apache.org/jira/browse/OFBIZ-2644
>             Project: OFBiz
>          Issue Type: Bug
>            Reporter: Harmeet Bedi
>            Priority: Trivial
>             Fix For: SVN trunk
>
>         Attachments: EditCategoryFeatureCats.ftl.diff
>
>
> use to be widespread earlier found this only in one spot in trunk. Attaching patch.
> <div some-attribute="some-value"/> is incorrect syntax
> but 
> <div some-attribute="some-value"></div> is right

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Issue Comment Edited: (OFBIZ-2644)
syntax is incorrect

Posted by "Scott Gray (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/OFBIZ-2644?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12722828#action_12722828 ] 

Scott Gray edited comment on OFBIZ-2644 at 6/22/09 2:25 PM:
------------------------------------------------------------

*edit: should even -> shouldn't even

Perhaps it's the actual invalid html that is causing the problem:
{code}
-                    <td><div <#if hasntStarted><div style="color: red;"/></#if>${(productFeatureCatGrpAppl.fromDate)?if_exists}</div></td>
+                    <td><div <#if hasntStarted><div style="color: red;"> </div></#if>${(productFeatureCatGrpAppl.fromDate)?if_exists}</div></td>
{code}
will generate a div with a missing '>'
{code}
<td><div <div style="color: red;"/>${(productFeatureCatGrpAppl.fromDate)?if_exists}</div></td>
{code}
regardless of whether or not <div/> is valid or not, doesn't the div want to wrap the from date text so that it can color it red?  My guess is that there should even be an inner div and the outer one should have the style applied to it, I think that's why there is no closing '>' and also why the first div has a space after it.

      was (Author: lektran):
    Perhaps it's the actual invalid html that is causing the problem:
{code}
-                    <td><div <#if hasntStarted><div style="color: red;"/></#if>${(productFeatureCatGrpAppl.fromDate)?if_exists}</div></td>
+                    <td><div <#if hasntStarted><div style="color: red;"> </div></#if>${(productFeatureCatGrpAppl.fromDate)?if_exists}</div></td>
{code}
will generate a div with a missing '>'
{code}
<td><div <div style="color: red;"/>${(productFeatureCatGrpAppl.fromDate)?if_exists}</div></td>
{code}
regardless of whether or not <div/> is valid or not, doesn't the div want to wrap the from date text so that it can color it red?  My guess is that there should even be an inner div and the outer one should have the style applied to it, I think that's why there is no closing '>' and also why the first div has a space after it.
  
> <div/> syntax is incorrect
> --------------------------
>
>                 Key: OFBIZ-2644
>                 URL: https://issues.apache.org/jira/browse/OFBIZ-2644
>             Project: OFBiz
>          Issue Type: Bug
>            Reporter: Harmeet Bedi
>            Priority: Trivial
>             Fix For: SVN trunk
>
>         Attachments: EditCategoryFeatureCats.ftl.diff
>
>
> use to be widespread earlier found this only in one spot in trunk. Attaching patch.
> <div some-attribute="some-value"/> is incorrect syntax
> but 
> <div some-attribute="some-value"></div> is right

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (OFBIZ-2644)
syntax is incorrect

Posted by "Joe Eckard (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/OFBIZ-2644?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12723094#action_12723094 ] 

Joe Eckard commented on OFBIZ-2644:
-----------------------------------

+1 for Scott's comment, I didn't look at the patch before I commented - the problem there is just plain malformed html.

After checking the DTD, <div /> does not appear to be valid, since the div element it is not declared as EMPTY. I'm not sure why it was passed by the validator.

http://www.w3.org/TR/xhtml1/#h-4.3

> <div/> syntax is incorrect
> --------------------------
>
>                 Key: OFBIZ-2644
>                 URL: https://issues.apache.org/jira/browse/OFBIZ-2644
>             Project: OFBiz
>          Issue Type: Bug
>            Reporter: Harmeet Bedi
>            Priority: Trivial
>             Fix For: SVN trunk
>
>         Attachments: EditCategoryFeatureCats.ftl.diff
>
>
> use to be widespread earlier found this only in one spot in trunk. Attaching patch.
> <div some-attribute="some-value"/> is incorrect syntax
> but 
> <div some-attribute="some-value"></div> is right

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (OFBIZ-2644)
syntax is incorrect

Posted by "Jacques Le Roux (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/OFBIZ-2644?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12722521#action_12722521 ] 

Jacques Le Roux commented on OFBIZ-2644:
----------------------------------------

Hi Harmeet,

I just did a quick review (no tests), do we really need to put a space before the 1st </div> ?

> <div/> syntax is incorrect
> --------------------------
>
>                 Key: OFBIZ-2644
>                 URL: https://issues.apache.org/jira/browse/OFBIZ-2644
>             Project: OFBiz
>          Issue Type: Bug
>            Reporter: Harmeet Bedi
>            Priority: Trivial
>             Fix For: SVN trunk
>
>         Attachments: EditCategoryFeatureCats.ftl.diff
>
>
> use to be widespread earlier found this only in one spot in trunk. Attaching patch.
> <div some-attribute="some-value"/> is incorrect syntax
> but 
> <div some-attribute="some-value"></div> is right

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (OFBIZ-2644)
syntax is incorrect

Posted by "Harmeet Bedi (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/OFBIZ-2644?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12722643#action_12722643 ] 

Harmeet Bedi commented on OFBIZ-2644:
-------------------------------------

<div some-attribute="some-value"></div> works well with safari.. so I think space is not supposed to be necessary and it does not give errors.
However i have seen dom getting confused with no space. So i would recommend having a space. My theory is that dom inside browsers converts <div some-attribute="some-value"></div> to incorrect <div some-attribute="some-value"/>.. if validation is done on second it fails. As safety practice i put space where self closing is potential issue.

> <div/> syntax is incorrect
> --------------------------
>
>                 Key: OFBIZ-2644
>                 URL: https://issues.apache.org/jira/browse/OFBIZ-2644
>             Project: OFBiz
>          Issue Type: Bug
>            Reporter: Harmeet Bedi
>            Priority: Trivial
>             Fix For: SVN trunk
>
>         Attachments: EditCategoryFeatureCats.ftl.diff
>
>
> use to be widespread earlier found this only in one spot in trunk. Attaching patch.
> <div some-attribute="some-value"/> is incorrect syntax
> but 
> <div some-attribute="some-value"></div> is right

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (OFBIZ-2644)
syntax is incorrect

Posted by "Ashish Nagar (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/OFBIZ-2644?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12722966#action_12722966 ] 

Ashish Nagar commented on OFBIZ-2644:
-------------------------------------

I did a test on this and found that using <div some-attribute="somevalue"></div> is correct than <div some-attribute="somevalue"/>

Here is how i found this, i created a div in two ways,
1) using <div id="test"></div>
2) using <div id="test"/>

Then i changed the innerHTML of this div through javascript function with some button as <input type="button" onclick="javascript:document.getElementById('test').innerHTML='Some text'">

I found that in first way, the innerHTML of the first div changed correctly, but in second way whole page content followed by the div lost and only 'Some text' is shown.

Thanks & Regards,
--
Ashish Nagar

> <div/> syntax is incorrect
> --------------------------
>
>                 Key: OFBIZ-2644
>                 URL: https://issues.apache.org/jira/browse/OFBIZ-2644
>             Project: OFBiz
>          Issue Type: Bug
>            Reporter: Harmeet Bedi
>            Priority: Trivial
>             Fix For: SVN trunk
>
>         Attachments: EditCategoryFeatureCats.ftl.diff
>
>
> use to be widespread earlier found this only in one spot in trunk. Attaching patch.
> <div some-attribute="some-value"/> is incorrect syntax
> but 
> <div some-attribute="some-value"></div> is right

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Assigned: (OFBIZ-2644)
syntax is incorrect

Posted by "Scott Gray (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/OFBIZ-2644?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Scott Gray reassigned OFBIZ-2644:
---------------------------------

    Assignee: Scott Gray

> <div/> syntax is incorrect
> --------------------------
>
>                 Key: OFBIZ-2644
>                 URL: https://issues.apache.org/jira/browse/OFBIZ-2644
>             Project: OFBiz
>          Issue Type: Bug
>            Reporter: Harmeet Bedi
>            Assignee: Scott Gray
>            Priority: Trivial
>             Fix For: SVN trunk
>
>         Attachments: EditCategoryFeatureCats.ftl.diff
>
>
> use to be widespread earlier found this only in one spot in trunk. Attaching patch.
> <div some-attribute="some-value"/> is incorrect syntax
> but 
> <div some-attribute="some-value"></div> is right

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (OFBIZ-2644)
syntax is incorrect

Posted by "Raj Saini (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/OFBIZ-2644?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12722670#action_12722670 ] 

Raj Saini commented on OFBIZ-2644:
----------------------------------

Hi Harmeet,

Why do you think <div some-attribute="some-value"/>  is incorrect? As far as I know this is correct XML.  Any elements XML element not having sub-elements can be closed like this. For example this is the case for <p/> and  <br/>. 


> <div/> syntax is incorrect
> --------------------------
>
>                 Key: OFBIZ-2644
>                 URL: https://issues.apache.org/jira/browse/OFBIZ-2644
>             Project: OFBiz
>          Issue Type: Bug
>            Reporter: Harmeet Bedi
>            Priority: Trivial
>             Fix For: SVN trunk
>
>         Attachments: EditCategoryFeatureCats.ftl.diff
>
>
> use to be widespread earlier found this only in one spot in trunk. Attaching patch.
> <div some-attribute="some-value"/> is incorrect syntax
> but 
> <div some-attribute="some-value"></div> is right

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (OFBIZ-2644)
syntax is incorrect

Posted by "Scott Gray (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/OFBIZ-2644?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12722828#action_12722828 ] 

Scott Gray commented on OFBIZ-2644:
-----------------------------------

Perhaps it's the actual invalid html that is causing the problem:
{code}
-                    <td><div <#if hasntStarted><div style="color: red;"/></#if>${(productFeatureCatGrpAppl.fromDate)?if_exists}</div></td>
+                    <td><div <#if hasntStarted><div style="color: red;"> </div></#if>${(productFeatureCatGrpAppl.fromDate)?if_exists}</div></td>
{code}
will generate a div with a missing '>'
{code}
<td><div <div style="color: red;"/>${(productFeatureCatGrpAppl.fromDate)?if_exists}</div></td>
{code}
regardless of whether or not <div/> is valid or not, doesn't the div want to wrap the from date text so that it can color it red?  My guess is that there should even be an inner div and the outer one should have the style applied to it, I think that's why there is no closing '>' and also why the first div has a space after it.

> <div/> syntax is incorrect
> --------------------------
>
>                 Key: OFBIZ-2644
>                 URL: https://issues.apache.org/jira/browse/OFBIZ-2644
>             Project: OFBiz
>          Issue Type: Bug
>            Reporter: Harmeet Bedi
>            Priority: Trivial
>             Fix For: SVN trunk
>
>         Attachments: EditCategoryFeatureCats.ftl.diff
>
>
> use to be widespread earlier found this only in one spot in trunk. Attaching patch.
> <div some-attribute="some-value"/> is incorrect syntax
> but 
> <div some-attribute="some-value"></div> is right

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (OFBIZ-2644)
syntax is incorrect

Posted by "Harmeet Bedi (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/OFBIZ-2644?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12722864#action_12722864 ] 

Harmeet Bedi commented on OFBIZ-2644:
-------------------------------------

FYI. Did a bit of looking around the web.
found the following comment at : http://www.westendweb.com/htmlbasics/basictags.htm
"""
Only two of the tags, <img /> and <br />, are self-closing (the slash which closes it comes at the end of a self-closing tag).
"""

As far as i know <div/> is incorrect. 
Safari flags it as an error but not Firefox. Sadly(haha) I don't have IE on my mac so can't tell what it does.

> <div/> syntax is incorrect
> --------------------------
>
>                 Key: OFBIZ-2644
>                 URL: https://issues.apache.org/jira/browse/OFBIZ-2644
>             Project: OFBiz
>          Issue Type: Bug
>            Reporter: Harmeet Bedi
>            Priority: Trivial
>             Fix For: SVN trunk
>
>         Attachments: EditCategoryFeatureCats.ftl.diff
>
>
> use to be widespread earlier found this only in one spot in trunk. Attaching patch.
> <div some-attribute="some-value"/> is incorrect syntax
> but 
> <div some-attribute="some-value"></div> is right

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.