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)
-> + Complex transactional CSV mapp... (2)
-> + XML Report (2)
-> - Create an XML feed for videos (1)
-> + word doc (2)
-> + Saving to a UNC path (7)
-> + sharing violation (3)
-> + Convert XML to XML (6)
-> + DBF converter with the Cyrilli... (3)
-> + Stylus Studio caching document... (3)
-> + Stylus Studio Online help inst... (9)
-> + specific colors (2)
-> + Formatting problems when creat... (2)
-> - Headers and Footers (1)
-> + XML output's a URL in Browser ... (2)
-> + Generating Java Code for XML (3)
-> + format dates in publisher (2)
-> + grouping in Stylus Studio Publ... (5)
-> + Can schema documentation title... (3)
-> + Stylus can not find the right ... (2)
-> - Problem to create Schema from ... (5)
-> ->Problem to create Schema ...
-> ->Problem to create Schema ...
-> ->Problem to create Schema ...
-> ->Problem to create Schema ...
-- Previous [301-320] [321-340] [341-360] 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
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-2016 All Rights Reserved.