forrest-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From iss...@cocoondev.org
Subject [JIRA] Assigned: (FOR-332) Support for usemap attribute in img tag
Date Tue, 26 Oct 2004 01:58:38 GMT
Message:

   The following issue has been re-assigned.

   Assignee: David Crossley (mailto:crossley@apache.org)
---------------------------------------------------------------------
View the issue:
  http://issues.cocoondev.org//browse/FOR-332

Here is an overview of the issue:
---------------------------------------------------------------------
        Key: FOR-332
    Summary: Support for usemap attribute in img tag
       Type: Improvement

     Status: Open
   Priority: Minor

    Project: Forrest
   Versions:
             HEAD

   Assignee: David Crossley
   Reporter: Tamara Harpster

    Created: Mon, 25 Oct 2004 6:57 PM
    Updated: Mon, 25 Oct 2004 8:57 PM

Description:
The img tag supports the usemap attribute, but the doc2.0 DTD doesn't support the map and
area tags required to support the HTML functions used in browsers.

I've added in information to the 2.0 DTD to support the two tags required to support the HTML
functionality. The map tag has the default attributes left out, because an anchor tag with
the ID is inserted by the XSLT during processing. When this is inserted, the map and area
tags do not function in the Mozilla browser, due to the extra non-standard items. Without
the id, the existing forrest XSLT should handle the translation adequately.

In my viewpoint, the ID tag is not important for the map tag, since it is a container tag
for the area tags, which are the links for the image. 

I pulled the information from the XHTML DTD, however, some items from the DTD were not included
with these tags. The items included was the bare minimium equired to make the usemap function
work for the browser. 

This DTD has been tested using XML Spy Professional, v5, on a Windows 2000 Professional box
with a pre-release of Forrest 0.6. I have just checked the items with the latest source code
from the archive and the changes I made still work.

Included is the diff code, not sure why there is so much, as I changed 2 sections at the top
and one in the middle. I put comments in to mark those sections, to make it a little easier
to find the parts I actually change.

Index: src/core/context/resources/schema/dtd/document-v20.mod
===================================================================
--- src/core/context/resources/schema/dtd/document-v20.mod	(revision 55531)
+++ src/core/context/resources/schema/dtd/document-v20.mod	(working copy)
@@ -50,12 +50,19 @@
 <!ENTITY % text "#PCDATA">
 <!-- Entities referred to later on are defined up front -->
 <!ENTITY % markup "strong|em|code|sub|sup">
-<!ENTITY % special-inline "br|img|icon|acronym">
+<!-- TSH - added in map tag -->
+<!ENTITY % special-inline "br|img|icon|acronym|map">
+<!-- end of change for map addition -->
 <!ENTITY % links "a">
 <!ENTITY % paragraphs "p|source|note|warning|fixme">
 <!ENTITY % tables "table">
 <!ENTITY % lists "ol|ul|dl">
 <!ENTITY % special-blocks "figure|anchor">
+<!-- added in supporting attributes for area tag -->
+<!-- these are used for image maps -->
+<!ENTITY % Shape "(rect|circle|poly|default)">
+<!ENTITY % Coords "CDATA">
+<!-- end of added in change for area tags -->
 <!-- =============================================================== -->
 <!-- Entities for general XML compliance -->
 <!-- =============================================================== -->
@@ -125,9 +132,9 @@
 <!-- A person is a general unparsed human entity -->
 <!ELEMENT person EMPTY>
 <!ATTLIST person
-  %common.att; 
-  %name.att; 
-  %email.att; 
+	%common.att; 
+	%name.att; 
+	%email.att; 
 >
 <!-- =============================================================== -->
 <!-- Content definitions -->
@@ -141,27 +148,27 @@
 <!-- Strong (typically bold) -->
 <!ELEMENT strong (%content.mix;)*>
 <!ATTLIST strong
-  %common.att; 
+	%common.att; 
 >
 <!-- Emphasis (typically italic) -->
 <!ELEMENT em (%content.mix;)*>
 <!ATTLIST em
-  %common.att; 
+	%common.att; 
 >
 <!-- Code (typically monospaced) -->
 <!ELEMENT code (%text;)>
 <!ATTLIST code
-  %common.att; 
+	%common.att; 
 >
 <!-- Superscript (typically smaller and higher) -->
 <!ELEMENT sup (%text;)>
 <!ATTLIST sup
-  %common.att; 
+	%common.att; 
 >
 <!-- Subscript (typically smaller and lower) -->
 <!ELEMENT sub (%text;)>
 <!ATTLIST sub
-  %common.att; 
+	%common.att; 
 >
 <!-- ==================================================== -->
 <!-- Hypertextual Links -->
@@ -170,8 +177,8 @@
 <!-- http://www.w3.org/TR/xhtml2/mod-hypertext.html#s_hypertextmodule -->
 <!ELEMENT a (%link-content.mix;)*>
 <!ATTLIST a
-  %common.att; 
-  %link.att; 
+	%common.att; 
+	%link.att; 
 >
 
 <!-- ==================================================== -->
@@ -180,33 +187,53 @@
 <!-- Breakline Object (typically forces line break) -->
 <!ELEMENT br EMPTY>
 <!ATTLIST br
-  %common.att; 
+	%common.att; 
 >
 <!-- Image Object (typically an inlined image) -->
 <!ELEMENT img EMPTY>
 <!ATTLIST img
-  src CDATA #REQUIRED
-  alt CDATA #REQUIRED
-  height CDATA #IMPLIED
-  width CDATA #IMPLIED
-  usemap CDATA #IMPLIED
-  ismap (ismap) #IMPLIED
-  %common.att; 
+	src CDATA #REQUIRED
+	alt CDATA #REQUIRED
+	height CDATA #IMPLIED
+	width CDATA #IMPLIED
+	usemap CDATA #IMPLIED
+	ismap (ismap) #IMPLIED
+	%common.att; 
 >
+
+<!-- addition of tags to support img usemap attribute -->
+<!-- usemap points to a map element which may be in this document
+  or an external document, although the latter is not widely supported -->
+<!--================== Client-side image maps ============================-->
+<!-- These can be placed in the same document or grouped in a
+     separate document although this isn't yet widely supported -->
+<!ELEMENT map ( area+)>
+<!ATTLIST map
+	name CDATA #IMPLIED
+>
+<!ELEMENT area EMPTY>
+<!ATTLIST area
+	shape %Shape; "rect"
+	coords %Coords; #IMPLIED
+	%link.att; 
+	nohref (nohref) #IMPLIED
+	alt CDATA #REQUIRED
+>
+<!-- end of change -->
 <!-- Image Icon (typically an inlined image placed as graphical item) -->
 <!ELEMENT icon EMPTY>
 <!ATTLIST icon
-  src CDATA #REQUIRED
-  alt CDATA #REQUIRED
-  height CDATA #IMPLIED
-  width CDATA #IMPLIED
-  %common.att; 
+	src CDATA #REQUIRED
+	alt CDATA #REQUIRED
+	height CDATA #IMPLIED
+	width CDATA #IMPLIED
+	%common.att; 
 >
 <!-- Acronym (in modern browsers, will have rollover text) -->
 <!ELEMENT acronym (%text;)*>
 <!ATTLIST acronym
-  title CDATA #REQUIRED
-  %common.att; 
+	title CDATA #REQUIRED
+	%common.att; 
 >
 
 <!-- =============================================================== -->
@@ -224,32 +251,32 @@
 <!-- Text Paragraph (normally vertically space delimited. Space can be preserved.) -->
 <!ELEMENT p (%content.mix;)*>
 <!ATTLIST p
-  %common.att; 
-  xml:space (default|preserve) #IMPLIED
+	%common.att; 
+	xml:space (default | preserve) #IMPLIED
 >
 <!-- Source Paragraph (normally space is preserved) -->
 <!ELEMENT source (%content.mix;)*>
 <!ATTLIST source
-  %common.att; 
-  %xmlspace.att; 
+	%common.att; 
+	%xmlspace.att; 
 >
 <!-- Note Paragraph (normally shown encapsulated) -->
 <!ELEMENT note (%content.mix;)*>
 <!ATTLIST note
-  label CDATA #IMPLIED
-  %common.att; 
+	label CDATA #IMPLIED
+	%common.att; 
 >
 <!-- Warning Paragraph (normally shown with eye-catching colors) -->
 <!ELEMENT warning (%content.mix;)*>
 <!ATTLIST warning
-  label CDATA #IMPLIED
-  %common.att; 
+	label CDATA #IMPLIED
+	%common.att; 
 >
 <!-- Fixme Paragraph (normally not shown) -->
 <!ELEMENT fixme (%content.mix;)*>
 <!ATTLIST fixme
-  author CDATA #REQUIRED
-  %common.att; 
+	author CDATA #REQUIRED
+	%common.att; 
 >
 <!-- ==================================================== -->
 <!-- Tables -->
@@ -260,29 +287,29 @@
 <!-- Table element -->
 <!ELEMENT table (caption?, tr+)>
 <!ATTLIST table
-  %common.att; 
+	%common.att; 
 >
 <!-- The table title -->
 <!ELEMENT caption (%content.mix;)*>
 <!ATTLIST caption
-  %common.att; 
+	%common.att; 
 >
 <!-- The table row element -->
 <!ELEMENT tr (th | td)+>
 <!ATTLIST tr
-  %common.att; 
+	%common.att; 
 >
 <!-- The table row header element -->
 <!ELEMENT th (%flow;)*>
 <!ATTLIST th
-  %common.att; 
-  %cell.span; 
+	%common.att; 
+	%cell.span; 
 >
 <!-- The table row description element -->
 <!ELEMENT td (%flow;)*>
 <!ATTLIST td
-  %common.att; 
-  %cell.span; 
+	%common.att; 
+	%cell.span; 
 >
 <!-- ==================================================== -->
 <!-- Lists -->
@@ -290,7 +317,7 @@
 <!-- List item -->
 <!ELEMENT li (%flow;)*>
 <!ATTLIST li
-  %common.att; 
+	%common.att; 
 >
 <!-- Unordered list (typically bulleted) -->
 <!ELEMENT ul (li)+>
@@ -299,8 +326,8 @@
             use "compact" to get less spacing.  The default is dependent
             on the stylesheet. -->
 <!ATTLIST ul
-  %common.att; 
-  spacing (normal | compact) #IMPLIED
+	%common.att; 
+	spacing (normal | compact) #IMPLIED
 >
 <!-- Ordered list (typically numbered) -->
 <!ELEMENT ol (li)+>
@@ -309,23 +336,23 @@
             use "compact" to get less spacing.  The default is dependent
             on the stylesheet. -->
 <!ATTLIST ol
-  %common.att; 
-  spacing (normal | compact) #IMPLIED
+	%common.att; 
+	spacing (normal | compact) #IMPLIED
 >
 <!-- Definition list (typically two-column) -->
 <!ELEMENT dl (dt, dd)+>
 <!ATTLIST dl
-  %common.att; 
+	%common.att; 
 >
 <!-- Definition term -->
 <!ELEMENT dt (%content.mix;)*>
 <!ATTLIST dt
-  %common.att; 
+	%common.att; 
 >
 <!-- Definition description -->
-<!ELEMENT dd (%flow; )*>
+<!ELEMENT dd (%flow;)*>
 <!ATTLIST dd
-  %common.att; 
+	%common.att; 
 >
 <!-- ==================================================== -->
 <!-- Special Blocks -->
@@ -333,26 +360,26 @@
 <!-- Image Block (typically a separated and centered image) -->
 <!ELEMENT figure EMPTY>
 <!ATTLIST figure
-  src CDATA #REQUIRED
-  alt CDATA #REQUIRED
-  height CDATA #IMPLIED
-  width CDATA #IMPLIED
-  usemap CDATA #IMPLIED
-  ismap (ismap) #IMPLIED
-  align CDATA #IMPLIED
-  %common.att; 
+	src CDATA #REQUIRED
+	alt CDATA #REQUIRED
+	height CDATA #IMPLIED
+	width CDATA #IMPLIED
+	usemap CDATA #IMPLIED
+	ismap (ismap) #IMPLIED
+	align CDATA #IMPLIED
+	%common.att; 
 >
 <!-- anchor point (equivalent of <a name="...">, typically not rendered) -->
 <!ELEMENT anchor EMPTY>
 <!ATTLIST anchor
-  %common-idreq.att; 
+	%common-idreq.att; 
 >
 <!-- =============================================================== -->
 <!-- Document -->
 <!-- =============================================================== -->
 <!ELEMENT document (header, body, footer?)>
 <!ATTLIST document
-  %common.att; 
+	%common.att; 
 >
 <!-- ==================================================== -->
 <!-- Header -->
@@ -361,45 +388,45 @@
 <!ELEMENT header (title, subtitle?, version?, type?, authors?,
                       notice*, abstract?, meta* %local.headers;)>
 <!ATTLIST header
-  %common.att; 
+	%common.att; 
 >
 <!ELEMENT title (%text; | %markup; | %links; | %special-inline;)*>
 <!ATTLIST title
-  %common.att; 
+	%common.att; 
 >
 <!ELEMENT subtitle (%text; | %markup;)*>
 <!ATTLIST subtitle
-  %common.att; 
+	%common.att; 
 >
 <!ELEMENT version (%text;)>
 <!ATTLIST version
-  %common.att;
-  major CDATA #IMPLIED
-  minor CDATA #IMPLIED
-  fix CDATA #IMPLIED
-  tag CDATA #IMPLIED
+	%common.att; 
+	major CDATA #IMPLIED
+	minor CDATA #IMPLIED
+	fix CDATA #IMPLIED
+	tag CDATA #IMPLIED
 >
 <!ELEMENT type (%text;)>
 <!ATTLIST type
-  %common.att; 
+	%common.att; 
 >
 <!ELEMENT authors (person+)>
 <!ATTLIST authors
-  %common.att; 
+	%common.att; 
 >
 <!ELEMENT notice (%content.mix;)*>
 <!ATTLIST notice
-  %common.att; 
+	%common.att; 
 >
 <!ELEMENT abstract (%content.mix;)*>
 <!ATTLIST abstract
-  %common.att; 
+	%common.att; 
 >
 <!-- See http://www.w3.org/TR/xhtml2/mod-meta.html#s_metamodule -->
 <!ELEMENT meta (#PCDATA)>
 <!ATTLIST meta
-  name NMTOKEN #REQUIRED
-  %common.att; 
+	name NMTOKEN #REQUIRED
+	%common.att; 
 >
 
 <!-- ==================================================== -->
@@ -409,11 +436,11 @@
 <!ENTITY % sections "section %local.sections;">
 <!ELEMENT body (%sections; | %blocks;)+>
 <!ATTLIST body
-  %common.att; 
+	%common.att; 
 >
 <!ELEMENT section (title, (%sections; | %blocks;)*)>
 <!ATTLIST section
-  %common.att; 
+	%common.att; 
 >
 <!-- ==================================================== -->
 <!-- Footer -->
@@ -422,7 +449,7 @@
 <!ELEMENT footer (legal %local.footers;)>
 <!ELEMENT legal (%content.mix;)*>
 <!ATTLIST legal
-  %common.att; 
+	%common.att; 
 >
 <!-- =============================================================== -->
 <!-- End of DTD -->


---------------------------------------------------------------------
JIRA INFORMATION:
This message is automatically generated by JIRA.

If you think it was sent incorrectly contact one of the administrators:
   http://issues.cocoondev.org//secure/Administrators.jspa

If you want more information on JIRA, or have a bug to report see:
   http://www.atlassian.com/software/jira


Mime
View raw message