Home. 
.

transparent

transparent

transparent

Altova Mailing List Archives


RE: Purpose of

From: "Adam Retter" <Adam.Retter@------------.--.-->
To: "Paul Kiel" <paul@-----------.--->, "Boris Kolpackov" <boris@-------------.--->, "Koray SAKIROGLU" <koray.sakiroglu@-----.--->
Date: 6/19/2008 5:23:00 PM


Thanks for all your help everyone.

Paul, your Schema Lightener looks very interesting, but a bit more than
I need for this. I think a straight XSLT copy pattern excluding empty
xs:sequence nodes should do the trick.

Cheers Adam.

-----Original Message-----
From: Paul Kiel [mailto:paul@x...] 
Sent: 19 June 2008 15:16
To: 'Boris Kolpackov'; Adam Retter
Cc: xmlschema-dev@w...
Subject: RE: Purpose of <xs:sequence/>

I've seen this happen a lot.  If a source has a very large data model
and/or
schema, they may only want to communicate to a trading partner the data
nodes they need to care about.  Who wants to wade through a sometimes
gigantic schema when you only need to populate a minority of fields?

And so the data model removes unneeded data elements from the schema.
This
leaves empty sequence nodes.

Removing unneeded elements from a schema is a common request I have
gotten
from clients.  It has caused me to create a real simple xslt based
solution
which I call the "schema lightener".  It is explained here:
http://www.xmlhelpline.com/tools/index.html

FWIW,

Paul Kiel

==========================
==========================
===
W. Paul Kiel
xmlHelpline.com Consulting
paul@x...
work: 919-846-0224
cell: 919-449-8801
website: http://www.xmlhelpline.com
Your helpline for data integration solutions.
==========================
==========================
===



-----Original Message-----
From: xmlschema-dev-request@w... [mailto:xmlschema-dev-request@w...]
On
Behalf Of Boris Kolpackov
Sent: Thursday, June 19, 2008 9:38 AM
To: Adam Retter
Cc: xmlschema-dev@w...
Subject: Re: Purpose of <xs:sequence/>


Hi Adam,

Adam Retter <Adam.Retter@l...> writes:

> <xs:complexType name="Classifier">
> 	<xs:sequence/>
> 	<xs:attribute name="pid" type="xs:string" use="required"/>
> </xs:complexType>

Having an empty sequence like this is valid and is equivalent to not
having one at all.

If the schema is auto-generated then it is easy to see why there
are empty sequence elements. The tool probably just adds the
sequence element (e.g., in DOM) and then iterates over elements
and adds them under it. In cases where there are no elements
you end up with an empty sequence. Someone may also want to do
this in a manually-created schema to highlight the fact that this
is a complex type with empty content (and not just a mistake).

Boris

-- 
Boris Kolpackov, Code Synthesis Tools
http://codesynthesis.com/~boris/blog
Open source XML data binding for C++:
http://codesynthesis.com/products/xsd
Mobile/embedded validating XML parsing:
http://codesynthesis.com/products/xsde




Registered Office: 7 Abbey Court, Eagle Way, Sowton, Exeter, Devon, EX2 7HY
Registered Number 2892803 Registered in England and Wales 

This email has been scanned by the MessageLabs Email Security System.
For more information please visit http://www.messagelabs.com/email 

The information contained in this e-mail is confidential and may be subject=
 to 
legal privilege. If you are not the intended recipient, you must not use, c=
opy, 
distribute or disclose the e-mail or any part of its contents or take any=
 
action in reliance on it. If you have received this e-mail in error, please=
 
e-mail the sender by replying to this message. All reasonable precautions h=
ave 
been taken to ensure no viruses are present in this e-mail. Landmark Inform=
ation
Group Limited cannot accept responsibility for loss or damage arising from =
the 
use of this e-mail or attachments and recommend that you subject these to=
 
your virus checking procedures prior to use.


From mike@s... Thu Jun 19 16:25:11 2008
Received: from maggie.w3.org ([193.51.208.68])
	by frink.w3.org with esmtp (Exim 4.63)
	(envelope-from <mike@s...>)
	id 1K9Mw


transparent
Print
Mail
Like It
Disclaimer
.

These Archives are provided for informational purposes only and have been generated directly from the Altova mailing list archive system and are comprised of the lists set forth on www.altova.com/list/index.html. Therefore, Altova does not warrant or guarantee the accuracy, reliability, completeness, usefulness, non-infringement of intellectual property rights, or quality of any content on the Altova Mailing List Archive(s), regardless of who originates that content. You expressly understand and agree that you bear all risks associated with using or relying on that content. Altova will not be liable or responsible in any way for any content posted including, but not limited to, any errors or omissions in content, or for any losses or damage of any kind incurred as a result of the use of or reliance on any content. This disclaimer and limitation on liability is in addition to the disclaimers and limitations contained in the Website Terms of Use and elsewhere on the site.

.
.

transparent

transparent