XML Editor
Sign up for a WebBoard account Sign Up Keyword Search Search More Options... Options
Chat Rooms Chat Help Help News News Log in to WebBoard Log in Not Logged in
Conferences Close Tree View
+ Stylus Studio Feature Requests (1192)
- Stylus Studio Technical Forum (14621)
-> - Stylus Studio - Registrar en o... (1)
-> + Stylus Studio - Registrar en o... (2)
-> + Can a pipeline send a file by ... (2)
-> + After Updateing WIN10 to WIN11... (12)
-> + Where do I add the custom java... (3)
-> + Where is the Diagram tab? (5)
-> + Applying XSLT to Word DOCX/XML (2)
-> - CSV conversion via ConvertToXM... (1)
-> + Text symbols in SS not same as... (4)
-> + Exposing xquery as webservice ... (6)
-> + Syntax Identifier (2)
-> + Saving a Converted XML as an X... (5)
-> + Output document cannot be pars... (4)
-> - Archiving output from conversi... (1)
-> + EDIFACT guideline from Stylus ... (3)
-> + CSV file putting all the data ... (5)
-> + Can't install Home version 64b... (5)
-> + presale - Can I covers this sc... (5)
-> + Problem with UNB (5)
-> + Splitting EDIFACT files pipeli... (4)
-- [1-20] [21-40] [41-60] Next
+ Website Feedback (249)
+ XSLT Help and Discussion (7625)
+ XQuery Help and Discussion (2017)
+ Stylus Studio FAQs (159)
+ Stylus Studio Code Samples & Utilities (364)
+ Stylus Studio Announcements (113)
Topic  
Postnext
(Deleted User) 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.

<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns="urn:dvdstore-schema" targetNamespace="urn:dvdstore-schema">
<xs:element name="dvd" type="xs:string" />
</xs:schema>
<pb:book price="7.99" xmlns:pb="urn:bookstore-schema">The Autobiography of Benjamin Franklin</pb:book>
<pd:dvd xmlns:pd="urn:dvdstore-schema">The Godfather</pd:dvd>
<pt:tape xmlns:pt="urn:tapestore-schema" xsi:schemaLocation="urn:tapestore-schema tape.xsd" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">Il Postino</pt:tape>

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)

Postnext
(Deleted User) 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.

Hope this helps,
Alberto

Posttop
(Deleted User) Subject: [OT] XML fragment - error explanation?
Author: (Deleted User)
Date: 01 Feb 2008 03:26 AM
A nice example from the MSDN documentation :)
But the .NET message is slightly more helpful than Xerces.

Ian Thomas
--------------
Stylus Studio 2008 XML Enterprise Suite R1 (Build 1050e)

   
Download A Free Trial of Stylus Studio 6 XML Professional Edition Today! Powered by Stylus Studio, the world's leading XML IDE for XML, XSLT, XQuery, XML Schema, DTD, XPath, WSDL, XHTML, SQL/XML, and XML Mapping!  
go

Log In Options

Site Map | Privacy Policy | Terms of Use | Trademarks
Stylus Scoop XML Newsletter:
W3C Member
Stylus Studio® and DataDirect XQuery ™are from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2016 All Rights Reserved.