Name
AttlistDecl -- handler for attlist declarations in the DTD (V2.0)
Synopsis
AttlistDecl(p, elname$, attname$, atttype$, dflt$, isrequired)
Function
This function is called for attlist declarations in the DTD. It is called for each attribute. So a single attlist declaration with multiple attributes declared will generate multiple calls to this handler. The elname$ parameter returns the name of the element for which the attribute is being declared. The attribute name is in the attname$ parameter. The attribute type is in the atttype$ parameter. It is the string representing the type in the declaration with whitespace removed.

The dflt$ parameter holds the default value. It will be Nil in the case of #IMPLIED or #REQUIRED attributes. You can distinguish these two cases by checking the isrequired parameter, which will be True in the case of #REQUIRED attributes. Attributes which are #FIXED will have also have a True isrequired, but they will have the non-Nil fixed value in the dflt parameter.

Parameters
p
parser handle
elname$
name of the element for which the attribute is being declared
attname$
attribute name
attype$
attribute type
dflt$
default value
isrequired
True or False depending on whether the attribute is required
Example
Function p_AttlistDecl(p, elname$, attname$, atttype$, dflt$, isreq)
   DebugPrint(elname$, attname$, atttype$, dflt$, isreq)
EndFunction

p = xml.CreateParser({AttlistDecl = p_AttlistDecl})
p:Parse([[
<?xml version="1.0" standalone="yes"?>
<!DOCTYPE lab_group [
   <!ELEMENT student_name (#PCDATA)>
   <!ATTLIST student_name student_no ID #REQUIRED>
   <!ATTLIST student_name tutor_1 IDREF #IMPLIED>
   <!ATTLIST student_name tutor_2 IDREF #IMPLIED>
]>
<root/>
]])
p:Free()
The code above shows how to handle attlist declarations.

Show TOC