Technology Blogs by Members
Explore a vibrant mix of technical expertise, industry insights, and tech buzz in member blogs covering SAP products, technology, and events. Get in the mix!
cancel
Showing results for 
Search instead for 
Did you mean: 
hofmann
Active Contributor
0 Kudos

From time to time a question like "Is the SAP Portal W3C compliant?" arises in the portal forums. As I have gotten asked by clients the same question several times, I will try to shed light on this topic. The following was tested on EP 7.00 and EP 7.01 and takes only consideres the HTML part, not the CSS and Javascript.

The short answer is: no

The explanation:

For those of you that don't know what W3C compliance means: nowadays it means that the HTML code sent to the browser is at least HTML 4.01 compliant, but in most cases it means that the code has to be XHTML 1.0 compliant.

     HTML http://en.wikipedia.org/wiki/HTML#XHTML_versions
  XHTML http://en.wikipedia.org/wiki/XHTML


This means that the browser is expecting the page to include some content and to follows some standards, like:

      DTD http://en.wikipedia.org/wiki/Document_Type_Declaration
  
  •  validate the xhtml document
  Root element http://en.wikipedia.org/wiki/XHTML#Root_element
  
  • must be html
  • must contain an xmlns attribute
  XML declaration http://en.wikipedia.org/wiki/XHTML#XML_declaration
  
  •  character encoding
      Closing (non-)empty elements
  Improperly nesting elements
  Quotation marks around attribute values
  XHTML elements and attributes are case sensitive
  Using attribute minimization
  CDATA: refer all script and stylesheet information in the head element.

 

To simplify XHTML creation, there are 3 types of XHTML available:

  • XHTML 1.0 Strict: "includes elements and attributes that have not been marked deprecated in the HTML 4.01 specification"
  • XHTML 1.0 Transitional: "includes the presentational elements (such as center, font and strike) excluded from the strict version"
  • XHTML 1.0 Frameset: "allows for the definition of frameset documents"

*Source: http://en.wikipedia.org/wiki/XHTML

For every HTML page you should aim to be at least XHTML 1.0 Transitional compliance.

You might think: As long as the browser is showing the information correctly, why be W3C compliant? Once, you can put the W3C compliant image on your site: http://www.w3.org/QA/Tools/Icons. But more important is the fact that W3C compliant means that the same HTML code will get interpreted correctly by all relevant browsers (portability). Upgrading from Firefox 3.5 to 4.0 or from IE7 to IE9 won't be such a high a risk anymore.

The SAP Portal is accessed by browsers that interpret the generated HTML code from the Portal to show the data to the user. If the portal HTML code is XHTML compliant, it doesn't matter if the user is using IE7, Opera, Chrome, Safari or Firefox. As a definition for portal HTML code: the code the portal is generating, not integrated Web Dynpro ABAP, BSP, etc code. As the SAP Portal is also making heavy use of Javascript, being (X)HTML doesn't automatically mean that the functionality will also work across different browsers.

The W3C is offering a validator (http://validator.w3.org/) that check the HTML code of a site and gives you an error report. You can also use web developer plugins for Firefox to analyze the HTML code. I usually use Firebug and HTML validator.

Let's analyze the portal. After an initial log in the user sees the typical default portal:

  • Masthead
  • Tool Area
  • Top Level Navigation
  • Detailed Navigation
  • Content Area (empty)

The W3C Validator is giving me: Failed validation, 151 Errors

The warnings:

  • Unable to Determine Parse Mode!
  • No DOCTYPE found! Attempting validation with HTML 4.01 Transitiona
  • Rare or unregistered character encoding detected (utf-8)

The errors:

  • no document type declaration
  • required attribute "TYPE" not specified. (several times, especially for wrong Javascript inclusion: .pagebuilder/scripts/pagesupport.js" >)
  • Wrong usage of HTML:
  •   end tag for "XYZ" which is not finished.
  •   end tag for element "DIV" which is not open.
  •   document type does not allow element "TABLE" here; missing one of "TH", "TD" start-tag
  •   there is no attribute "XYZ"
  •   Images: required attribute "ALT" not specified.
  • Besides this, there are also a lot of bad Javascript errors. As an example, look at this:

This goes on and on. Most part of this is caused by the iViews SAP is providing. So you can get rid of these error messages when you develop you own portal applications for TLN, Masthead, etc. Doing so, you will still get the basic HTML errors the portal is always producing. I've written a small example code:

 public void doContent(IPortalComponentRequest request, IPortalComponentResponse response)
 {
   response.write("");
 }


This application only writes a standard portal page. Calling this application (http://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/com.example.default) gives me 3 errors:

  1. No DOCTYPE implementation
  2. Required attribute TYPE not specified:
  3. Required attribute TYPE not specified

As this is standard code, you'll always end up in creating non-XHTML compliant code. Curious about this, I checked also the SCN and SAP.com page. I wanted to know if SAP is taking W3C compliance serious or not.

SCN (http://www.sdn.sap.com/irj/sdn😞 201 Errors, 130 warning(s)

But at least they are providing the DOCTYPE: SAP.com (http://www.sap.com/usa/index.epx😞 103 Errors, 4 warning(s)
  • "there is not attribute: XYZ"
  • "ID ‘img' already defined"
  • "element "H3" undefined"
  • Etc.

Conclusion:

With the standard portal HTML code generation you won't be able to have a W3C compliant portal. As the framework is already producing incompatible code, there is no easy workaround available.

7 Comments
Labels in this area