[XML-SIG] Bug or Delusion
Lars Marius Garshol
larsga@ifi.uio.no
26 Jan 1999 08:36:48 +0100
* John Eikenberry
|
| For an XML document to be valid, whenever an element type with an
| #IMPLIED attribute appears and does not have a value, the XML procesor
| must report the missing value and continue processing.
This quote is rather misleading. What it's trying to say (or should be
trying to say) is that #IMPLIED attributes are optional. Not the
value, but the whole attribute.
| In addition, in the ibtwsh.dtd (Itsy Bitsy Teeny Weeny Simple
| Hypertext DTD), they have the 'compact' attribute defined like this:
|
| <!ENTITY % compact "compact (compact) #IMPLIED">
|
| <!-- Definition list -->
| <!ELEMENT DL (DT|DD)+>
| <!ATTLIST DL
| %compact;
What this means is that DLs can look like:
<DL compact="compact">
or
<DL>
| And run the xvcmd over a test xml document. I get these errors:
|
| xmysql.xml:4:10: Document root element 'package' does not match declared
| root element
This means that you have
<!DOCTYPE something-other-than-package
in your document.
| xmysql.xml:40:9: '=' expected
| xmysql.xml:40:11: One of '>' or '/>' expected
| Parse complete, 3 error(s) and 0 warning(s)
|
| Are these errors the systems way of reporting the missing value (as the
| paragraph from my book states)? I thought that errors were fatal, and
| things to be avoided.
Not really, this is the systems way of reporting that your document is
not well-formed. All XML attributes _must_ have a value if they are
present in the start tag.
The XML grammar shows this clearly:
<URL:http://www.w3.org/TR/REC-xml#NT-Attribute>
| This seems to either be a mistake in xmlproc, or I'm not
| understanding this very well (probably the latter). If this is a
| mistake on my part, I'd appreciate any tips/advice.
Set
<setup c="c"/>
instead and it will work.
--Lars M.