IMPORTANT:
this is not a Support Forum! Experienced users might answer from time to time questions posted here. If you need a professional and reliable answer, or if you want to report a bug, please contact Altova Support instead.

Profile: UldisUlmanis
About
User Name: UldisUlmanis
Forum Rank: Newbie
Real Name:
Location Riga
Occupation:
Interests:
Gender: None Specified
Statistics
Joined: Monday, May 11, 2009
Last Visit: Wednesday, May 13, 2009 6:11:31 AM
Number of Posts: 2
[0.01% of all post / 0.00 posts per day]
Avatar
Last 10 Posts
Topic: Schema Agent for company's data structuring
Posted: Wednesday, May 13, 2009 5:48:13 AM
Hi !

I am very new to xml & Schema and one thing struck me as I started to get familiar with a field - low discussion level on internet about the topic.
It looks like:
a) everyone news everything about it (not likely)
OR
b) only a few professionals are busy with subject.

In my company programmers do not use Schema at all. If they need to exchange data via xml, they just make a sample xml and uses it as a template.

Needless to say that data structures in our company are:
1) made Ad Hoc
2) poorly documented
3) not integrated across applications

So management decided to put one man (me) to the task of structuring company's data by gradually introducing Schema.
To make thing more complicated only 2/5 of management believe that it is right way to sort thing out, another 2/5 thinks that it is just another BS and 1/5 don't care.
So I (and my chief) need to show some quick results.

We decided to:
1) base on Schema (& xml) one new application
2) re engineer one old using xsd/xml for data interfaces
3) gradually build one central master schema and derive application Schemas from that.

As I am main (and only) Schema Agent in our company I need some good tools.
I found that XMLSpy is good for individual Schemas, but I feel that I need some tool for Shema integration and maintenance.

Do you reccommend Altovas Schema Agent for this task ?
What are pros and cons ?
What are alternatives ?
Is there alternatives on bigger scale ? Maybe xml/xsd isn't right tool for the task ?
Topic: Derivation by restriction
Posted: Monday, May 11, 2009 12:11:15 PM
Hi, All !

I am new to Schema and xml and I am very confused by the topic of "Derivation by restriction"

1) Somewhere in books I've seen phrase: "It allows change derived elements *automatically* if base element is changed".

Good ! But, alas, when I use restriction on complex type, I need to copy/paste text of base type (adding "restriction base" clause) and then make allowed restrictions on that copy. Thus, what miracle could change my "copied text" in restricted element when base element (text) is changed ?
As I see it, only consequences of changing base type would be that restricted type could stop validating if it "goes outside" of base class

2) It seems that XMLSpy validates everything in restricted type not taking into account what is base type is. For example:
=================================================
<?xml version="1.0" encoding="UTF-8"?>
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" elementFormDefault="qualified" attributeFormDefault="unqualified">

<xs:complexType name="BaseUnr">
<xs:sequence>
<xs:element name="e1mandatory" type="xs:decimal" maxOccurs="3"/>
<xs:element name="e2mandatory" type="xs:decimal" maxOccurs="3"/>
<xs:element name="e1optional" type="xs:decimal" minOccurs="0" maxOccurs="3"/>
<xs:element name="e2optional" type="xs:decimal" minOccurs="0" maxOccurs="3"/>
</xs:sequence>
</xs:complexType>

<xs:complexType name="Restricted">
<xs:complexContent>
<xs:restriction base="BaseUnr">
<xs:sequence>
<xs:element name="e2mandatory" type="xs:string" maxOccurs="3"/>
<xs:element name="e1optional" type="xs:decimal" minOccurs="0" maxOccurs="3"/>
<xs:element name="e1additional" type="xs:dateTime" minOccurs="0" maxOccurs="3"/>
</xs:sequence>
</xs:restriction>
</xs:complexContent>
</xs:complexType>
</xs:schema>
=================================================
validates although it should't because I took away "e1mandatory", changed type of "e2mandatory" and added "e1additional" to base type "BaseUnr"

I am using XMLSpy professional v5.3, could it be the reason ?

Use of the Altova User Forum(s) is governed by the Altova Terms of Use.