On Thu, Sep 09, 2004 at 02:13:53PM -0700, Allen Brookes wrote: > Hi, > > I'm using the xerces xs package to parse a schema. If I have any whitespace > before the prolog xs fails to parse the document. Whitespace anywhere else > doesn't seem to cause any problems. Shouldn't whitespace be allowed before > the prolog?
No. Some older parsers allowed this but it is not permitted according to the spec. Here is the production for "document" from the spec: http://www.w3.org/TR/REC-xml/#NT-document If you chase the links down, there is no white space allowed before '<?xml'. The spec also says in section 2.1: 2.1 Well-Formed XML Documents [Definition: A textual object is a well-formed XML document if:] 1. Taken as a whole, it matches the production labeled document. This seems to make it clear that ignoring leading whitespace is not permissible. Everywhere whitespace can appear in a document, it is explicitly allowed by the grammar, represented by the production named "S": http://www.w3.org/TR/REC-xml/#NT-S -Steve -- Steven C. Ihde <[EMAIL PROTECTED]> PGP Key ID: 0x7793756D PGP Fingerprint: DC 55 8B CA 50 8B DD 75 67 45 96 4D FF 42 8A 6C --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]