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
Show tree view Topic
Topic Page 1 2 3 4 5 6 7 8 9 Go to previous topicPrev TopicGo to next topicNext Topic
Matt WilsonSubject: Generating XSLT to match a schema version change
Author: Matt Wilson
Date: 23 Oct 2007 10:07 PM
NEMMCO has a schema (aseXML) which changes periodically to allow for new features. Not all users can change their systems at the same time as NEMMCO. Generating the XSL to convert XML files conforming to one version of the schema to another is easy in concept - but is a little harder when the schema definition is about 500Kb. Stylus Studio allows comparison of the schema files (.xsd) to show the differences, and can use the mapper to show the two schemas - but I cannot find an easy way to just identify the XSLT needed to transform the differences and just copy the rest.

For example, if all that changed from version 1 to version 2 is adding a new element (NewElement) then the templates needed to convert version 2 XML files back to version 1 are just:
<xsl:template match="NewElement"/><!-- just drop new element-->
<xsl:template match="@*|node()"><!-- identity transform -->
<xsl:apply-templates select="@*|node()"/>

For those that want the full schema, see www.nemmco.com.au/asexml and we want to be able to generate XSLT to go from latest release to any earlier release (e.g. r10). The question is: How to do it using Stylus Studio? (or any other tools?)

(Deleted User) Subject: Generating XSLT to match a schema version change
Author: (Deleted User)
Date: 25 Oct 2007 08:00 AM
Hi Matt,
your problem doesn't have an easy solution; you can use Mapper to visually link all the elements from the latest schema to the previous release, but this can be a time-consuming operation, generating a complex stylesheet (as you would be building the final XML document, instead of using a "copy everything but XYZ" approach).
If you want to use the latter approach, you could write an XSL stylesheet that reads the two schemas and writes a new XSL stylesheet; it finds out the new element definitions and generates a template for each one to strip it from the source XML.

Hope this helps,

Matt WilsonSubject: Generating XSLT to match a schema version change
Author: Matt Wilson
Date: 25 Oct 2007 09:50 PM
Thanks Alberto. I had hoped that the general problem of managing schema versions might have had better support from the software product developers. My background is as a technical writer and I've been using XML occasionally since before it was a standard. This is the first time I've been asked to look at high-volume production data. I am disappointed with the supposedly leading products that they have not addressed such an obvious situation as the progressive change of a schema, albeit this one is large and complex.

If a business controls both the production and consumption of an XML data stream, ensuring compliance to change-over dates is just a matter of internal project management. If different businesses have each end, then the receiver is at the mercy of the sender - and there is not always enough resources to meet the deadline. I'd have thought this was a common business scenario, and I thought that XML was used extensively enough for inter-business data transfer, for such transition issues to have been widely experienced and general solutions developed.

Oh well. It looks like I manually do something quickly, then the XSL generator and maybe I'll have to see about creating the product - if nobody beats me to it!

Topic Page 1 2 3 4 5 6 7 8 9 Go to previous topicPrev TopicGo to next topicNext Topic
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!  

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.