General XMetaL Discussion

  • achu

    Rules maker program

    Participants 6
    Replies 7
    Last 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?

    Reply

    Derek Read

    Reply to: Rules maker program

    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:

    %appdata%SoftQuadXMetaL6.0gen

    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.

    Reply

    achu

    Reply to: Rules maker program

    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. 
     

    Reply

    Derek Read

    Reply to: Rules maker program

    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.

    Reply

    achu

    Reply to: Rules maker program

    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?

    Reply

    Derek Read

    Reply to: Rules maker program

    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.

    Reply

    achu

    Reply to: Rules maker program

    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?

    Reply

    Derek Read

    Reply to: Rules maker program

    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.

    Reply

  • You must be logged in to reply to this topic.

Lost Your Password?

Products
Downloads
Support