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
Postnext
Ronan HayesSubject: Converting a new DTD to an Older DTD version
Author: Ronan Hayes
Date: 16 Feb 2005 09:02 AM
Hi all

First off this product is great its really saved me a hell of alot of time. But before I go ahead and buy it I want to try and do something. It may sound simple but the sheer size of the DTD's that my company uses is huge.

Let me explain

We have recently moved our AI system from Release 1 to Release 3. A huge step, and alot has changed. Basically we use XML to determine what rules govern the AI. Pretty heavy stuff.

Anyway I was wondering the best way to map R3 to R1 (Some older demos we want to recycle and if we can map R3 to R1 it would be super)

Basically we have a create, modify, delete in R3. While in R1 we dont have any such structure. Now we were considering breaking everything chunk into templates to ease the load, but Im not sure which way is best. At the moment I simply opened up a new XSLT project. Opened R3 DTD and R1 DTD, and simply linked every common attribute together. Thats about it really, so far it seems to have worked, but I cant say for certain how robust it is. So has anyone got any advice on this and how best to do the conversions. I really wish I could post the DTD's but that wouldnt go down so well with my boss.

Any help, comments, suggestions, tutorials or other would be much appreciated.

Regards
Ronan Hayes
Frantic Games

Postnext
Ivan PedruzziSubject: Converting a new DTD to an Older DTD version
Author: Ivan Pedruzzi
Date: 16 Feb 2005 07:44 PM
Ronan,

After coverting from R3 to R1 you could validate the XML result using R1 DTD, that sould be a good check point.

Ivan

Postnext
Ronan HayesSubject: Converting a new DTD to an Older DTD version
Author: Ronan Hayes
Date: 17 Feb 2005 05:17 AM
Just wondering if it is best to break down the DTD's into smaller templates, and how exactly would I go about that? At the moment I am validating against the DTD's and all seems fine, while alot of information is missing (I guess thats common when going down a version). Any ideas on how best to structure the XSLT file?

Posttop
Ivan PedruzziSubject: Converting a new DTD to an Older DTD version
Author: Ivan Pedruzzi
Date: 17 Feb 2005 12:29 PM

The most flexible/powerful approach in XSLT is match template, apply-templates.
Here is an example. Hope this helps
Ivan

<xsl:template match="/">
<xsl:apply-templates/>
</xsl:template>

<!--
For each node/attribute invoke an apply template.
Generic matching rules like this one has low priority
compare to a direct XPath match like match="MyRoot";
they only match if the XSLT processor doesn't find
a higher priority rule
-->
<xsl:template match="@*|node()">
<xsl:apply-templates/>
</xsl:template>

<xsl:template match="MyRoot">
<MyRoot>
<xsl:apply-templates/>
</MyRoot>
</xsl:template>

<xsl:template match="MyChild">
<MyChild>
<xsl:apply-templates/>
</MyChild>
</xsl:template>

 
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!  
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.