Open Bug 69542 Opened 24 years ago Updated 2 years ago

standalone xul validator

Categories

(Core :: XUL, enhancement, P3)

enhancement

Tracking

()

Future

People

(Reporter: alecf, Unassigned)

Details

Attachments

(3 files)

I am writing a little perl script that uses the XML::Parse module to examine XUL
files and look for bad patterns.
Some things I've been thinking about:
- event handlers inside templates
- unlocalized text (i.e. <text value="<text>">

I'm looking for other suggestions, so I've cc'ed a few people who might have
good ideas..
Html-namespaced elements (but I don't think we have many of those anymore)?  

Needless tag complexity (<script src="..."></script> instead of <script 
src="..."/>)?

Invalid xml comment types (seems we don't complain about /* foo */, although 
that really should be the role of the xml parser)?

Just some thoughts.
(Hixie point out that /* foo */ is valid in xml, but just plain 
text...nevermind about that last point)
Hard coded style (at least as a warning). e.g.,
    <myelement value="foo" style="border:1px solid green;"/>
language="JavaScript" instead of type="text/javascript" ;-)

On top of html-namespaced elements, add unnecessary namespace declarations.
all great ideas! here is a bit of sample output from what I have so far:


./content/navigator/navigator.xul Line 220, Column 14: event handler oncommand=
inside of template, in <menuitem>
            </menupopup>
          </rule>
          <rule>
            <menupopup>
              <menuitem class="menuitem-iconic bookmarkitem" uri="rdf:*"
=============^
                        value="rdf:http://home.netscape.com/NC-rdf#Name"
                       
oncommand="OpenBookmarkURL(event.target,document.getElementById('BookmarksMenu').database)"
/>
            </menupopup>
           </rule>

./content/navigator/navigator.xul Line 236, Column 6: inline style in element
<box>
      <box id="innermostBox" flex="1" style="min-width: 1px;"
context="contextual"
=====^

Status: NEW → ASSIGNED
Priority: -- → P3
Target Milestone: --- → mozilla0.9
Attached file dtduse.pl
Attached file xulval.pl
erm, these are two tools i use for other stuff. output should have grepable 
strings for deprecated, warning, error, ...
Why re-invent the wheel? Do you have a DTD for XUL? Then......
no dtd for xul is forthcoming. a validator would happen years sooner.
Ok, then I need to make one myself, based on the fourth draft of the XUL PRM. I
only can check if a XUL document is wellformed and that's not what I need.

I want to integrate a XUL DTD into my XUL Generator, so I can auto-validate
while I'm writing XUL documents (a la HomeSite).
it should be noted that someone recently mentioned that the w3 was likely to 
abandon dtd's in favor of schemas (i think the conclusion was that XML dtd's 
are useless). however this is only my understanding, i could be wrong.
Target Milestone: mozilla0.9 → mozilla1.0
We'll gladly add it to Komodo to do background syntax checking of XUL documents. 

One feature request -- put both beginning and end column numbers in your output, 
to make it easier to determine what bits of text to underline.

On the topic of schemas, in the absence of DTDs we have developed our 'own' 
schema-like system for XSL linting.  We could do something like that for XUL 
support as well.  DTDs or official schemas would be better, but i'm not holding 
my breath.  If you want more details, let me know.
nav triage team:

Cool beans, but not a ns ship stopper, for sure. marking nsbeta1- to get off
triage radar
Keywords: nsbeta1-
Bugs targeted at mozilla1.0 without the mozilla1.0 keyword moved to mozilla1.0.1 
(you can query for this string to delete spam or retrieve the list of bugs I've 
moved)
Target Milestone: mozilla1.0 → mozilla1.0.1
Component: XP Utilities → XP Toolkit/Widgets: XUL
Now that the release notes say that the "last of the XUL 1.0 syntax changes have
landed", would it be realistic to create an XUL 1.0 DTD?  
OS: Linux → All
Hardware: PC → All
Target Milestone: mozilla1.0.1 → Future
Renaming for clarity. Also, assignee, how bitrotten are the attachments? Do you intend to continue work on a validator?
Severity: normal → enhancement
Summary: xul validator → standalone xul validator
Component: XP Toolkit/Widgets: XUL → XUL
QA Contact: scc → xptoolkit.widgets

The bug assignee is inactive on Bugzilla, so the assignee is being reset.

Assignee: alecf → nobody
Status: ASSIGNED → NEW
Severity: normal → S3
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: