Tolerance for using a PI to represent the XML declaration

The following tests assume that the TEST-STYLE PI is the
first child node of the document (that is that the XML 
declaration not being represented as a processing instruction):

NodeProcessingInstructionNodeType
NodeProcessingInstructionNodeAttributes
NodeProcessingInstructionNodeName
NodeProcessingInstructionNodeValue
ProcessingInstructionGetTarget
ProcessingInstructionGetData

NodeProcessingInstructionNodeType will succeed for the two
processors tested (MSXML 3 and Oracle XML Parser for Java 2)
that do use a pseudo-PI for the XML declaration.  Attributes
will fail for MSXML 3 since it apparently contains entries for 
the "encoding", "version" and "standalone" pseudo-attributes
instead of being the expected null.  The other tests will fail
since they will retrieve the "target" and "data" of the XML
declaration instead of the expected PI.

In my JUnit implementation of the test suite, a configuration 
switch can specify to use variants of these tests that 
tolerate the XML declaration being represented as a PI.

I would recommend that these tests be rewritten in a manner
that can tolerate the presence of a node for the XML declaration
and that a separate test be added if using a node for the XML
declaration is a non-conformant behavior.

Received on Thursday, 19 April 2001 15:45:02 UTC