Index Thing

Index

Web Stuff (XHTML)



More Web App stuff

The macro facility in EWD can be used to provide XHTML validation in a similar manner to that described for FP at Michael Suodenjoki's site -
Here is a wee bit of a comparison between web editors I have used -

FrontPage 2003 Cost: Pricey

A good all round editor but quality of code handling could be a bit dire at times.

GREAT thing: Ability to re-factor hyperlinks between pages when renaming pages.
GOOD thing: Macro allowed use of pluginl XHTML validator tool to help things.
BAD thing: Avoid FP bots, etc to keep clean code.
BAD thing: XHTML 1.0 Strict validation/error checking average
BAD thing: Would alter code layout arbitrarily.

BEST feature: Hyperlink refactoring.

Expression Web Cost: Pricey

This improved on FP2003 hugely in the code handling department and was pretty good but I was finding that the DESIGN mode usefulness was diminishing especially when using tricky CSS.

GREAT thing: Still has hyperlink refactoring when pages renamed.
GOOD thing: Global Find & Replace.
GOOD thing: Still able to use XHTML validator macro.
GOOD thing: Doesn't mess up code layout.
BAD thing: Inserts BOM when page saved - no good for PHP.
BAD thing: DESIGN view of limited usefulness with exotic CSS - layout broken

BEST feature: Hyperlink refactoring.

Expression Web 2 Cost: Pricey c. £216

Moved onto Expression Web 2 but find it a disappointment. The DESIGN mode is further degraded since MS "corrected" the display relating to overflow attribute in CSS.
This can cause pages (or part of) not to display if 'overflow: auto;' is used. This seems ridiculous to me since the pages will display correctly in Mozilla/Opera, IE6 and 7. It seems that EW2 still uses the IE6 engine to render the DESIGN view and although there wasn’t a problem in EW1 the tweak has broken EW2. MS feels this corrects an issue but since the pages will display OK in IE6 itself it is now another minus against EW2. It is a shame that EW2 doesn’t render as per IE7 since IE7 is capable of using common CSS with Mozilla, etc.

GREAT thing: Still has hyperlink refactoring when pages renamed.
GOOD thing: Still able to use XHTML validator macro.
GOOD thing: Global Find and Replace.
GOOD thing: Doesn't mess up code layout.
GOOD thing: Can now omit BOM when page saved.
BAD thing: DESIGN view of limited usefulness with exotic CSS - layout broken even more with design tweak - still uses IE6 rendering engine.

BEST feature: Hyperlink refactoring.


Aptana Studio CE Cost: Free

Quite impressed with this app since it is free and the quick PREVIEW tabs are accurate.

GREAT thing: PREVIEW tabs for both IE6 and Mozilla(FF).
GOOD thing: XHTML validation works well but not perfect.
GOOD thing: Doesn't mess up code layout.
GOOD thing: Save without BOM possible.
BAD thing: No split CODE/DESIGN mode.
MAJOR BAD thing: Hyperlink refactoring not possible when pages renamed.
MAJOR BAD thing: HTML pages with Java applets on them can't be previewed -
FF PREVIEW tab: Aptana IDE will CRASH and BURN with a Java bridge problem
IE PREVIEW tab: Page will indicate that Java NOT INSTALLED.

BEST feature: PREVIEW tabs for both IE6 and Mozilla(FF). * plus FREE of course


WebBuilder 2008 Cost: Reasonable c. £35

GREAT thing: PREVIEW tabs for both IE6 and Mozilla(FF).
GOOD thing: XHTML validation works OK.
GOOD thing: Doesn't mess up code layout.
GOOD thing: Save without BOM possible.
GOOD thing: Split CODE/PREVIEW mode possible.
MAJOR BAD thing: Hyperlink refactoring not possible when pages renamed.

BEST feature: PREVIEW tabs for both IE6 and Mozilla(FF).


End result:

I tend to use Aptana for general editing simply because of the quick internal preview tabs and good validation.

The problem with the Java bridge error on pages with applets is a huge one and although I just avoid those pages if thay were to charge money for the app I would want it fixed. Some folk are blaming the Mozilla XUL engine but since the pages will work fine in all the later Mozilla and IE browsers and editors I think that Aptana is having a problem with starting Java from within the app!

I still use EW for hyperlink refactoring and for XHTML cross checking but really for the money EW 2 is losing its appeal unless you qualify for academic pricing.

WebBuilder 2008 looks good and has the great PREVIEW tabs for Mozilla and IE with an added advantage of split CODE/PREVIEW mode. It doesn't have any problems with applet pages but of course costs money compared with Aptana but not as much as EW.

And of course Notepad++ I find extremely useful for all my text editing which includes HTML/XHTML/CSS/JS as well.

Web Expression SuperPreview

Tried the Beta out and looks OK but not really a decent browser testing replacement.
The idea is to provide a Preview app for web pages that emulates the browsers (IE initially and others when app is introduced with EW 3).
Unfortunately for me unless it is available for free I probably won't bother since the emulation only provides a static DESIGN page snapshot view. Javascript or CSS hover will not run so I would still need the real browsers to fully test any dynamic pages (eg: my pages use a JS scrolling method and plenty of CSS hover stuff).
The page rendering is however very good and in my view the sort of result that the normal DESIGN view tab within the editor should provide. The functional preview provided by Aptana, WebBuilder or IETester is still far more useful for me.

IETester 0.3.1

This wee app allows browser emulation of all the modern IE versions from 5.5 onwards and works dynamically as per the real browsers. Mine was installed on XP SP3 with IE8 installed. I found that using the IE6 preview initially gave me a debug crash but seemed to work OK after IE8 and IE7 previews were used (some dependencies in there somewhere?). This is a proper browser PREVIEW as against WE SuperPreview which appears to be halfway between a WYSIWYG DESIGN view and a browser PREVIEW.




W3C Schema for HTMLPad 2006

How the intellisense seems to work-
A document is opened and the tag completion list uses the appropriate .ini file in the data\mldefs\ folder. The decision on which file to use is done on the Doctype in the page (if enabled in the options).
eg: If an XHTML 1.1 page is opened then the list will derive from \data\mldefs\XHTML 1.1.ini
If the Doctype is not checked then the list will be dependent on the language specifications selected in the options.

It is to be noted that HTMLPad has only an XHTML 1.0.ini file which bunches the Frameset/Transitional/Strict variations together.
This file also includes the Ruby tags which only appeared in the XHTML 1.1 standard.

To improve this separate ini files for the XHTML 1.0 variants can be used however to be able to select varying ini files the "Use Doctype to switch specification" should not be checked.




Base file used was XHTML 1.1.ini
Location: C:\Program Files\HTMLPad 2006\data\mldefs\

Original W3C file used was xhtml1-strict.xsd
Location: http://www.w3.org/2002/08/xhtml/

Method:

Cut and Paste using the W3C file as original reference.
The xhtml 1.0.ini file supplied is actually a composite of Strict/Transitional/Frameset.
xml:lang is not catered for and also is not in the 1.1 file at all!

File tips:
name,d=<string> ( ,d indicates the attribute as deprecated)
%endtag=0 ( 0 indicates an empty element, shows as green in Auto tag lists)
action,r=<url> ( ,r indicates a required attribute)

Modified XHTML 1.0 Strict file HERE (rename as XHTML 1.0 Strict.ini)
Modified XHTML 1.0 Transitional file HERE (rename as XHTML 1.0 Transitional.ini)
Modified XHTML 1.0 Frameset file HERE (rename as XHTML 1.0 Frameset.ini)


Template Locations

C:\Program Files\HTMLPad 2006\templates\HTML\



Related usage notes:

Adding custom schema.

Markup browser uses markup.dat ( View|Markup Browser )
HTML Language specification uses html.dat ( Options|Preferences|Language Options )

markup.dat (as installed)
HTML 4.01
XHTML 1.0
XHTML 1.1
WML 1.1
DEDI

html.dat (as installed)
HTML 4.01
XHTML 1.0
XHTML 1.1
DEDI

The files specified (except for DEDI) all relate to the as named files in the mldefs folder. There is no file for DEDI.
Maybe DEDI is short for dedicated and is meant for custom schema - I don't know...

Files can be added to both files and will then be shown as options in the appropriate places.

eg:

markup.dat (as modded)                        html.dat (as modded)
HTML 4.01                                        HTML 4.01
XHTML 1.0                                        XHTML 1.0
XHTML 1.1                                         XHTML 1.1
WML 1.1                                             DEDI
DEDI                                                 XHTML 1.0 Strict
XHTML 1.0 Strict                              XHTML 1.0 Transitional
XHTML 1.0 Transitional                       XHTML 1.0 Frameset
XHTML 1.0 Frameset

Quirk:
If the Markup Browser is used and say XHTML 1.0 Strict is selected the tag list will only appear if the same option is selected in the language options. However if any of the default files are selected the tag lists will appear anyway.
If after selecting a custom file another file is then chosen in the markup list the tag list will only show if the file chosen is one of the default ones. If the original custom file is re-selected then the tag list will not appear until the language option
is reapplied for that file.

If the DEDI entry is removed from both dat files the situation remains the same.

It was noticed also that if say the WML 1.1 entry in the markup.dat file was replaced with a custom file then the Markup Browser would still show the tag list for the WML 1.1 file.

It seems that the default file names are written somewhere else as a hard coded reference....






XHTML 1.0 MIME type issue

This site is designed for XHTML compatibility but really it is just a load of bollocks because of the following situation with XHTML User Agent compatibility.
Basically true XHTML is not supported by any of the IE browsers (which at the moment constitute the majority of browsers in use).
More about this can be found HERE (http://www.hixie.ch/advocacy/xhtml).

With wanderinghippo although the meta tag is set as application/xhtml & xml the mime type sent from the server(which takes precedence with the UA) is actually text/html as is the case with many other XHTML 1.0 sites. This means the UA will not handle the page in a pure XHTML form.

Why then bother with XHTML 1.0 for the hippo?
You may well ask but I like the challenge of creating a compliant page according to the fiendish standards which in reality aren't that bad - just a shame that IE won't support them.


Update:


There is a workround that will cater for IE - it involves the use of content negotiation on the server, basically it involves the server detecting whether the browser is capable of handling the application/xhtml+xml mime type and if not then serving the pages as text/html. More details on this further down the page.




XHTML Myths and Legends - some answers!

1 The target attribute has never been included in Strict versions of HTML 4.01, XHTML 1.0 and XHTML 1.1 - it exists in HTML 4.01 Frameset/Transitional and XHTML 1.0 Frameset/Transitional

2 XHTML 1.0 Strict allows both xml:lang and lang with xml:lang taking precedence. XHTML 1.1 allows only xml:lang

3 The name attribute of the <a>, <map> and <form> tags is deprecated in XHTML 1.0 Strict and removed in XHTML 1.1 in favour of the id attribute

4 The name attribute of the <img> tag is removed in XHTML 1.0 Strict but exists in 1.0 Frameset/Transitional

5 The <iframe> tag is not included in XHTML 1.0 Strict

6 The name attribute of the <applet>, <form>, <frame>, <iframe> and <img> tags is deprecated in XHTML 1.0 Frameset/Transitional

7 The <ruby>, <rbc>, <rtc>, <rb>, <rt> and <rp> tags were introduced with XHTML 1.1

8 The following deprecated tags were excluded in XHTML 1.0 -
<applet>, <basefont>, <center>, <dir>, <font>, <frame>, <frameset>, <isindex>, <menu>, <noframes>, <s>, <strike>, <u>

9 Empty elements such as <br /> and <hr /> or <img src="image.jpg" alt="picture" /> are usually typed as such with a space preceding the slash to allow compatibility for older browsers.

10 XHTML 1.0 content presentation should normally be set as "application/xhtml+xml" in the META tag rather than "text/html" (allowed with XHTML 1.0) however if this is the case then IE will not process the content correctly (not supported). Since most XHTML 1.0 pages are presented as .html files rather than .xhtml files the servers normally present the content as "text/html" and so IE will work but not in strict XHTML mode.


11 <!-- and --> traditionally used for comments are still valid outside tags but the content will be ignored by some XML parsers.
Using these tags within script or style tags however should no longer be implemented because XML parsers will parse these tags including any unescaped XML characters - <![CDATA[ and ]]> should be used within these tags.

12 If XHTML is served as text/html background styling on the BODY tag will affect the whole window(including the HTML tag) but if served as application/xhtml+xml then only the BODY tag is affected. If offsets are used with the BODY tag the window will only be fully affected if the HTML tag is styled.

13 The apostrophe character - &apos; was introduced by XML 1.0 so &#39; may be required for earlier HTML browsers.

14 If XHTML is served as application/xhtml+xml then a javascript document.write() will not work because the XML parser is being used.






Adding Macro for XHTML 1.0 Validation to Expression Web Designer

The macro facility in EWD can be used to provide XHTML validation in a similar manner to that described for FP at Michael Suodenjoki's site - HERE
(http://www.suodenjoki.dk/us/productions/articles/validation_article.htm)
I found this method can also be used in FP2003

A few tweaks are required for the script to be used in EWD. Please bear in mind that I have used EWD CTP1 and Beta 1 so things may be different on retail releases when they happen.

 

UPDATE:  Still works OK with EW Trial version (which I think may be a RC)

        and final release version also.


Install:

Fairly similar to section 3.2 of Michael's article
The validate.bas file can be tweaked with notepad or within the VBA editor.


Tools|Macro|Visual Basic Editor

VBA editor will open (different to screenshot)


View|Project Explorer

This will show Module1 which can be deleted


File|Import File

     ExecuteCmd.bas (still works OK without tweaks)
     Validate.bas (requires some tweaks)
     Form_output.frm (OK as is)

These should now show in the Project Explorer
Close the VBA editor and use EW to complete the install of the macro.

Steps 7 to  17 of Michael's instructions are pretty well still OK for EW.


Tweaks for validate.bas

Line 35: MsgBox "Please open a file in the Expression Web Designer.", _
Line 40: If Not ActivePageWindow.ViewMode = PageViewNormal Then
Line 42: ActivePageWindow.ViewMode = PageViewNormal
Line 45: Dim doc As IHTMLDocument
Line 96: ActivePageWindow.ViewMode = PageViewHtml


Note: It can be convenient to tweak the validate.bas file before the import so a master record is kept since the app uses its own macro file once the import is done.

Macro location:
EWD Trial
C:\Documents and Settings\user\Application Data\Microsoft\Expression\Web Designer\Macros\ Microsoft Expression Web.wdmacro


EWD CTP1 and Beta1
C:\Documents and Settings\user\Application Data\Microsoft\Expression\Web Designer\Macros\ Microsoft Expression Web Designer.wdmacro

FP2003
C:\Documents and Settings\user\Application Data\Microsoft\FrontPage\Macros\Microsoft Frontpage.fpm

Typical output on a "clean" XHTML 1.0 page was -

C:\BMCDataStuff\BMCWeb\Validation\bin\nsgmls.exe: C:\BMCDataStuff\BMCWeb\Validation\pubtext\xhtml1.dcl:31:27:W: characters in the document character set with numbers exceeding 65535 not supported
(Above line always appeared - just never worried about it too much)

C:\BMCDataStuff\BMCWeb\Validation\bin\nsgmls.exe: C:\BMCDataStuff\BMCWeb\Validation\input.tmp:10:9:E: character data is not allowed here
C:\BMCDataStuff\BMCWeb\Validation\bin\nsgmls.exe: C:\BMCDataStuff\BMCWeb\Validation\input.tmp:25:9:E: character data is not allowed here
(Lines above relate to <![CDATA[ Style Sheets ]]> and <![CDATA[ Scripts ]]> being in the user page)




XHTML 1.0 Strict Validation Stuff

Notes 'n stuff whilst making an XHTML 1.0 Strict schema file for VWDE and FP 2003.

 

Unfortunately Visual Web Developer Express 2005 (VWDE) does not have the capability to handle XHTML 1.0 Strict schemas. Provision is made only for XHTML 1.0 Frameset/Transitional and XHTML 1.1 so basically I decided to try and fabricate a schema using the 1.1 file as a starting point since the differences between 1.0 Strict and 1.1 are minimal


Base MS file used was xhtml_strict-11.xsd
Location:
C:\Program Files\Microsoft Visual Studio 8\Common7\Packages\schemas\html

Original W3C file used was xhtml1-strict.xsd
Location:
http://www.w3.org/2002/08/xhtml/

Method:

Cut and Paste using the W3C file as original master reference for 1.0 Strict.

Cross check done with MS xhtml_transitional.xsd and known deprecations.
Basically MS have moved things around a bit but the W3C reference can be reconciled with the MS files fairly well.


                    W3C                                             MS
tag       xs:                                               xsd:

Generic Attributes
      coreattrs                                           coreAttributeGroup
      i18n                                                   i18AttributeGroup
      events                                                inputEventsGroup
      focus                                                 focusAttributeGroup
      attrs                                                   commonAttributeGroup
      xs:complexType name="Block"             xsd:group name="BlockElements"



Known deprecations:

           1.0                                       1.1

         Lang                                  xml:Lang
         a name                               a id
         map name                           map id
                                                  ruby (added)

Also most deprecations in XHTML 1.0 Transitional were removed in 1.0 Strict


The schema files (please feel free to check over the modified file B for accuracy before using - it's a prototype at the moment!)

File A: HERE - This is the original W3C XHTML 1.0 Strict schema file.

File B: HERE - (only use with VWDE) This is the modified MS xhtml_strict-11.xsd file from VWDE retaining original MS element order consistent with the original MS .xsd files (xhtml_strict-11.xsd & xhtml_transitional.xsd). This should give a Strict 1.0 interpretation that is more consistent with the w3c spec.

Installation:
VWD 2005 Express

Reference for this was found at -
http://blogs.msdn.com/mikhailarkhipov/archive/2006/02/01/522614.aspx

Because I have only VWD installed and not the full Visual Studio the registry hack becomes -

HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\VWDExpress\8.0\Packages\
{1B437D20-F8FE-11D2-A6AE-00104BCC7269}\Schemas\

There were 20 schemas already installed (standard install).

 

The standard install does not include XHTML 1.0 Strict at all

eg:

Schema 1 - html\ie6_0.xsd

Schema 4 - html\html_401.xsd

Schema 5 - html\xhtml_transitional.xsd

Schema 6 - html\xhtml_frameset.xsd

Schema 7 - html\xhtml_strict-11.xsd

Schema 21 - html\xhtml_strict-10.xsd  (I added this one)


FrontPage 2003
This file is adapted from the file modified for VWD 2005. Reference was also made to existing HTML schemas provided with FP 2003.

The schema location is -
C:\Program Files\Common Files\Microsoft Shared\OFFICE11\SCHEMAS\HTML

The type-library file from VWD( w3c-dom1-strict.tlb) was also placed in this folder as the xsd file uses it.
FP 2003 does not require a registry entry for the schema as VWD does - a restart is sufficient to make the schema appear in
Tools|PageOptions|Authoring|SchemaVersion(dropdown).

Reference for this was found at -
http://blogs.msdn.com/lisawoll/archive/2005/01/14/353451.aspx

 

Note:(finding file locations)
FP 2003 is a module of Office 11
VWD 2005 is a module of Visual Studio 8
EWD is a module of Office 12

Note:  Initially I wanted to use the file for FP2003 but because the Intellisense was a wee bit tired I decided to have a go with the new app that will replace FP.

It is Expression Web Designer. You will notice in the above note that VWD is part of Visual Studio 2005 whereas EWD is part of Office as was FP2003. As a result the schema files for EWD vary slightly with the inclusion of fp tags, etc.

Useful web references:

http://www.w3.org/2002/08/xhtml/ (Master W3C xsd files)
http://blogs.msdn.com/mikhailarkhipov/archive/2006/02/01/522614.aspx (Registry hack for VWD 2005 schema addition)
http://blogs.msdn.com/lisawoll/archive/2005/01/14/353451.aspx (Customising Intellisense)
http://schneegans.de/frontpage/xhtml-schema/ (Using XHTML schema with FP 2003 & Visual Studio)

UPDATE:

MS Expression Web Designer is now available as a Community Technology Preview (CTP) package.
As it happens this supposedly supports XHTML 1.0 Strict and the file can be found in -

C:\Program Files\Common Files\Microsoft Shared\OFFICE12\SCHEMAS\HTML

This file has some differences to the modified one adapted from VWD.

               EWD                                       VWDE
 clientom="w3c-dom1.tlb"             clientom="w3c-dom1-strict.tlb"
 cssschema="CSS 2.0"                  cssschema="CSS 2.1"
 <xsd:documentation>                    <xsd:documentation>
 Microsoft Visual Studio .NET      Microsoft Visual Studio .NET
 schema for HTML 4.01                schema for XHTML 1.0
 omitted                                     <xsd:attribute name="Style" vs:builder="style" />

Unfortunately the XHTML 1.0 xsd support in EWD doesn't look too good so I will try to adapt the EWD file to be a bit closer to the W3C one.


UPDATE:


Expression Web Designer (EWD) is now known as Expression Web and is available as a trial version. Having looked at the fresh install I find the XHTML 1.0 xsd  is still a bit dodgy but the app seems to work well as a replacement for FP2003. The only thing I am not keen on is the high price given that the XHTML 1.0 Strict functionality appears to be lacking.

 

File C: HERE - MS XHTML 1.0 Strict file supplied with EWD CTP1 and Beta 1.

File D: HERE - MS XHTML 1.0 Strict schema file supplied with EW Trial.


Differences are -


Addition 1
<!-- style info, which may include CDATA sections -->
EWD Beta 1
         none
EW Trial
         <xsd:enumeration value="default" />

Addition 2
<!-- script statements, which may include CDATA sections -->
EWD Beta 1
         none

EW Trial
         <xsd:enumeration value="default" />


Change 3
<!--=================== Preformatted Text ================================-->
EWD Beta 1
          <xsd:attribute name="xml:Space" default="preserve" fixed="true" />

EW Trial
          <xsd:attribute name="xml:Space" vs:readonly="true" fixed="true">
          <xsd:simpleType>
          <xsd:restriction base="xsd:string">
          <xsd:enumeration value="preserve" />
          <xsd:enumeration value="default" />
          </xsd:restriction>
          </xsd:simpleType>
          </xsd:attribute>

Change 4
xsd:attributeGroup name="cellHAlignTypeAttributes"
EWD Beta 1
          <xsd:attribute name="Ch" />
          <xsd:attribute name="ChOff" />

EW Trial
          <xsd:attribute name="Char" />
          <xsd:attribute name="CharOff" />

 

 

In theory a modified file for use with EW should also work with FP2003 but I seemed to have a few hassles with the Intellisense in FP particularly in the area of Byte Order Marks (BOM), the DOCTYPE and using UTF-8 so any effort is now directed towards EW. A good feature in HTMLPad 2006 that I also use is being able to save a page without the BOM.

 

File F: HERE - This is the modified xhtml file for EW Trial (still doing it.....).




Microsoft Web Authoring Tools

The other day I was messing about with some new Microsoft web authoring apps and here is my experience so far.

Frontpage 2003 - the app I tend to use
Visual Web Designer 2005 Express - available free
Expression Web Designer CTP1 - beta trial

I tend to use FP 2003 for XHTML/HTML work and Notepad++ for CSS but FP is now getting a bit tired. The big feature I like is the tabbed preview which is quick (albeit based on the IE rendering engine) and the code view is used a bit. The ability to work within a web is excellent for hyperlinking and renaming functions but the biggest drawback is now the XHTML standards support. I presently try to code for XHTML 1.0 Strict.
The macro facility in FP can be used to provide XHTML validation which has proved to be excellent but the inbuilt Intellisense support is weak. I have found that this can be improved a bit using a file derived for use with one of the later MS apps.
Trying VWDE I found the app only really does the HTML/XHTML editing part of what FP does without the web environment. Also despite being much improved in code creation, etc it still doesn't support XHTML 1.0 Strict for Intellisense.
So, my answer was to modify the MS copy of the XHTML 1.1 Strict schema in VWDE and use that (See above for more details).
Since messing around with VWDE MS have issued a CTP trial of EWD and this app is basically the new Frontpage. Interestingly the XHTML 1.0 Strict schema file used looks a bit dodgy in places