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)
-> + JVM detection not finding JDK ... (2)
-> - stylus studio version 2011 pro... (1)
-> - WSDL 2.0 (1)
-> + Special characters in xml (2)
-> + cannot connect to mysql commun... (2)
-> + create a report from an existi... (2)
-> + Content not allowed in prolog (2)
-> + DB IInformix with database loc... (8)
-> + Stylus Report Designer (XML Re... (4)
-> - error: cos-nonambig: Content m... (1)
-> - UNIX .csv conversion and java ... (1)
-> + Nillable element, Validation e... (2)
-> + EDI Converter Error (2)
-> - CSV FILE INTO CARGO-IMP MESSAG... (1)
-> + BUG: Validation in piple will ... (2)
-> + Is there a 64-Bit Stylus Studi... (2)
-> + BUG: Read structure on SQL Ser... (3)
-> + [Customer Toyoto Motors Europe... (2)
-> - Get a schema for a JSON file (1)
-> + UNOC:4 forces converter to inp... (2)
-> - java class for xs:any elements (1)
-> + changing component separator (3)
-> + Output view disappeared (6)
-> + How to convert deeply nested X... (2)
-> + javax.net.ssl.SSLException (4)
-> + error converting .csv in a uni... (10)
-> + Menu bar disappeared (3)
-> - No Topic (1)
-> - What does "XML" stand for? So... (1)
-> - So XML is just HTML on steroid... (1)
-> + XHTML to XML conversion (2)
-> - Stylus Studio with DDTek xml c... (1)
-> + Installation fails (3)
-> + Is there a keyboard shortcut t... (2)
-> - Bug: Adding a scenario to an X... (1)
-> - Bug: Bug reporting outputs an ... (1)
-> - Tradacoms Invoice 9 Batch Quer... (1)
-> - problem with the product regis... (1)
-> + Help: Documentation... ends in... (2)
-> + How to install LIBxml2 (2)
-> - line numbers in validator outp... (1)
-> + Sharing Viollation in Stylus v... (5)
-> - support for asp.net in stylus... (1)
-> + how to use the latest java xml... (2)
-> - how to show xsd element relate... (1)
-> - Testing Stylus in a secure env... (1)
-> + How do you remove linemarkings... (3)
-> - Bug: Comment / Uncomment via C... (1)
-> + Setting escape (release) chara... (2)
-> + Xalan processor not showing up (2)
-> + Is there a keyboard shortcut t... (3)
-> - Modifying reports outside of S... (1)
-> + Run ALL Scenarios? (2)
-> + predefined macros ${ (4)
-> - TRADACOMS - EDI (1)
-> + SUM not working (3)
-> - Large xml file handling gives ... (1)
-> + 2011 Enterprise code folding f... (9)
-> + custom xml converter (3)
-> - Start Excel feter the mapping ... (1)
-> + Uninstall (2)
-> + xpath to compare two values fr... (2)
-> - xpath to compare two values fr... (1)
-> + SS2011 cannot save XML files u... (3)
-> + SS 2011 Enterprise saying 2010... (2)
-> + How to change the way whitespa... (7)
-> + Updating Relational Data Using... (4)
-> - Contract Stylus Studio help. ... (1)
-> + UTF_8 characters not displayed (6)
-> + Problem XSL to PDF ( dont reco... (2)
-> + HIPAA EDI - Looping question (4)
-> - HIPAA EDI - Looping question (1)
-> + Does XML Report support column... (2)
-> + Limited choice of XSL elements... (2)
-> + Single Source Publishing? (3)
-> - Stylus Stodio License (1)
-> - Stylus Stodio License (1)
-> + relax ng (3)
-> + having problem converting csv ... (8)
-> + error when selecting items fro... (2)
-> + CSV File to XML (3)
-> + Software registration - How to... (4)
-> - Software registration - How to... (1)
-> + .Net Saxon not supported by th... (2)
-> + How do I extend the Evaluation... (2)
-> + dst file (4)
-> + Flat File Custom XML conversio... (4)
-> + converting ascii file to xml f... (2)
-> + Evaluation Copy of Stylus Stud... (8)
-> + Batch process for soap (4)
-> + Strange error when running gen... (5)
-> + Merge Files (2)
-> + Convert cvs to XML (2)
-> + Stylus studio 2010 crashes in ... (5)
-> + excel to text (2)
-> + licence key? (2)
-> + JVM Heap error (4)
-> + How Do I clean TXT File? (2)
-> + SS Web Service Call Tester Pay... (3)
-> - SS Web Service Call Tester Mic... (1)
-- Previous [421-440] [441-460] [461-480] 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
Thomas RichburgSubject: How Come Stylus Studio Fails To Validate This Derived Date According to xsi;type specification and not the base type?
Author: Thomas Richburg
Date: 06 Aug 2010 01:25 PM
The following XML file is validated by Microsoft Web Studio validation processor, but receives eight error messages in Stylus Studio (which appear to stem from failure to associate the correct derived type as specified by the xsi:type attribute).

XML File Content:

<?xml version="1.0"?>
<OOC:DerivedTypeTester xsi:type="OOC:ADerivedClassByExtensionOfBaseClassDerivedByExtensionType"
xmlns:OOC="http://www.IntelligentKnowledgeProcessingSolutions.com/OasisObjectClass" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://www.IntelligentKnowledgeProcessingSolutions.com/OasisObjectClass file:///c:/TJRWork/VisualStudio2008Projects/TheFinalFrontier/OasisApplicationDevelopementServices/OasisApplicationScriptMngr/DerivedTypeTestTypeDef.xsd"
typeID="1" typeName="ADerivedClassByRestrictionType" InstName="ADerivedClassByExtension" >
<AnElement >ThisIsATest</AnElement>
<AnotherElement>This Is A Test</AnotherElement>
</OOC:DerivedTypeTester>

The associated schema for this XML File:

<?xml version="1.0"?>
<xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema"
targetNamespace="http://www.IntelligentKnowledgeProcessingSolutions.com/OasisObjectClass"
xmlns:OOC="http://www.IntelligentKnowledgeProcessingSolutions.com/OasisObjectClass" >
<xsd:annotation>
<xsd:documentation>
</xsd:documentation>
</xsd:annotation>
<!--xsd:element ref="DerivedTypeTester" /-->
<xsd:element name="DerivedTypeTester" type="OOC:ABaseClassType" />
<!--xsd:element name="DerivedTypeTester" type="OOC:DerivedTypeTesterType" /-->
<xsd:complexType name="DerivedTypeTesterType" >
<xsd:sequence>
<xsd:element ref="OOC:ABaseClass" />
</xsd:sequence>
</xsd:complexType>
<xsd:element name="ABaseClass" type="OOC:ABaseClassType" abstract="false"/>
<xsd:complexType name="ABaseClassType">
<xsd:sequence>
</xsd:sequence>
<xsd:attribute name="typeName" type="xsd:NCName" default="ABaseType"/>
</xsd:complexType>
<xsd:element name="ADerivedClassByRestriction" type="OOC:ADerivedClassByRestrictionType"/>
<xsd:complexType name="ADerivedClassByRestrictionType">
<xsd:complexContent>
<xsd:restriction base="OOC:ABaseClassType">
<xsd:sequence>
</xsd:sequence>
<xsd:attribute name="typeName" type="xsd:NCName" fixed="ADerivedClassByRestrictionType"/>
</xsd:restriction>
</xsd:complexContent>
</xsd:complexType>
<xsd:element name="ADerivedClassByExtension" type="OOC:ADerivedClassByExtensionType"/>
<xsd:complexType name="ADerivedClassByExtensionType">
<xsd:complexContent>
<xsd:extension base="OOC:ABaseClassType">
<xsd:sequence>
<xsd:element name="AnElement" type="xsd:NCName"/>
</xsd:sequence>
<xsd:attribute name="InstName" type="xsd:NCName" fixed="ADerivedClassByExtension" use="required" />
</xsd:extension>
</xsd:complexContent>
</xsd:complexType>
<xsd:element name="ADerivedClassByExtensionOfBaseClassDerivedByRestriction" type="OOC:ADerivedClassByExtensionOfBaseClassDerivedByRestrictionType"/>
<xsd:complexType name="ADerivedClassByExtensionOfBaseClassDerivedByRestrictionType">
<xsd:complexContent>
<xsd:extension base="OOC:ADerivedClassByRestrictionType">
<xsd:sequence>
<xsd:element name="AnotherElement" type="xsd:string" />
</xsd:sequence>
<xsd:attribute name="typeID" type="xsd:integer" default="0" />
</xsd:extension>
</xsd:complexContent>
</xsd:complexType>
<xsd:element name="ADerivedClassByExtensionOfBaseClassDerivedByExtension" type="OOC:ADerivedClassByExtensionOfBaseClassDerivedByExtensionType"/>
<xsd:complexType name="ADerivedClassByExtensionOfBaseClassDerivedByExtensionType">
<xsd:complexContent>
<xsd:extension base="OOC:ADerivedClassByExtensionType">
<xsd:sequence>
<xsd:element name="AnotherElement" type="xsd:string" />
</xsd:sequence>
<xsd:attribute name="typeID" type="xsd:integer" default="0" />
</xsd:extension>
</xsd:complexContent>
</xsd:complexType>
</xsd:schema>

Please help me to understand what is going n here. It does not matter if my base type is abstract or not. Why the disagreement with Microsoft validation? Also, even with the Microsoft validated XML document (above) why won't it take qualified names for all elements and attributes related to the derived type?

Sincerely,


Thomas J. Richburg

Postnext
Ivan PedruzziSubject: How Come Stylus Studio Fails To Validate This Derived Date According to xsi;type specification and not the base type?
Author: Ivan Pedruzzi
Date: 06 Aug 2010 01:43 PM

Hi Thomas,

Different schema processor may deliver different result depending on the spec. interpretation.

The default processor in Stylus Studio is Apache Xerces C++.

Have you tried with other processors available in Stylus Studio?
http://www.stylusstudio.com/open_xsd_validation.html

Which processor will be used in production?


Ivan Pedruzzi
Stylus Studio Team

Postnext
Thomas RichburgSubject: How Come Stylus Studio Fails To Validate This Derived Date According to xsi;type specification and not the base type?
Author: Thomas Richburg
Date: 06 Aug 2010 04:33 PM
Thanks for your rapid response. I followed your advice and checked the
validity of the document against each of your supported validators. They all reported no errors except your default validator Xerces, which still reports eight. I still don't understand the reasons for the error when reading the W3C Specifications. Can you explain these errors from an XML Schema Validation point of view?

Errors received:
Validating DerivedTypeTesterDoc.xml...
file:///c:/TJRWork/VisualStudio2008Projects/TheFinalFrontier/OasisApplicationDevelopementServices/OasisApplicationScriptMngr/DerivedTypeTesterDoc.xml:5,111: attribute 'typeID' is not declared for element 'DerivedTypeTester'
file:///c:/TJRWork/VisualStudio2008Projects/TheFinalFrontier/OasisApplicationDevelopementServices/OasisApplicationScriptMngr/DerivedTypeTesterDoc.xml:5,111: attribute 'InstName' is not declared for element 'DerivedTypeTester'
file:///c:/TJRWork/VisualStudio2008Projects/TheFinalFrontier/OasisApplicationDevelopementServices/OasisApplicationScriptMngr/DerivedTypeTesterDoc.xml:6,3: no character data is allowed by content model
file:///c:/TJRWork/VisualStudio2008Projects/TheFinalFrontier/OasisApplicationDevelopementServices/OasisApplicationScriptMngr/DerivedTypeTesterDoc.xml:6,15: no declaration found for element 'AnElement'
file:///c:/TJRWork/VisualStudio2008Projects/TheFinalFrontier/OasisApplicationDevelopementServices/OasisApplicationScriptMngr/DerivedTypeTesterDoc.xml:7,3: no character data is allowed by content model
file:///c:/TJRWork/VisualStudio2008Projects/TheFinalFrontier/OasisApplicationDevelopementServices/OasisApplicationScriptMngr/DerivedTypeTesterDoc.xml:7,19: no declaration found for element 'AnotherElement'
file:///c:/TJRWork/VisualStudio2008Projects/TheFinalFrontier/OasisApplicationDevelopementServices/OasisApplicationScriptMngr/DerivedTypeTesterDoc.xml:8,1: no character data is allowed by content model
file:///c:/TJRWork/VisualStudio2008Projects/TheFinalFrontier/OasisApplicationDevelopementServices/OasisApplicationScriptMngr/DerivedTypeTesterDoc.xml:8,25: element 'AnElement' is not allowed for content model 'EMPTY'

The XML document DerivedTypeTesterDoc.xml is NOT valid (8 errors)

xsi:type support for specifying which derived type in the hiearchy of derived types is required when specifying the base type in the XML document. Part two of my post ask why the discrepancy. This happens to be a very important Schema feature that we use quite a bit. Is there a problem with Stylus Studio's internal Validator?

Sincerely,



Thomas J. Richburg

Postnext
Ivan PedruzziSubject: How Come Stylus Studio Fails To Validate This Derived Date According to xsi;type specification and not the base type?
Author: Ivan Pedruzzi
Date: 09 Aug 2010 02:25 PM

Hi Tom,

Sorry if it took a bit to answer the question.

Due to Xerces C++ limitation, the xsi:type attribute has to be after xsi:schemaLocation.

If you change the XML instance as follow it should validate fine.


<OOC:DerivedTypeTester
xsi:schemaLocation="http://www.IntelligentKnowledgeProcessingSolutions.com/OasisObjectClass DerivedTypeTestTypeDef.xsd"
xsi:type="OOC:ADerivedClassByExtensionOfBaseClassDerivedByExtensionType"
xmlns:OOC="http://www.IntelligentKnowledgeProcessingSolutions.com/OasisObjectClass"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
typeID="1"
typeName="ADerivedClassByRestrictionType"
InstName="ADerivedClassByExtension">

<AnElement>ThisIsATest</AnElement>
<AnotherElement>This Is A Test</AnotherElement>
</OOC:DerivedTypeTester>


Hope this helps
Ivan Pedruzzi
Stylus Studio Team
http://www.stylusstudio.com/xml_download.html

Postnext
Thomas RichburgSubject: How Come Stylus Studio Fails To Validate This Derived Date According to xsi;type specification and not the base type?
Author: Thomas Richburg
Date: 09 Aug 2010 03:38 PM
Hello Ian,

I tried your suggestion and Xerces did validate. This ordering restriction appears to be unique to Xerces. Perhaps you should alert other users to this fact.

Thanks muchly for resolving this issue with such a simple remedy. Non-validating errors like this one can render a sane person insane if one is not careful! Thanks again for your assistance.


Thomas Richburg

Posttop
Thomas RichburgSubject: How Come Stylus Studio Fails To Validate This Derived Date According to xsi;type specification and not the base type?
Author: Thomas Richburg
Date: 09 Aug 2010 03:41 PM
Hello Ivan,

Sorry for the mis-print of your name. By the way I prefer Thomas to Tom. I am often called by the Hebrew version of my name which is Toma.

Later!

   
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.