Jump to content

Making my own tags in a DTD


madsovenielsen

Recommended Posts

Hey all.I want to make a <popup></popup> tag. i have no idea how to do this.i have tried this :adding a block element with name test under the body section. and defining the test element under the block element section.

<!--   Extensible HTML version 1.0 Transitional DTD   This is the same as HTML 4 Transitional except for   changes due to the differences between XML and SGML.   Namespace = http://www.w3.org/1999/xhtml   For further information, see: http://www.w3.org/TR/xhtml1   Copyright (c) 1998-2002 W3C (MIT, INRIA, Keio),   All Rights Reserved.    This DTD module is identified by the PUBLIC and SYSTEM identifiers:   PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"   SYSTEM "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"   $Revision: 1.2 $   $Date: 2002/08/01 18:37:55 $--><!--================ Character mnemonic entities =========================--><!ENTITY % HTMLlat1 PUBLIC   "-//W3C//ENTITIES Latin 1 for XHTML//EN"   "xhtml-lat1.ent">%HTMLlat1;<!ENTITY % HTMLsymbol PUBLIC   "-//W3C//ENTITIES Symbols for XHTML//EN"   "xhtml-symbol.ent">%HTMLsymbol;<!ENTITY % HTMLspecial PUBLIC   "-//W3C//ENTITIES Special for XHTML//EN"   "xhtml-special.ent">%HTMLspecial;<!--================== Imported Names ====================================--><!ENTITY % ContentType "CDATA">	<!-- media type, as per [RFC2045] --><!ENTITY % ContentTypes "CDATA">	<!-- comma-separated list of media types, as per [RFC2045] --><!ENTITY % Charset "CDATA">	<!-- a character encoding, as per [RFC2045] --><!ENTITY % Charsets "CDATA">	<!-- a space separated list of character encodings, as per [RFC2045] --><!ENTITY % LanguageCode "NMTOKEN">	<!-- a language code, as per [RFC3066] --><!ENTITY % Character "CDATA">	<!-- a single character, as per section 2.2 of [XML] --><!ENTITY % Number "CDATA">	<!-- one or more digits --><!ENTITY % LinkTypes "CDATA">	<!-- space-separated list of link types --><!ENTITY % MediaDesc "CDATA">	<!-- single or comma-separated list of media descriptors --><!ENTITY % URI "CDATA">	<!-- a Uniform Resource Identifier, see [RFC2396] --><!ENTITY % UriList "CDATA">	<!-- a space separated list of Uniform Resource Identifiers --><!ENTITY % Datetime "CDATA">	<!-- date and time information. ISO date format --><!ENTITY % Script "CDATA">	<!-- script expression --><!ENTITY % StyleSheet "CDATA">	<!-- style sheet data --><!ENTITY % Text "CDATA">	<!-- used for titles etc. --><!ENTITY % FrameTarget "NMTOKEN">	<!-- render in this frame --><!ENTITY % Length "CDATA">	<!-- nn for pixels or nn% for percentage length --><!ENTITY % MultiLength "CDATA">	<!-- pixel, percentage, or relative --><!ENTITY % Pixels "CDATA">	<!-- integer representing length in pixels --><!-- these are used for image maps --><!ENTITY % Shape "(rect|circle|poly|default)"><!ENTITY % Coords "CDATA">	<!-- comma separated list of lengths --><!-- used for object, applet, img, input and iframe --><!ENTITY % ImgAlign "(top|middle|bottom|left|right)"><!-- a color using sRGB: #RRGGBB as Hex values --><!ENTITY % Color "CDATA"><!-- There are also 16 widely known color names with their sRGB values:	Black  = #000000	Green  = #008000	Silver = #C0C0C0	Lime   = #00FF00	Gray   = #808080	Olive  = #808000	White  = #FFFFFF	Yellow = #FFFF00	Maroon = #800000	Navy   = #000080	Red	= #FF0000	Blue   = #0000FF	Purple = #800080	Teal   = #008080	Fuchsia= #FF00FF	Aqua   = #00FFFF--><!--=================== Generic Attributes ===============================--><!-- core attributes common to most elements  id	   document-wide unique id  class	space separated list of classes  style	associated style info  title	advisory title/amplification--><!ENTITY % coreattrs "id		  ID			 #IMPLIED  class	   CDATA		  #IMPLIED  style	   %StyleSheet;   #IMPLIED  title	   %Text;		 #IMPLIED"  ><!-- internationalization attributes  lang		language code (backwards compatible)  xml:lang	language code (as per XML 1.0 spec)  dir		 direction for weak/neutral text--><!ENTITY % i18n "lang		%LanguageCode; #IMPLIED  xml:lang	%LanguageCode; #IMPLIED  dir		 (ltr|rtl)	  #IMPLIED"  ><!-- attributes for common UI events  onclick	 a pointer button was clicked  ondblclick  a pointer button was double clicked  onmousedown a pointer button was pressed down  onmouseup   a pointer button was released  onmousemove a pointer was moved onto the element  onmouseout  a pointer was moved away from the element  onkeypress  a key was pressed and released  onkeydown   a key was pressed down  onkeyup	 a key was released--><!ENTITY % events "onclick	 %Script;	   #IMPLIED  ondblclick  %Script;	   #IMPLIED  onmousedown %Script;	   #IMPLIED  onmouseup   %Script;	   #IMPLIED  onmouseover %Script;	   #IMPLIED  onmousemove %Script;	   #IMPLIED  onmouseout  %Script;	   #IMPLIED  onkeypress  %Script;	   #IMPLIED  onkeydown   %Script;	   #IMPLIED  onkeyup	 %Script;	   #IMPLIED"  ><!-- attributes for elements that can get the focus  accesskey   accessibility key character  tabindex	position in tabbing order  onfocus	 the element got the focus  onblur	  the element lost the focus--><!ENTITY % focus "accesskey   %Character;	#IMPLIED  tabindex	%Number;	   #IMPLIED  onfocus	 %Script;	   #IMPLIED  onblur	  %Script;	   #IMPLIED"  ><!ENTITY % attrs "%coreattrs; %i18n; %events;"><!-- text alignment for p, div, h1-h6. The default is	 align="left" for ltr headings, "right" for rtl --><!ENTITY % TextAlign "align (left|center|right|justify) #IMPLIED"><!--=================== Text Elements ====================================--><!ENTITY % special.extra   "object | applet | img | map | iframe">	<!ENTITY % special.basic	"br | span | bdo"><!ENTITY % special   "%special.basic; | %special.extra;"><!ENTITY % fontstyle.extra "big | small | font | basefont"><!ENTITY % fontstyle.basic "tt | i | b | u					  | s | strike "><!ENTITY % fontstyle "%fontstyle.basic; | %fontstyle.extra;"><!ENTITY % phrase.extra "sub | sup"><!ENTITY % phrase.basic "em | strong | dfn | code | q |				   samp | kbd | var | cite | abbr | acronym"><!ENTITY % phrase "%phrase.basic; | %phrase.extra;"><!ENTITY % inline.forms "input | select | textarea | label | button"><!-- these can occur at block or inline level --><!ENTITY % misc.inline "ins | del | script"><!-- these can only occur at block level --><!ENTITY % misc "noscript | %misc.inline;"><!ENTITY % inline "a | %special; | %fontstyle; | %phrase; | %inline.forms;"><!-- %Inline; covers inline or "text-level" elements --><!ENTITY % Inline "(#PCDATA | %inline; | %misc.inline;)*"><!--================== Block level elements ==============================--><!ENTITY % heading "h1|h2|h3|h4|h5|h6"><!ENTITY % lists "ul | ol | dl | menu | dir"><!ENTITY % blocktext "pre | hr | blockquote | address | center | noframes"><!ENTITY % block	"p | %heading; | div | %lists; | %blocktext; | isindex |fieldset | table"><!-- %Flow; mixes block and inline and is used for list items etc. --><!ENTITY % Flow "(#PCDATA | %block; | form | %inline; | %misc;)*"><!--================== Content models for exclusions =====================--><!-- a elements use %Inline; excluding a --><!ENTITY % a.content   "(#PCDATA | %special; | %fontstyle; | %phrase; | %inline.forms; | %misc.inline;)*"><!-- pre uses %Inline excluding img, object, applet, big, small,	 font, or basefont --><!ENTITY % pre.content   "(#PCDATA | a | %special.basic; | %fontstyle.basic; | %phrase.basic; |	   %inline.forms; | %misc.inline;)*"><!-- form uses %Flow; excluding form --><!ENTITY % form.content "(#PCDATA | %block; | %inline; | %misc;)*"><!-- button uses %Flow; but excludes a, form, form controls, iframe --><!ENTITY % button.content   "(#PCDATA | p | %heading; | div | %lists; | %blocktext; |	  table | br | span | bdo | object | applet | img | map |	  %fontstyle; | %phrase; | %misc;)*"><!--================ Document Structure ==================================--><!-- the namespace URI designates the document profile --><!ELEMENT html (head, body)><!ATTLIST html  %i18n;  id		  ID			 #IMPLIED  xmlns	   %URI;		  #FIXED 'http://www.w3.org/1999/xhtml'  ><!--================ Document Head =======================================--><!ENTITY % head.misc "(script|style|meta|link|object|isindex)*"><!-- content model is %head.misc; combined with a single	 title and an optional base element in any order --><!ELEMENT head (%head.misc;,	 ((title, %head.misc;, (base, %head.misc;)?) |	  (base, %head.misc;, (title, %head.misc;))))><!ATTLIST head  %i18n;  id		  ID			 #IMPLIED  profile	 %URI;		  #IMPLIED  ><!-- The title element is not considered part of the flow of text.	   It should be displayed, for example as the page header or	   window title. Exactly one title is required per document.	--><!ELEMENT title (#PCDATA)><!ATTLIST title   %i18n;  id		  ID			 #IMPLIED  ><!-- document base URI --><!ELEMENT base EMPTY><!ATTLIST base  id		  ID			 #IMPLIED  href		%URI;		  #IMPLIED  target	  %FrameTarget;  #IMPLIED  ><!-- generic metainformation --><!ELEMENT meta EMPTY><!ATTLIST meta  %i18n;  id		  ID			 #IMPLIED  http-equiv  CDATA		  #IMPLIED  name		CDATA		  #IMPLIED  content	 CDATA		  #REQUIRED  scheme	  CDATA		  #IMPLIED  ><!--  Relationship values can be used in principle:   a) for document specific toolbars/menus when used	  with the link element in document head e.g.		start, contents, previous, next, index, end, help   b) to link to a separate style sheet (rel="stylesheet")   c) to make a link to a script (rel="script")   d) by stylesheets to control how collections of	  html nodes are rendered into printed documents   e) to make a link to a printable version of this document	  e.g. a PostScript or PDF version (rel="alternate" media="print")--><!ELEMENT link EMPTY><!ATTLIST link  %attrs;  charset	 %Charset;	  #IMPLIED  href		%URI;		  #IMPLIED  hreflang	%LanguageCode; #IMPLIED  type		%ContentType;  #IMPLIED  rel		 %LinkTypes;	#IMPLIED  rev		 %LinkTypes;	#IMPLIED  media	   %MediaDesc;	#IMPLIED  target	  %FrameTarget;  #IMPLIED  ><!-- style info, which may include CDATA sections --><!ELEMENT style (#PCDATA)><!ATTLIST style  %i18n;  id		  ID			 #IMPLIED  type		%ContentType;  #REQUIRED  media	   %MediaDesc;	#IMPLIED  title	   %Text;		 #IMPLIED  xml:space   (preserve)	 #FIXED 'preserve'  ><!-- script statements, which may include CDATA sections --><!ELEMENT script (#PCDATA)><!ATTLIST script  id		  ID			 #IMPLIED  charset	 %Charset;	  #IMPLIED  type		%ContentType;  #REQUIRED  language	CDATA		  #IMPLIED  src		 %URI;		  #IMPLIED  defer	   (defer)		#IMPLIED  xml:space   (preserve)	 #FIXED 'preserve'  ><!-- alternate content container for non script-based rendering --><!ELEMENT noscript %Flow;><!ATTLIST noscript  %attrs;  ><!--======================= Frames =======================================--><!-- inline subwindow --><!ELEMENT iframe %Flow;><!ATTLIST iframe  %coreattrs;  longdesc	%URI;		  #IMPLIED  name		NMTOKEN		#IMPLIED  src		 %URI;		  #IMPLIED  frameborder (1|0)		  "1"  marginwidth %Pixels;	   #IMPLIED  marginheight %Pixels;	  #IMPLIED  scrolling   (yes|no|auto)  "auto"  align	   %ImgAlign;	 #IMPLIED  height	  %Length;	   #IMPLIED  width	   %Length;	   #IMPLIED  ><!-- alternate content container for non frame-based rendering --><!ELEMENT noframes %Flow;><!ATTLIST noframes  %attrs;  ><!--=================== Document Body ====================================--><!ELEMENT body %Flow;><!ATTLIST body  %attrs;  onload	  %Script;	   #IMPLIED  onunload	%Script;	   #IMPLIED  background  %URI;		  #IMPLIED  bgcolor	 %Color;		#IMPLIED  text		%Color;		#IMPLIED  link		%Color;		#IMPLIED  vlink	   %Color;		#IMPLIED  alink	   %Color;		#IMPLIED  ><!ELEMENT div %Flow;>  <!-- generic language/style container --><!ATTLIST div  %attrs;  %TextAlign;  >  <!ELEMENT test %;>  <!-- generic language/style container --><!ATTLIST div  %attrs;  %TextAlign;  >

/mads

Link to comment
Share on other sites

You do have to (or are supposed to) describe your XML with a DTD (or a Schema). Did you look at the DTD tutorial?
Yes i have. but i have no idea how to use the info in the DTD tut in my DTD file.i dont want to create my own markup language. i just want to add a few tags to the XHTML DTD/mads
Link to comment
Share on other sites

I'm not sure if you understand this, so I'm going to mention it just in case - whatever tag you define, the browser isn't going to know how to process it. You still need to manually write yourself some programming code that is going to specify what does this element do. And the code to do that isn't a DTD - it's JavaScript, PHP, a C++ browser plug-in, or any other XML aware programming environment.The only thing DTD does is to tell validators and validating XML parsers (i.e. those that fail on validation errors - no browser does this due to performance considerations) that a certain element is allowed to appear at a certain point.Furthermore, a custom DTD is going to trigger quirks mode in most browsers, unless you serve the page as application/xhtml+xml or (in the case of IE8) with an X-UA-Compatible header.I suggest you use the normal DTDs (ideally, XHTML 1.0 Strict), and generate any custom elements and/or attributes somehow, depending on your scenario.

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...