[vwnc] Bug in XML parser in VW7.6 -- test and fix included

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

[vwnc] Bug in XML parser in VW7.6 -- test and fix included

cdavidshaffer
VW7.6

This is a repost since I didn't see any "harvest" response from Cincom
to my last post.  Attached you will find a test case that shows a
missing send of asURI in the XML framework in VisualWorks.  Fix is also
attached.

David


<?xml version="1.0"?>

<st-source>
<time-stamp>From VisualWorks® NonCommercial, 7.6 of March 3, 2008 on May 15, 2009 at 11:23:45 am</time-stamp>
<!-- Package XMLBroken* -->


<class>
<name>XMLBroken</name>
<environment>Smalltalk</environment>
<super>XProgramming.SUnit.TestCase</super>
<private>false</private>
<indexed-type>none</indexed-type>
<inst-vars></inst-vars>
<class-inst-vars></class-inst-vars>
<imports></imports>
<category></category>
<attributes>
<package>XMLBroken</package>
</attributes>
</class>


<methods>
<class-id>XMLBroken</class-id> <category>accessing</category>

<body package="XMLBroken">xhtml1StrictDtd
        ^'&lt;!--
   Extensible HTML version 1.0 Strict DTD

   This is the same as HTML 4 Strict 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 Strict//EN"
   SYSTEM "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"

   $Revision: 1.1 $
   $Date: 2002/08/01 13:56:03 $

--&gt;

&lt;!--================ Character mnemonic entities =========================--&gt;

&lt;!ENTITY % HTMLlat1 PUBLIC
   "-//W3C//ENTITIES Latin 1 for XHTML//EN"
   "xhtml-lat1.ent"&gt;
%HTMLlat1;

&lt;!ENTITY % HTMLsymbol PUBLIC
   "-//W3C//ENTITIES Symbols for XHTML//EN"
   "xhtml-symbol.ent"&gt;
%HTMLsymbol;

&lt;!ENTITY % HTMLspecial PUBLIC
   "-//W3C//ENTITIES Special for XHTML//EN"
   "xhtml-special.ent"&gt;
%HTMLspecial;

&lt;!--================== Imported Names ====================================--&gt;

&lt;!ENTITY % ContentType "CDATA"&gt;
    &lt;!-- media type, as per [RFC2045] --&gt;

&lt;!ENTITY % ContentTypes "CDATA"&gt;
    &lt;!-- comma-separated list of media types, as per [RFC2045] --&gt;

&lt;!ENTITY % Charset "CDATA"&gt;
    &lt;!-- a character encoding, as per [RFC2045] --&gt;

&lt;!ENTITY % Charsets "CDATA"&gt;
    &lt;!-- a space separated list of character encodings, as per [RFC2045] --&gt;

&lt;!ENTITY % LanguageCode "NMTOKEN"&gt;
    &lt;!-- a language code, as per [RFC3066] --&gt;

&lt;!ENTITY % Character "CDATA"&gt;
    &lt;!-- a single character, as per section 2.2 of [XML] --&gt;

&lt;!ENTITY % Number "CDATA"&gt;
    &lt;!-- one or more digits --&gt;

&lt;!ENTITY % LinkTypes "CDATA"&gt;
    &lt;!-- space-separated list of link types --&gt;

&lt;!ENTITY % MediaDesc "CDATA"&gt;
    &lt;!-- single or comma-separated list of media descriptors --&gt;

&lt;!ENTITY % URI "CDATA"&gt;
    &lt;!-- a Uniform Resource Identifier, see [RFC2396] --&gt;

&lt;!ENTITY % UriList "CDATA"&gt;
    &lt;!-- a space separated list of Uniform Resource Identifiers --&gt;

&lt;!ENTITY % Datetime "CDATA"&gt;
    &lt;!-- date and time information. ISO date format --&gt;

&lt;!ENTITY % Script "CDATA"&gt;
    &lt;!-- script expression --&gt;

&lt;!ENTITY % StyleSheet "CDATA"&gt;
    &lt;!-- style sheet data --&gt;

&lt;!ENTITY % Text "CDATA"&gt;
    &lt;!-- used for titles etc. --&gt;

&lt;!ENTITY % Length "CDATA"&gt;
    &lt;!-- nn for pixels or nn% for percentage length --&gt;

&lt;!ENTITY % MultiLength "CDATA"&gt;
    &lt;!-- pixel, percentage, or relative --&gt;

&lt;!ENTITY % Pixels "CDATA"&gt;
    &lt;!-- integer representing length in pixels --&gt;

&lt;!-- these are used for image maps --&gt;

&lt;!ENTITY % Shape "(rect|circle|poly|default)"&gt;

&lt;!ENTITY % Coords "CDATA"&gt;
    &lt;!-- comma separated list of lengths --&gt;

&lt;!--=================== Generic Attributes ===============================--&gt;

&lt;!-- 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
--&gt;
&lt;!ENTITY % coreattrs
 "id          ID             #IMPLIED
  class       CDATA          #IMPLIED
  style       %StyleSheet;   #IMPLIED
  title       %Text;         #IMPLIED"
  &gt;

&lt;!-- internationalization attributes
  lang        language code (backwards compatible)
  xml:lang    language code (as per XML 1.0 spec)
  dir         direction for weak/neutral text
--&gt;
&lt;!ENTITY % i18n
 "lang        %LanguageCode; #IMPLIED
  xml:lang    %LanguageCode; #IMPLIED
  dir         (ltr|rtl)      #IMPLIED"
  &gt;

&lt;!-- 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
--&gt;
&lt;!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"
  &gt;

&lt;!-- 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
--&gt;
&lt;!ENTITY % focus
 "accesskey   %Character;    #IMPLIED
  tabindex    %Number;       #IMPLIED
  onfocus     %Script;       #IMPLIED
  onblur      %Script;       #IMPLIED"
  &gt;

&lt;!ENTITY % attrs "%coreattrs; %i18n; %events;"&gt;

&lt;!--=================== Text Elements ====================================--&gt;

&lt;!ENTITY % special.pre
   "br | span | bdo | map"&gt;


&lt;!ENTITY % special
   "%special.pre; | object | img "&gt;

&lt;!ENTITY % fontstyle "tt | i | b | big | small "&gt;

&lt;!ENTITY % phrase "em | strong | dfn | code | q |
                   samp | kbd | var | cite | abbr | acronym | sub | sup "&gt;

&lt;!ENTITY % inline.forms "input | select | textarea | label | button"&gt;

&lt;!-- these can occur at block or inline level --&gt;
&lt;!ENTITY % misc.inline "ins | del | script"&gt;

&lt;!-- these can only occur at block level --&gt;
&lt;!ENTITY % misc "noscript | %misc.inline;"&gt;

&lt;!ENTITY % inline "a | %special; | %fontstyle; | %phrase; | %inline.forms;"&gt;

&lt;!-- %Inline; covers inline or "text-level" elements --&gt;
&lt;!ENTITY % Inline "(#PCDATA | %inline; | %misc.inline;)*"&gt;

&lt;!--================== Block level elements ==============================--&gt;

&lt;!ENTITY % heading "h1|h2|h3|h4|h5|h6"&gt;
&lt;!ENTITY % lists "ul | ol | dl"&gt;
&lt;!ENTITY % blocktext "pre | hr | blockquote | address"&gt;

&lt;!ENTITY % block
     "p | %heading; | div | %lists; | %blocktext; | fieldset | table"&gt;

&lt;!ENTITY % Block "(%block; | form | %misc;)*"&gt;

&lt;!-- %Flow; mixes block and inline and is used for list items etc. --&gt;
&lt;!ENTITY % Flow "(#PCDATA | %block; | form | %inline; | %misc;)*"&gt;

&lt;!--================== Content models for exclusions =====================--&gt;

&lt;!-- a elements use %Inline; excluding a --&gt;

&lt;!ENTITY % a.content
   "(#PCDATA | %special; | %fontstyle; | %phrase; | %inline.forms; | %misc.inline;)*"&gt;

&lt;!-- pre uses %Inline excluding big, small, sup or sup --&gt;

&lt;!ENTITY % pre.content
   "(#PCDATA | a | %fontstyle; | %phrase; | %special.pre; | %misc.inline;
      | %inline.forms;)*"&gt;

&lt;!-- form uses %Block; excluding form --&gt;

&lt;!ENTITY % form.content "(%block; | %misc;)*"&gt;

&lt;!-- button uses %Flow; but excludes a, form and form controls --&gt;

&lt;!ENTITY % button.content
   "(#PCDATA | p | %heading; | div | %lists; | %blocktext; |
    table | %special; | %fontstyle; | %phrase; | %misc;)*"&gt;

&lt;!--================ Document Structure ==================================--&gt;

&lt;!-- the namespace URI designates the document profile --&gt;

&lt;!ELEMENT html (head, body)&gt;
&lt;!ATTLIST html
  %i18n;
  id          ID             #IMPLIED
  xmlns       %URI;          #FIXED ''http://www.w3.org/1999/xhtml''
  &gt;

&lt;!--================ Document Head =======================================--&gt;

&lt;!ENTITY % head.misc "(script|style|meta|link|object)*"&gt;

&lt;!-- content model is %head.misc; combined with a single
     title and an optional base element in any order --&gt;

&lt;!ELEMENT head (%head.misc;,
     ((title, %head.misc;, (base, %head.misc;)?) |
      (base, %head.misc;, (title, %head.misc;))))&gt;

&lt;!ATTLIST head
  %i18n;
  id          ID             #IMPLIED
  profile     %URI;          #IMPLIED
  &gt;

&lt;!-- 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.
    --&gt;
&lt;!ELEMENT title (#PCDATA)&gt;
&lt;!ATTLIST title
  %i18n;
  id          ID             #IMPLIED
  &gt;

&lt;!-- document base URI --&gt;

&lt;!ELEMENT base EMPTY&gt;
&lt;!ATTLIST base
  href        %URI;          #REQUIRED
  id          ID             #IMPLIED
  &gt;

&lt;!-- generic metainformation --&gt;
&lt;!ELEMENT meta EMPTY&gt;
&lt;!ATTLIST meta
  %i18n;
  id          ID             #IMPLIED
  http-equiv  CDATA          #IMPLIED
  name        CDATA          #IMPLIED
  content     CDATA          #REQUIRED
  scheme      CDATA          #IMPLIED
  &gt;

&lt;!--
  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")
--&gt;

&lt;!ELEMENT link EMPTY&gt;
&lt;!ATTLIST link
  %attrs;
  charset     %Charset;      #IMPLIED
  href        %URI;          #IMPLIED
  hreflang    %LanguageCode; #IMPLIED
  type        %ContentType;  #IMPLIED
  rel         %LinkTypes;    #IMPLIED
  rev         %LinkTypes;    #IMPLIED
  media       %MediaDesc;    #IMPLIED
  &gt;

&lt;!-- style info, which may include CDATA sections --&gt;
&lt;!ELEMENT style (#PCDATA)&gt;
&lt;!ATTLIST style
  %i18n;
  id          ID             #IMPLIED
  type        %ContentType;  #REQUIRED
  media       %MediaDesc;    #IMPLIED
  title       %Text;         #IMPLIED
  xml:space   (preserve)     #FIXED ''preserve''
  &gt;

&lt;!-- script statements, which may include CDATA sections --&gt;
&lt;!ELEMENT script (#PCDATA)&gt;
&lt;!ATTLIST script
  id          ID             #IMPLIED
  charset     %Charset;      #IMPLIED
  type        %ContentType;  #REQUIRED
  src         %URI;          #IMPLIED
  defer       (defer)        #IMPLIED
  xml:space   (preserve)     #FIXED ''preserve''
  &gt;

&lt;!-- alternate content container for non script-based rendering --&gt;

&lt;!ELEMENT noscript %Block;&gt;
&lt;!ATTLIST noscript
  %attrs;
  &gt;

&lt;!--=================== Document Body ====================================--&gt;

&lt;!ELEMENT body %Block;&gt;
&lt;!ATTLIST body
  %attrs;
  onload          %Script;   #IMPLIED
  onunload        %Script;   #IMPLIED
  &gt;

&lt;!ELEMENT div %Flow;&gt;  &lt;!-- generic language/style container --&gt;
&lt;!ATTLIST div
  %attrs;
  &gt;

&lt;!--=================== Paragraphs =======================================--&gt;

&lt;!ELEMENT p %Inline;&gt;
&lt;!ATTLIST p
  %attrs;
  &gt;

&lt;!--=================== Headings =========================================--&gt;

&lt;!--
  There are six levels of headings from h1 (the most important)
  to h6 (the least important).
--&gt;

&lt;!ELEMENT h1  %Inline;&gt;
&lt;!ATTLIST h1
   %attrs;
   &gt;

&lt;!ELEMENT h2 %Inline;&gt;
&lt;!ATTLIST h2
   %attrs;
   &gt;

&lt;!ELEMENT h3 %Inline;&gt;
&lt;!ATTLIST h3
   %attrs;
   &gt;

&lt;!ELEMENT h4 %Inline;&gt;
&lt;!ATTLIST h4
   %attrs;
   &gt;

&lt;!ELEMENT h5 %Inline;&gt;
&lt;!ATTLIST h5
   %attrs;
   &gt;

&lt;!ELEMENT h6 %Inline;&gt;
&lt;!ATTLIST h6
   %attrs;
   &gt;

&lt;!--=================== Lists ============================================--&gt;

&lt;!-- Unordered list --&gt;

&lt;!ELEMENT ul (li)+&gt;
&lt;!ATTLIST ul
  %attrs;
  &gt;

&lt;!-- Ordered (numbered) list --&gt;

&lt;!ELEMENT ol (li)+&gt;
&lt;!ATTLIST ol
  %attrs;
  &gt;

&lt;!-- list item --&gt;

&lt;!ELEMENT li %Flow;&gt;
&lt;!ATTLIST li
  %attrs;
  &gt;

&lt;!-- definition lists - dt for term, dd for its definition --&gt;

&lt;!ELEMENT dl (dt|dd)+&gt;
&lt;!ATTLIST dl
  %attrs;
  &gt;

&lt;!ELEMENT dt %Inline;&gt;
&lt;!ATTLIST dt
  %attrs;
  &gt;

&lt;!ELEMENT dd %Flow;&gt;
&lt;!ATTLIST dd
  %attrs;
  &gt;

&lt;!--=================== Address ==========================================--&gt;

&lt;!-- information on author --&gt;

&lt;!ELEMENT address %Inline;&gt;
&lt;!ATTLIST address
  %attrs;
  &gt;

&lt;!--=================== Horizontal Rule ==================================--&gt;

&lt;!ELEMENT hr EMPTY&gt;
&lt;!ATTLIST hr
  %attrs;
  &gt;

&lt;!--=================== Preformatted Text ================================--&gt;

&lt;!-- content is %Inline; excluding "img|object|big|small|sub|sup" --&gt;

&lt;!ELEMENT pre %pre.content;&gt;
&lt;!ATTLIST pre
  %attrs;
  xml:space (preserve) #FIXED ''preserve''
  &gt;

&lt;!--=================== Block-like Quotes ================================--&gt;

&lt;!ELEMENT blockquote %Block;&gt;
&lt;!ATTLIST blockquote
  %attrs;
  cite        %URI;          #IMPLIED
  &gt;

&lt;!--=================== Inserted/Deleted Text ============================--&gt;

&lt;!--
  ins/del are allowed in block and inline content, but its
  inappropriate to include block content within an ins element
  occurring in inline content.
--&gt;
&lt;!ELEMENT ins %Flow;&gt;
&lt;!ATTLIST ins
  %attrs;
  cite        %URI;          #IMPLIED
  datetime    %Datetime;     #IMPLIED
  &gt;

&lt;!ELEMENT del %Flow;&gt;
&lt;!ATTLIST del
  %attrs;
  cite        %URI;          #IMPLIED
  datetime    %Datetime;     #IMPLIED
  &gt;

&lt;!--================== The Anchor Element ================================--&gt;

&lt;!-- content is %Inline; except that anchors shouldn''t be nested --&gt;

&lt;!ELEMENT a %a.content;&gt;
&lt;!ATTLIST a
  %attrs;
  %focus;
  charset     %Charset;      #IMPLIED
  type        %ContentType;  #IMPLIED
  name        NMTOKEN        #IMPLIED
  href        %URI;          #IMPLIED
  hreflang    %LanguageCode; #IMPLIED
  rel         %LinkTypes;    #IMPLIED
  rev         %LinkTypes;    #IMPLIED
  shape       %Shape;        "rect"
  coords      %Coords;       #IMPLIED
  &gt;

&lt;!--===================== Inline Elements ================================--&gt;

&lt;!ELEMENT span %Inline;&gt; &lt;!-- generic language/style container --&gt;
&lt;!ATTLIST span
  %attrs;
  &gt;

&lt;!ELEMENT bdo %Inline;&gt;  &lt;!-- I18N BiDi over-ride --&gt;
&lt;!ATTLIST bdo
  %coreattrs;
  %events;
  lang        %LanguageCode; #IMPLIED
  xml:lang    %LanguageCode; #IMPLIED
  dir         (ltr|rtl)      #REQUIRED
  &gt;

&lt;!ELEMENT br EMPTY&gt;   &lt;!-- forced line break --&gt;
&lt;!ATTLIST br
  %coreattrs;
  &gt;

&lt;!ELEMENT em %Inline;&gt;   &lt;!-- emphasis --&gt;
&lt;!ATTLIST em %attrs;&gt;

&lt;!ELEMENT strong %Inline;&gt;   &lt;!-- strong emphasis --&gt;
&lt;!ATTLIST strong %attrs;&gt;

&lt;!ELEMENT dfn %Inline;&gt;   &lt;!-- definitional --&gt;
&lt;!ATTLIST dfn %attrs;&gt;

&lt;!ELEMENT code %Inline;&gt;   &lt;!-- program code --&gt;
&lt;!ATTLIST code %attrs;&gt;

&lt;!ELEMENT samp %Inline;&gt;   &lt;!-- sample --&gt;
&lt;!ATTLIST samp %attrs;&gt;

&lt;!ELEMENT kbd %Inline;&gt;  &lt;!-- something user would type --&gt;
&lt;!ATTLIST kbd %attrs;&gt;

&lt;!ELEMENT var %Inline;&gt;   &lt;!-- variable --&gt;
&lt;!ATTLIST var %attrs;&gt;

&lt;!ELEMENT cite %Inline;&gt;   &lt;!-- citation --&gt;
&lt;!ATTLIST cite %attrs;&gt;

&lt;!ELEMENT abbr %Inline;&gt;   &lt;!-- abbreviation --&gt;
&lt;!ATTLIST abbr %attrs;&gt;

&lt;!ELEMENT acronym %Inline;&gt;   &lt;!-- acronym --&gt;
&lt;!ATTLIST acronym %attrs;&gt;

&lt;!ELEMENT q %Inline;&gt;   &lt;!-- inlined quote --&gt;
&lt;!ATTLIST q
  %attrs;
  cite        %URI;          #IMPLIED
  &gt;

&lt;!ELEMENT sub %Inline;&gt; &lt;!-- subscript --&gt;
&lt;!ATTLIST sub %attrs;&gt;

&lt;!ELEMENT sup %Inline;&gt; &lt;!-- superscript --&gt;
&lt;!ATTLIST sup %attrs;&gt;

&lt;!ELEMENT tt %Inline;&gt;   &lt;!-- fixed pitch font --&gt;
&lt;!ATTLIST tt %attrs;&gt;

&lt;!ELEMENT i %Inline;&gt;   &lt;!-- italic font --&gt;
&lt;!ATTLIST i %attrs;&gt;

&lt;!ELEMENT b %Inline;&gt;   &lt;!-- bold font --&gt;
&lt;!ATTLIST b %attrs;&gt;

&lt;!ELEMENT big %Inline;&gt;   &lt;!-- bigger font --&gt;
&lt;!ATTLIST big %attrs;&gt;

&lt;!ELEMENT small %Inline;&gt;   &lt;!-- smaller font --&gt;
&lt;!ATTLIST small %attrs;&gt;

&lt;!--==================== Object ======================================--&gt;
&lt;!--
  object is used to embed objects as part of HTML pages.
  param elements should precede other content. Parameters
  can also be expressed as attribute/value pairs on the
  object element itself when brevity is desired.
--&gt;

&lt;!ELEMENT object (#PCDATA | param | %block; | form | %inline; | %misc;)*&gt;
&lt;!ATTLIST object
  %attrs;
  declare     (declare)      #IMPLIED
  classid     %URI;          #IMPLIED
  codebase    %URI;          #IMPLIED
  data        %URI;          #IMPLIED
  type        %ContentType;  #IMPLIED
  codetype    %ContentType;  #IMPLIED
  archive     %UriList;      #IMPLIED
  standby     %Text;         #IMPLIED
  height      %Length;       #IMPLIED
  width       %Length;       #IMPLIED
  usemap      %URI;          #IMPLIED
  name        NMTOKEN        #IMPLIED
  tabindex    %Number;       #IMPLIED
  &gt;

&lt;!--
  param is used to supply a named property value.
  In XML it would seem natural to follow RDF and support an
  abbreviated syntax where the param elements are replaced
  by attribute value pairs on the object start tag.
--&gt;
&lt;!ELEMENT param EMPTY&gt;
&lt;!ATTLIST param
  id          ID             #IMPLIED
  name        CDATA          #IMPLIED
  value       CDATA          #IMPLIED
  valuetype   (data|ref|object) "data"
  type        %ContentType;  #IMPLIED
  &gt;

&lt;!--=================== Images ===========================================--&gt;

&lt;!--
   To avoid accessibility problems for people who aren''t
   able to see the image, you should provide a text
   description using the alt and longdesc attributes.
   In addition, avoid the use of server-side image maps.
   Note that in this DTD there is no name attribute. That
   is only available in the transitional and frameset DTD.
--&gt;

&lt;!ELEMENT img EMPTY&gt;
&lt;!ATTLIST img
  %attrs;
  src         %URI;          #REQUIRED
  alt         %Text;         #REQUIRED
  longdesc    %URI;          #IMPLIED
  height      %Length;       #IMPLIED
  width       %Length;       #IMPLIED
  usemap      %URI;          #IMPLIED
  ismap       (ismap)        #IMPLIED
  &gt;

&lt;!-- usemap points to a map element which may be in this document
  or an external document, although the latter is not widely supported --&gt;

&lt;!--================== Client-side image maps ============================--&gt;

&lt;!-- These can be placed in the same document or grouped in a
     separate document although this isn''t yet widely supported --&gt;

&lt;!ELEMENT map ((%block; | form | %misc;)+ | area+)&gt;
&lt;!ATTLIST map
  %i18n;
  %events;
  id          ID             #REQUIRED
  class       CDATA          #IMPLIED
  style       %StyleSheet;   #IMPLIED
  title       %Text;         #IMPLIED
  name        NMTOKEN        #IMPLIED
  &gt;

&lt;!ELEMENT area EMPTY&gt;
&lt;!ATTLIST area
  %attrs;
  %focus;
  shape       %Shape;        "rect"
  coords      %Coords;       #IMPLIED
  href        %URI;          #IMPLIED
  nohref      (nohref)       #IMPLIED
  alt         %Text;         #REQUIRED
  &gt;

&lt;!--================ Forms ===============================================--&gt;
&lt;!ELEMENT form %form.content;&gt;   &lt;!-- forms shouldn''t be nested --&gt;

&lt;!ATTLIST form
  %attrs;
  action      %URI;          #REQUIRED
  method      (get|post)     "get"
  enctype     %ContentType;  "application/x-www-form-urlencoded"
  onsubmit    %Script;       #IMPLIED
  onreset     %Script;       #IMPLIED
  accept      %ContentTypes; #IMPLIED
  accept-charset %Charsets;  #IMPLIED
  &gt;

&lt;!--
  Each label must not contain more than ONE field
  Label elements shouldn''t be nested.
--&gt;
&lt;!ELEMENT label %Inline;&gt;
&lt;!ATTLIST label
  %attrs;
  for         IDREF          #IMPLIED
  accesskey   %Character;    #IMPLIED
  onfocus     %Script;       #IMPLIED
  onblur      %Script;       #IMPLIED
  &gt;

&lt;!ENTITY % InputType
  "(text | password | checkbox |
    radio | submit | reset |
    file | hidden | image | button)"
   &gt;

&lt;!-- the name attribute is required for all but submit &amp; reset --&gt;

&lt;!ELEMENT input EMPTY&gt;     &lt;!-- form control --&gt;
&lt;!ATTLIST input
  %attrs;
  %focus;
  type        %InputType;    "text"
  name        CDATA          #IMPLIED
  value       CDATA          #IMPLIED
  checked     (checked)      #IMPLIED
  disabled    (disabled)     #IMPLIED
  readonly    (readonly)     #IMPLIED
  size        CDATA          #IMPLIED
  maxlength   %Number;       #IMPLIED
  src         %URI;          #IMPLIED
  alt         CDATA          #IMPLIED
  usemap      %URI;          #IMPLIED
  onselect    %Script;       #IMPLIED
  onchange    %Script;       #IMPLIED
  accept      %ContentTypes; #IMPLIED
  &gt;

&lt;!ELEMENT select (optgroup|option)+&gt;  &lt;!-- option selector --&gt;
&lt;!ATTLIST select
  %attrs;
  name        CDATA          #IMPLIED
  size        %Number;       #IMPLIED
  multiple    (multiple)     #IMPLIED
  disabled    (disabled)     #IMPLIED
  tabindex    %Number;       #IMPLIED
  onfocus     %Script;       #IMPLIED
  onblur      %Script;       #IMPLIED
  onchange    %Script;       #IMPLIED
  &gt;

&lt;!ELEMENT optgroup (option)+&gt;   &lt;!-- option group --&gt;
&lt;!ATTLIST optgroup
  %attrs;
  disabled    (disabled)     #IMPLIED
  label       %Text;         #REQUIRED
  &gt;

&lt;!ELEMENT option (#PCDATA)&gt;     &lt;!-- selectable choice --&gt;
&lt;!ATTLIST option
  %attrs;
  selected    (selected)     #IMPLIED
  disabled    (disabled)     #IMPLIED
  label       %Text;         #IMPLIED
  value       CDATA          #IMPLIED
  &gt;

&lt;!ELEMENT textarea (#PCDATA)&gt;     &lt;!-- multi-line text field --&gt;
&lt;!ATTLIST textarea
  %attrs;
  %focus;
  name        CDATA          #IMPLIED
  rows        %Number;       #REQUIRED
  cols        %Number;       #REQUIRED
  disabled    (disabled)     #IMPLIED
  readonly    (readonly)     #IMPLIED
  onselect    %Script;       #IMPLIED
  onchange    %Script;       #IMPLIED
  &gt;

&lt;!--
  The fieldset element is used to group form fields.
  Only one legend element should occur in the content
  and if present should only be preceded by whitespace.
--&gt;
&lt;!ELEMENT fieldset (#PCDATA | legend | %block; | form | %inline; | %misc;)*&gt;
&lt;!ATTLIST fieldset
  %attrs;
  &gt;

&lt;!ELEMENT legend %Inline;&gt;     &lt;!-- fieldset label --&gt;
&lt;!ATTLIST legend
  %attrs;
  accesskey   %Character;    #IMPLIED
  &gt;

&lt;!--
 Content is %Flow; excluding a, form and form controls
--&gt;
&lt;!ELEMENT button %button.content;&gt;  &lt;!-- push button --&gt;
&lt;!ATTLIST button
  %attrs;
  %focus;
  name        CDATA          #IMPLIED
  value       CDATA          #IMPLIED
  type        (button|submit|reset) "submit"
  disabled    (disabled)     #IMPLIED
  &gt;

&lt;!--======================= Tables =======================================--&gt;

&lt;!-- Derived from IETF HTML table standard, see [RFC1942] --&gt;

&lt;!--
 The border attribute sets the thickness of the frame around the
 table. The default units are screen pixels.

 The frame attribute specifies which parts of the frame around
 the table should be rendered. The values are not the same as
 CALS to avoid a name clash with the valign attribute.
--&gt;
&lt;!ENTITY % TFrame "(void|above|below|hsides|lhs|rhs|vsides|box|border)"&gt;

&lt;!--
 The rules attribute defines which rules to draw between cells:

 If rules is absent then assume:
     "none" if border is absent or border="0" otherwise "all"
--&gt;

&lt;!ENTITY % TRules "(none | groups | rows | cols | all)"&gt;
 
&lt;!-- horizontal alignment attributes for cell contents

  char        alignment char, e.g. char='':''
  charoff     offset for alignment char
--&gt;
&lt;!ENTITY % cellhalign
  "align      (left|center|right|justify|char) #IMPLIED
   char       %Character;    #IMPLIED
   charoff    %Length;       #IMPLIED"
  &gt;

&lt;!-- vertical alignment attributes for cell contents --&gt;
&lt;!ENTITY % cellvalign
  "valign     (top|middle|bottom|baseline) #IMPLIED"
  &gt;

&lt;!ELEMENT table
     (caption?, (col*|colgroup*), thead?, tfoot?, (tbody+|tr+))&gt;
&lt;!ELEMENT caption  %Inline;&gt;
&lt;!ELEMENT thead    (tr)+&gt;
&lt;!ELEMENT tfoot    (tr)+&gt;
&lt;!ELEMENT tbody    (tr)+&gt;
&lt;!ELEMENT colgroup (col)*&gt;
&lt;!ELEMENT col      EMPTY&gt;
&lt;!ELEMENT tr       (th|td)+&gt;
&lt;!ELEMENT th       %Flow;&gt;
&lt;!ELEMENT td       %Flow;&gt;

&lt;!ATTLIST table
  %attrs;
  summary     %Text;         #IMPLIED
  width       %Length;       #IMPLIED
  border      %Pixels;       #IMPLIED
  frame       %TFrame;       #IMPLIED
  rules       %TRules;       #IMPLIED
  cellspacing %Length;       #IMPLIED
  cellpadding %Length;       #IMPLIED
  &gt;

&lt;!ATTLIST caption
  %attrs;
  &gt;

&lt;!--
colgroup groups a set of col elements. It allows you to group
several semantically related columns together.
--&gt;
&lt;!ATTLIST colgroup
  %attrs;
  span        %Number;       "1"
  width       %MultiLength;  #IMPLIED
  %cellhalign;
  %cellvalign;
  &gt;

&lt;!--
 col elements define the alignment properties for cells in
 one or more columns.

 The width attribute specifies the width of the columns, e.g.

     width=64        width in screen pixels
     width=0.5*      relative width of 0.5

 The span attribute causes the attributes of one
 col element to apply to more than one column.
--&gt;
&lt;!ATTLIST col
  %attrs;
  span        %Number;       "1"
  width       %MultiLength;  #IMPLIED
  %cellhalign;
  %cellvalign;
  &gt;

&lt;!--
    Use thead to duplicate headers when breaking table
    across page boundaries, or for static headers when
    tbody sections are rendered in scrolling panel.

    Use tfoot to duplicate footers when breaking table
    across page boundaries, or for static footers when
    tbody sections are rendered in scrolling panel.

    Use multiple tbody sections when rules are needed
    between groups of table rows.
--&gt;
&lt;!ATTLIST thead
  %attrs;
  %cellhalign;
  %cellvalign;
  &gt;

&lt;!ATTLIST tfoot
  %attrs;
  %cellhalign;
  %cellvalign;
  &gt;

&lt;!ATTLIST tbody
  %attrs;
  %cellhalign;
  %cellvalign;
  &gt;

&lt;!ATTLIST tr
  %attrs;
  %cellhalign;
  %cellvalign;
  &gt;


&lt;!-- Scope is simpler than headers attribute for common tables --&gt;
&lt;!ENTITY % Scope "(row|col|rowgroup|colgroup)"&gt;

&lt;!-- th is for headers, td for data and for cells acting as both --&gt;

&lt;!ATTLIST th
  %attrs;
  abbr        %Text;         #IMPLIED
  axis        CDATA          #IMPLIED
  headers     IDREFS         #IMPLIED
  scope       %Scope;        #IMPLIED
  rowspan     %Number;       "1"
  colspan     %Number;       "1"
  %cellhalign;
  %cellvalign;
  &gt;

&lt;!ATTLIST td
  %attrs;
  abbr        %Text;         #IMPLIED
  axis        CDATA          #IMPLIED
  headers     IDREFS         #IMPLIED
  scope       %Scope;        #IMPLIED
  rowspan     %Number;       "1"
  colspan     %Number;       "1"
  %cellhalign;
  %cellvalign;
  &gt;
'</body>

<body package="XMLBroken">sampleResponse
        ^'&lt;!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"&gt;&lt;html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"&gt;&lt;head&gt;&lt;title&gt;Simple Example&lt;/title&gt;&lt;meta http-equiv="Content-Type" content="text/html;charset=utf-8; charset=utf-8"/&gt;&lt;/head&gt;&lt;body&gt;&lt;h1&gt;This is an example&lt;/h1&gt;&lt;/body&gt;&lt;/html&gt;'</body>
</methods>

<methods>
<class-id>XMLBroken</class-id> <category>running</category>

<body package="XMLBroken">testParse
        | resolver parser |
        resolver := [:publicID :systemID | publicID = '-//W3C//DTD XHTML 1.0 Strict//EN'
                ifTrue: [self xhtml1StrictDtd readStream]
                ifFalse: [XML.ResolveEmptyResource]].
        (parser := XML.XMLParser new) handlers: XML.NullSAXDriver new; entityResolver: (XML.PluggableEntityResolver withBlock: resolver).
        parser on: self sampleResponse readStream; scanDocument</body>
</methods>



</st-source>

<?xml version="1.0"?>

<st-source>
<time-stamp>From VisualWorks® NonCommercial, 7.6 of March 3, 2008 on April 23, 2009 at 11:44:35 pm</time-stamp>


<methods>
<class-id>XML.XMLParser</class-id> <category>DTD processing</category>

<body package="XML" selector="systemLiteral">systemLiteral

        | lit |
        lit := self quotedString.
        (lit includes: $#)
                ifTrue: [self malformed: #noFragmentsInSystemIDs &lt;&lt; #xml &gt;&gt; 'Fragments in System IDs are not supported'].
        ^lit isEmpty
                ifTrue: [lit]
                ifFalse: [(self latestURI asURI resolvePath: lit) asString]</body>
</methods>

</st-source>

_______________________________________________
vwnc mailing list
[hidden email]
http://lists.cs.uiuc.edu/mailman/listinfo/vwnc