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 (1123)
- Stylus Studio Technical Forum (13807)
-> + Mapping multiple files within ... (7)
-> + StylusStudio vs Altova vs BizT... (4)
-> + Command line execution (7)
-> + CSS and Styling in X15 (2)
-> + Ignores debug breakpoints in X... (5)
-> + Cursor dissapearing in Text vi... (4)
-> + compile error xquery java styl... (3)
-> + Stylus Studio Setup: Applicati... (10)
-> + Stylus StudioX15 Crashing whe... (4)
-> + Upgrade Stylus 14 to 15 (2)
-> + ACE Broker Download v2.5 (2)
-> + Help creating custom convertor (7)
-> + Problem saving Documentation (5)
-> + Registry keys for Stylus x15 (8)
-> + How to add a value when conver... (10)
-> + Stylus Studio Pro & Ent X15r1 ... (2)
-> + You need to install Java 2 SDK... (2)
-> - How to disable automatic and m... (1)
-> + Does Stylus Studio / DataDirec... (4)
-> + Stylus Studio fails with 'The ... (12)
-- [1-20] [21-40] [41-60] Next
+ Website Feedback (243)
+ XSLT Help and Discussion (7447)
+ XQuery Help and Discussion (1861)
+ Stylus Studio FAQs (159)
+ Stylus Studio Code Samples & Utilities (361)
+ Stylus Studio Announcements (113)
Topic  
Postnext
Fernando BizuetSubject: Problem to create Schema from XML Content
Author: Fernando Bizuet
Date: 27 Feb 2012 08:47 PM
Hello,

I'm not sure if it is a problem or new characteristic.

xsd files looks very different.

One year ago when I created schema from xml content I got a header like this:

<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" elementFormDefault="qualified">

and tags were like <xs:element name="" type="xs:string"/>

But, now I have gotten a different xsd file and header is like this:

<xsd:schema xmlns:xsd='http://www.w3.org/2001/XMLSchema'>

ans tags are:
<xsd:element name='idCorrida' type='xsd:string'></xsd:element>


How can I obtain the same header and same type of file?

is it important elementFormDefault="qualified"?
Are a check box to enable "elementFormDefault"?

Best regards.

Postnext
Ivan PedruzziSubject: Problem to create Schema from XML Content
Author: Ivan Pedruzzi
Date: 28 Feb 2012 03:20 PM

Hi Fernando,

Which Stylus Studio version you have been running before?

The declaration you have posted is invalid, the attribute "name" cannot be empty

<xs:element name="" type="xs:string"/>

The latest release defaults to elementFormDefault="qualified" globally but depending on how the XML instance is shaped it does override the elementForm, for example given the following XML document

<a:books
xmlns:a="urn:xml:books">
<book>
<title>Java Web Services</title>
</book>
</a:books>

Stylus Studio generates

<xs:schema
xmlns:xs="http://www.w3.org/2001/XMLSchema"
elementFormDefault="qualified"
targetNamespace="urn:xml:books"
xmlns:a="urn:xml:books">
<xs:element name="books">
<xs:complexType>
<xs:sequence>
<xs:element name="book" form="unqualified">
<xs:complexType>
<xs:sequence>
<xs:element name="title" form="unqualified" type="xs:string"/>
</xs:sequence>
</xs:complexType>
</xs:element>
</xs:sequence>
</xs:complexType>
</xs:element>
</xs:schema>



Hope this helps
Ivan Pedruzzi
Stylus Studio Team

Postnext
Fernando BizuetSubject: Problem to create Schema from XML Content
Author: Fernando Bizuet
Date: 28 Feb 2012 03:56 PM
Ivan. Thanks for your answer.

I have XML Enterprise Edition 2006, Release 3 and JVM 1.5.0_0b.

and yes, you are correct. Name attribute has a value. But this is not the problem. The problem is Stylus nowadays is creating xsd files in different way.

I attach a new and old xsd files.

Thanks.


Documentschema-10xml.xsd
New xsd file

DocumentDefPktRW-2.xsd
Old xsd file

Postnext
Ivan PedruzziSubject: Problem to create Schema from XML Content
Author: Ivan Pedruzzi
Date: 28 Feb 2012 04:43 PM

Yes, in most recent Stylus Studio versions, the schema generator uses the Russian doll style unless an element appears in multiple contexts in which case it defines a global definition.

The following is a quite sophisticated example with an heterogeneous list of media

<?xml version="1.0"?>
<media
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="booksns3.xsd">
<book>
<title>Java Web Services</title>
<isbn>AAA</isbn>
</book>
<dvd>
<title>24 Hours</title>
</dvd>
<book>
<title>C# Web Services</title>
<isbn>BBB</isbn>
</book>
</media>

The resulting schema makes use of a common ancestor “title” then derives “book” from “title” and defines dvd as type title.

<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" elementFormDefault="qualified">
<xs:element name="media">
<xs:complexType>
<xs:choice maxOccurs="unbounded">
<xs:element ref="book"/>
<xs:element ref="dvd"/>
</xs:choice>
</xs:complexType>
</xs:element>
<xs:element name="book">
<xs:complexType>
<xs:complexContent>
<xs:extension base="title">
<xs:sequence>
<xs:element ref="isbn"/>
</xs:sequence>
</xs:extension>
</xs:complexContent>
</xs:complexType>
</xs:element>
<xs:element name="isbn" type="xs:NCName"/>
<xs:element name="dvd" type="title"/>
<xs:complexType name="title">
<xs:sequence>
<xs:element ref="title"/>
</xs:sequence>
</xs:complexType>
<xs:element name="title" type="xs:string"/>
</xs:schema>

Stylus Studio does not allow to change strategy for schema generation.
May I ask you why this constitute a problem?

Ivan Pedruzzi
Stylus Studio Team

Posttop
Fernando BizuetSubject: Problem to create Schema from XML Content
Author: Fernando Bizuet
Date: 28 Feb 2012 05:47 PM
Thanks Ivan.

I have a old internal-application that only uses old style.

are there any way that Stylus produces old style?

best regards.

   
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-2011 All Rights Reserved.