Sunday, 29 March 2009

New Release 1.6.4 Available

Fixes Made

2717291 Add parameter for dictionary create - cxf-2-dictionary 
2717289 Add parameter for cam-2-xsd export 
2715423 Enhance dictionary create tool to support CCTS 
2712586 Dictionary format include CCTS labels 
2692006 Hinting system not matching on attributes 
2690379 Some patterns causing error in random func 2nd parm 
2591499 Add XSD generation options to export xsd

Thursday, 22 January 2009

Sunday, 18 January 2009

New Release

A major error was foundin the release of CAMV which prompted this quick release. In also includes a number of XSLT fixes.

Bugs Fixed

  • 2517859 Loading files and detecting mixed content
  • 2516066 xsd:float base type for restriction
  • 2513927 Add UID to dictionary and cross-ref' tools
  • 2513923 Dictionary merge content not always working
  • 2513916 Skip non xsd: content - Oracle designer XSD tool usage

Wednesday, 14 January 2009

CAMed released

Although 1.6.3 of CAMed was announced two days ago, a new release which replaces 1.6.3 has been released today 14th Jan 2009.  The release is the same code base as 1.6.3 but repackaged and uploaded as
One major new introduction in this release is the inclusion or the correct JRE required for it to run.  This increases the download time, but should prevent installation problems.

  • Windows Installer for of CAMed. download
  • Zip file of of CAMed. download

Monday, 12 January 2009

Parameters, Variables and Context

CAM has a very subtle extra feature over its bigger challenger XML Schema.  This is the ability to change the rules that are applied at run-time, by using parameters.
These come in two forms global and local.  
global parameters are using to pass in a value that can be interpreted by conditional rules or contexts.  If for example a parameter existed called 'processing-style' that had a couple of options strict and lax, then a pair of context could be defined with the respective conditions of $processing-style = 'strict' and $processing-style = 'lax'.  Under each of these could be a set of rules that would be appropriate for the processing that is required.  By setting the value of the processing-style parameter at runtime the rules applied can be drastically changed without changing code.
local parameters are similar in that they are used to affect the rules that are applied, however, their values are derived from the contents of the xml file that is being processed.  This means that they have an xpath associated with them to derive a value.  local parameters can be re-evaluated by invoking the evaluateVariable action.  This cause the xpath of the parameter to be reparsed and a new value derived in the context of the node which contained the evaluateVariable action.  This can be useful when repeated sections of xml exist, but their contents are different.  For example the rules for for an order-line in a purchase-order could be different based on the item being ordered.  This could be achieved by evaluating the value of the parameter when a new order-line element is encountered.  
(evaluateVariable replaces the CAM specification scope attribute of a context node.)

In the future the ability to select the structure being processed will also be possible by simply choosing it using a parameter.  This would allow the run-time selection of the contents to be drastically changed, again without programming.

CAMed 1.6.3 Release

This release is bug fix release.  The major changes are in the area of tidying up areas such as the parameter view to make sure that incorrect parameters are less likely.  Also CAMV should now raise exceptinos for things like mixed content and parameter issues.

Quite a few changes have occurred within the xsd2cam stylesheets.  This should eleviate some of the minor niggles that remained.

Bugs Fixed

2500080       setchoice handling needs updated to match name() rule
2499432       Mixed content ignored
2496940       Parameter causes SaxonApiException
2496296       xsi:nil incorrectly checked
2496291       any is not working
2494648       Erroneous "template is null"
2493610       Exception when reading string pattern in XSD
2488827       Dictionary merge - mask detail update handling
2488824       Test case generation - short data type handling
2488820       Tabular Report - choice() on name()= items

Feature Requests

2492737 Shortcut keys needed

Wednesday, 7 January 2009

Dividing and conquering with CAM

It can sometimes be difficult to  know how to manage some of the processing of complex structures.  Where do you put rules?  What is a context used for?  When should I use a condition and when should I use a context node?

  1. Default Rules - these are rules that are applied to the template first and can be over-ridden either by Context Nodes or conditional rules.
  2. Context Nodes - These are used to divide rules up into groups.  Typically they are groups of rules that will apply when a particular condition is true.  These conditions might simply be the existence of a node in the tree, or a node having a particular value.  
  3. Conditional Rules - This is used when a condition is applied to a single node.  Typically these are rules that check values of the node in question and apply, for example, a mask based on its length.
Rule processing is done by first applying the Default Rules to the template.  These rules are unaffected by the content of the XML file being checked.  They can therefore be associated with nodes in a pre-processing stage when a template is read in.  Context and conditional rules are applied only when an XML file is being processed.  The processor looks through each node in the template structure in question and checks it against the XML nodes it finds in the input document.  If a node has conditional rules applying they are applied and then the checks are done based on the content of the XML file.  If a node does not exist in the XML file any associated conditions are still checked but in the context of the parent node.  The reason for this is that a condition might be designed to mark a node as excluded and that might explain why the XML does not contain the node.

CAMV in particular does not distinguish between Context and Conditions.  It combines the conditions defined for the Context with any conditions found on the rule.  This combination is done during the compiler stage.  It is possible to see this by using the CAMed> Tools menu> Compile Template option.  This will output a .cxx file which is a simple compiled template that is consumed by the CAMV processor.

JCAM (in the process of being withdrawn) took a different approach.  Every time an XML file was submitted for processing the template was read in and a stage called trimming was run.  This first applied the default rules and then using the XML file applied the context and conditional rules.  If nodes were repeated JCAM duplicated that part of the tree and then applied any rules.  This trimming process had some problems, for example marking a node as excluded meant it was removed from the tree altogether, making it impossible to recreate it should a conditional rule mark the node as in use.  CAMV gets round this by holding both a default set of states and an applied set that is used each time a node is encountered.  Should an excluded node be marked as in use the flag in the applied settings is changed from excluded = true to false.

Rule of Thumb for Use of Context
If a condition is based on the structure of the document it will probably be best to create a context node.  Secondly it is possible to nest context nodes to handle complex compound conditions.  This sometimes makes the creation of the template easier - hence dividing to conquer!

Tuesday, 6 January 2009

CAMed 1.6.2

CAMed 1.6.2

This release fixes a couple of small bugs that were discovered when processing using CAMV.

Bugs fixed

2489131 condition xpath fail if nodes do not exist
2489126 Some checks fire even if conditions apply
2489121 printMessage is not supported

Sunday, 4 January 2009

CAMed 1.6 Release Notes

CAMed 1.6 Release Notes

Release completed Sunday 4th January 2009

Key Components of 1.6

CAMV version

JCAM version 1.0.11-prod

CAMed version 1.6.1-prod


CAM Editor - 1.6.1 Windows installer

CA Editor 1.6.1 - Zip File


1) Development has been moved to the Eclipse 3.4.1 Ganymede platform.
2) Minimum JRE is now 1.6 release 11.
3) Two new tools have been added to the tools menu.  These allow the current template to be used to create a dictionary of information about the nodes used in the template.  This can also be used to merge information from many templates into one dictionary.  The second tool is Compare to Dictionary that creates an XML file that contains information of usage of the current template against a dictionary.

4) CAMV has been upgraded to support orderChildren.  This only really works for child nodes that are not part of choices.  
5) The CAM template validator will raise a warning if orderChildren is applied to nodes that are part of a setChoice.
6) Removal of the Import and Properties views.  These were removed as although defined in the CAM 1.1 specification they are not used by either of the processors. 
7) With the introduction of conditional xpaths having to be relative to the node being checked for CAMV, the XSD2CAM generator has been changed to reflect this.
8) CAMV was not properly appending second faults on a node. This has been fixed.
9) CAMV now reports exceptions in processing against the node associated with the problem if there is one, otherwise it uses the root node.
10) Include processing was not working in the editor.  This now works.
11) CAMV was not handling default values on parameters correctly, this is now fixed.
12) The parameter view is now checking inputs to make sure that parameters are valid.

13) a late addition. Some errors were not being correctly being associated with the node that contain the errors.

BUGS Fixed

2484297            include of same file is not working

2484175            CAM 2 CXF not escaping & in output

2481565            two errors on same node not shown

2481108            restriction base="string" type information skipped

2479956            Enhance choice() XPaths for non-namespaced elements

2479953            xs:sequence within xs:sequence in currently processed

2479951            Support for xs:all in xsd2cam processing

2477732            Condition Editor - textual error

2477729            Using Properties

2477727            Parameter problems - creating

2477726            include problems while removing duplicates

2477719            orderChildren does not work in CAMV

2473442            xsd2cam needs to use relative xpaths

2471968            When saxon fails the errors are not passed to the user

2430249            Display scaling on XSD2CAM Wizard panel

2450034            New validator loops on certain xml tests with namespaces

2484217            string mask is adding extra } to end of mask

2484272            CAM2XSD - Two choice() groups together - only first output

2468594            Create template from Schema defect InvalidParameterException

2486564            Repeating element error not appearing in results