Subject:[OT] XML fragment - error explanation? Author:(Deleted User) Date:31 Jan 2008 07:19 PM
I have another small XML fragment (put forward by Microsoft in one of their .NET code examples, as a piece of XML to be validated). I've used SS to check it, of course.
This is a bit confusing (on Microsoft's part):
The (obsolete, .NET v1.1) XmlValidatingReader class allows this in .NET 1.1 (but it fails in .NET 2.0+). This is probably related to the version of MSXML used (my guess).
The recommended (.NET 2.0 and later) XmlReader class picks up an error at line 4, position 4 ("There are multiple root elements. Line 4, position 4").
Loading the mixed.xml file into SS2008 tells me there's an error at (4,3): Parsing error in file:///c:/mixed.xml. FATAL ERROR: Expected comment or processing instruction.
So, the Stylus error is "Expected comment or processing instruction".
Can someone tell me where I can get a more detailed explanation of that? Clicking the Documentation tab pops up a msgbox then another, labelled [Static ]showing "Processing...", and does no more.
How should mixed.xml be written to be a valid xml data file?
Ian Thomas
--------------
Stylus Studio 2008 XML Enterprise Suite R1 (Build 1050e)
Subject:[OT] XML fragment - error explanation? Author:(Deleted User) Date:01 Feb 2008 02:24 AM
Hi Jan,
this is not (and has never been) legal XML, as it has 4 root elements (xs:schema, pb:book, pb:dvd, pt:tape) and XML only allows one root element plus comments and processing instructions at the top level. The error reported by Xerces points to the second root element and explain that it was only expecting a comment or a processing instruction.