Name
XMLDecl -- parser has reached an XML declaration (V2.0)
Synopsis
XMLDecl(p, version$, encoding$, standalone)
Function
This function is called s called for XML declarations and also for text declarations discovered in external entities. The way to distinguish is that the version$ parameter will be Nil for text declarations. The encoding$ parameter may be Nil for an XML declaration. The standalone argument will contain -1, 0, or 1 indicating respectively that there was no standalone parameter in the declaration, that it was given as no, or that it was given as yes.

Parameters
p
parser handle
version$
version in XML declaration
encoding$
encoding in XML declaration
standalone
stand-alone state of the declaration, can be 0, -1 or 1 (see above)
Example
Function p_XMLDecl(p, version$, encoding$, standalone)
   DebugPrint(version$, encoding$, standalone)
EndFunction

p = xml.CreateParser({XMLDecl = p_XMLDecl})
p:Parse([[<?xml version="1.0" encoding="ISO-8859-1"?><body/>]])
p:Free()
The code above will prints "1.0 ISO-8859-1 -1".

Show TOC