General XMetaL Discussion
achu April 26, 2010 at 9:49 pm
Rules maker programApril 26, 2010 at 9:49 pmParticipants 6Replies 7Last Activity 12 years, 7 months ago
Does rules maker program work for XSD too?
Besides XMetal Developer, what are other means to get XSD compiled into a rule file?Derek Read April 27, 2010 at 9:51 pm
Reply to: Rules maker programApril 27, 2010 at 9:51 pm
Rules Maker is only for DTDs and will probably never support W3C Schema.
When you open an XSD in XMetaL Author it compiles the RLD file. In versions of the product prior to 5.5 this file was placed in the same folder as the XSD. In 5.5 and later you will need to check the following location:
Which might look something like this (my Windows login is “dread” and this is an XP box):
C:Documents and SettingsdreadApplication DataSoftQuadXMetaL6.0genCsomefoldermyschema.rld
Note that with 5.5 and later any auto-generated CSS and CTM files will be placed in a similar location (make sure your customization is complete so that does not happen for the user).
I don't think using XMetaL Author is the ideal way to make an RLD file if you feel you need one mostly because you need to go hunting for it (as shown above). It is generally easier to let XMetaL Developer generate this file for you as part of the customization it builds.
Also, unless you wish to avoid distributing the Schema you do not need to compile the RLD file in advance either (because XMetaL Author will do that regardless). I can think of two reasons for distributing the RLD instead of the Schema itself (if you have another please let us know):
1) Simplification. Your Schema consists of many files so distributing the RLD may seem easier.
2) Obfuscation. You wish to try to prevent end users from making modifications to the Schema. I would not say that it is impossible to reverse engineer an RLD into a W3C Schema but it certainly would be a pain.achu April 28, 2010 at 7:32 pm
Reply to: Rules maker programApril 28, 2010 at 7:32 pm
This is a process concern related to update XAC file. Here I am talking about XMAX web application. It is nice that XMetal Author can compile XSD in real time. In order to make XAC available for XMAX web application, it seems like XMetal Developer is inevitable.
Everything in XAC file is text file except the rules file. Which means that I can update XAC package file by simply copy and paste text file, for example I can replace the latest CSS file in XAC without going through XMetal Developer. However, rules file is unlike all other files in XAC.
Rules maker program is a nice tool independent from XMetal developer. If the DTD is updated, I can use rules maker program to recompile DTD into rules file; and then make it part of XAC for my application. However, I can not bypass XMetal developer to update my XAC when using XSD.
I think that the bigger picture is how to automate XAC updating/generation process without using XMetal Developer. If rules file is DTD, it is likely to bypass XMetal Developer to update XAC because of the rules maker utility program. For compiling XSD, it seems no alternative support other than XMetal Developer.
Derek Read April 28, 2010 at 11:46 pm
Reply to: Rules maker programApril 28, 2010 at 11:46 pm
XMAX will also generate an RLX / RLD when you provide the DTD / XSD. It is identical to XMetaL Author in this sense.
So, if you do not wish to use XMetaL Developer for some reason (I'm still not entirely clear on that part but perhaps it is too expensive to give everyone a copy?) then you could use XMAX to generate the RLD. Each of the developers will need XMAX (and an XMAX license) to do this.
There are two other alternatives (our sales people are probably not liking me at this point 😉 …
1) Do not include the RLD in the XAC file. Instead, place your XSD file and any other files it references inside the XAC. There is an option to identify a file as being a W3C Schema in XMetaL Developer so that the right metadata is included inside the XAC. When XMAX extracts all the files from the XAC in this case it will then compile the RLD file. Nothing in your XAC is binary any longer (unless you use XFT files).
2) This is basically the same as #1. Do not distribute the XAC file but instead give the CSS, CTM and MCR file the same filename as the XSD and place them in the same folder. When the XSD is located by XMAX the RLD will be compiled and the other files should also be found and used. In this case you cannot use the XACFile property on LoadFromFile() or LoadFromString(). The right path will need to be coded into the schemaLocation attribute in the XML to tell XMAX where to look for the XSD. There's information on this in “Deploying customizations” in the Customization Guide.achu April 30, 2010 at 7:26 pm
Reply to: Rules maker programApril 30, 2010 at 7:26 pm
The two alternatives you mentioned make me think of another questions.
So RLD is compiled every time the XSD is referred or only the time when RLD is not there?
or it is smart enough to compile XSD by detecting the changes of the XSD files, incldung the nested xsd files.
if RLD is compiled every time when XSD is referred, will the time and resource be a concern? we have XSDs which are deeply nested.
If the location of XSD is read only, will the RLD be able to be generated?Derek Read April 30, 2010 at 9:16 pm
Reply to: Rules maker programApril 30, 2010 at 9:16 pm
If you distribute just the RLX or RLD then it is loaded directly (ie: assuming a DTD or XSD is not found).
If you distribute just the DTD or XSD then it is compiled into an RLX or RLD.
If you distribute both types of files then the RLX or RLD is loaded and there is logic to check timestamps inside the RLX or RLD file against those for the DTD or XSD. I believe the product makes an attempt to load updated versions of referenced files but if you are concerned about this then deleting the compiled version of the DTD or XSD will resolve that issue as that will force a new one to be generated. In this case, yes, there will be a performance hit, but this will be negligible. Part of the original design for the product, actually a predecessor to XMetaL (many years ago) assumed computers were very slow (which they were) and that is one reason these compiled versions were created. They act as a sort of cached state of the representation of the schema in memory.
You can easily test this yourself by timing the load for a file that uses an RLD, vs the same file that compiles the RLD from XSD, vs one that loads the RLD but needs to compare timestamps against an updated XSD and recompile it. You'll need to decide if there is any difference and if it is acceptable in your environment. In my experience, for most documents the portion of time during loading that takes the most time is the actual rendering of the XML in TagsOn or Normal view. Many things affect that but the most significant are the size of the XML file + complexity of CSS + CTM and any scripts that run at document load that either alter the XML source or change the appearance.achu May 11, 2010 at 9:50 pm
Reply to: Rules maker programMay 11, 2010 at 9:50 pm
question for the following statement.
2) This is basically the same as #1. Do not distribute the XAC file but instead give the CSS, CTM and MCR file the same filename as the XSD and place them in the same folder.
>>so I should leave myRule.css, myRule.ctm and myRule.mcr along with myRule.xsd? or with xml document?Derek Read May 12, 2010 at 12:09 am
Reply to: Rules maker programMay 12, 2010 at 12:09 am
XMetaL Author and XMAX find the DTD or XSD based on lots of different things (this is well documented so I will not get into that).
Once the DTD or XSD is located, these other files (CSS, CTM, MCR and in the case of XMetaL Author also the TBR and structure view CSS files), are looked for in the same folder as the DTD or XSD. They might be found in the same folder as the XML file but only if the XML references a DTD or XSD which itself is in the same folder as the XML. The Customization Guide discusses this.
- You must be logged in to reply to this topic.