ARCHIVE

LICENSE TERMS

Copyright [2019] [Syntea software group a.s.]

Licensed under the Apache License, Version 2.0 (the “License”); you may not use this file except in compliance with the License. You may obtain a copy of the License at:

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an “AS IS” BASIS,  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

# Version 42.2.28, release-date 2025-06-11
* If the `xdef_string_codes` property is set (org.xdef.XDConstants.XDPROPERTY_STRING_CODES), for items,
where there is no validation method declaration, the character dataset is not checked.
* Fixed a bug when translating source X-definitions where XML syntax errors would throw an exception with
the message “Internal error”, but no information about the cause.
# Version 42.2.22, release-date 2025-03-07
* Fixed an error when using the `xdef_specdates` property (see `org.xdef.XDConstants.XDPROPERTY_SPECDATES`)
when the date list contains a date without a time specification and the parsed dateTime has a time
specified as 00:00:00.
# Version 42.2.8, release-date 2024-10-30
* The new property `xdef_defaultZone` is used to set the default time zone
(see org.xdef.XDConstants.XDPROPERTY_DEFAULTZONE).
* A new method `getDefaultZone()` has been implemented in the `XDPool` class,
which returns the specified default time zone or null if none has been
specified.
* If the result of the `dateTime` method does not contain a time zone and
a default time zone is set, then this default time zone is set
in the resulting date.
* The default time zone, if set, is added to the result of the `dateYMDhms` method.
* The default timezone is added to the result of the `xdatetime` parsing method
if it is non-zero and if it is not in the parsed data or if the output format
does not have a timezone output requirement.
* Implemented new X-script method `currencyCode()` of `Currency` value which
returns string with ISO 4217 currency code.
* To the class `org.xdef.XDFactory` is added new static methods. The method
`isXQuerySupported()` returns true if XQuery language is supported
and the method `isXPath2Supported()` returns true if XPath2 expression format
is supported.
# Version 42.2.4, release-date 2024-08-26
* Fixed bug in X-component generator for value type declared as `jvalue`
in X-definition models.
* Fixed bug in X-component generator for type of JSON array items declared as
`jvalue` in the X-definition if the field item is null (the result was
incorrect: it was object of type `org.xdef.xon.XonTools.JNull`).
# Version 42.2.0, release-date 2024-06-27
* Fixed a bug that the `onXMLError` section in the X-script was not compiled and
an error was reported when compiling the X-definition.
# Version 42.1.6, release-date 2024-05-28
* Fixed bug that did not report XDEF385 error when type name in local
declaration section was the same as the referenced type.
* Fixed bug generated negative value to `maxOccurs` attribute in
X-definition conversion to XML Schema.
* To the list of parameters of method `org.xdef.util.XdefToXsd.main(…)` was
added the parameter `–outType` with the name of the file where the types
declared in the X-definition are generated (note that the extension `.xsd` is
added to the name).
# Version 42.1.2, release-date 2024-02-26
* Corrected bugs in the `org.xdec.util.XdefToXsd` utility.
# Version 42.1.0, release-date 2024-01-15
* Added the new binary operator `CHECK`. The result of operation is
a `ParseResult` value. The type of the first operand must be `Parser` or
`ParseResult` (if it is Parser then parsing method is invoked so that it
results a `ParseResut` value). The second operand is a `boolean` expression
(usually it is a method) and it is invoked only if the `ParseResult` from
the first processed operand does not contain any error messages. If the result
of invoked expression of the second operand is false, the error message
`XDEF822: Parsed result does not fit to CHECK argument` is set to the
`ParseResult` value.
* Fixed bug in nested sequence groups.
* If the type of a value in X-component is `union` and types of all items are
compatible type, then the type of getter/settter is set according to that
type (formally it was only `Object`).
* If in X-component the type is compatible with String`then type of
getters/setters is now always String.
* corrected and improved `org.xdef.util.GUIEditor`.
# Version 42.0.8, release-date 2023-07-10
* Corrected bug in generation of `XComponent` java source when was generated
the modified name of getter/setter even if it was not necessary.
* Corrected bug in the method `toXml` from `xd:any` of generated XComponent.
The returned `org.w3c.Element` was not inserted to the `org.w3c.Document`.
* Corrected bug in the construction`mode from a container which is an array
with only one item, which is an array.
* X-definition is now generated from either XML and from JSON/XON data.
(See `org.xdef.util.GenXDefinition` and `org.xdef.impl.GenXDef`.)
# Version 42.0.4, release-date 2023-02-27
* corrected bug in `toXon()` method in the X-component class generated from
an JSON/XON model with `%anyObj` spoecification.
* corrected conversion of JSON objects with values as byte array to JSON source.
# Version 42.0.0, release-date 2022-10-12
* Corrected bug in `uses` and `implements` in X-script when it refers
* to a node with specified namespace URI.
* New things:
* This version of X-definition supports JSON, YAML, Propreties, Windows INI,
* CSV and XON data processing. See the documentation for this release.
* Implemented XON command %anyName.
* Implemented XON command %anyObj.
* Names of XON directives $:script and $:oneOf, changed to %script and %oneOf.
* Implemented %encoding directive in XON data.

# Version 41.0.2, release-date 2021-11-24
* Corrected generation of X-components from models containing a choice section.
* The compilation of X-definitions stops if an XML error occurs in
an X-definition source and only the XML errors are reported.

# Version 41.0.1, release-date 2021-11-21
* Fixed bug in generation of X-component where in the choice section is an item
with max occurrence greater then one.
* Fixed bug in X-script method `xquery`.
* The deprecated method `setExternals(…)` from `org.xdef.XDBuilder`
was removed.
* The parameter list of the method `org.xdef.XDFactory(compileXD(…)` no more
supports classes with external methods. All external classes must be now
declared in X-definitions.

# Version 41.0.0, release-date 2021-11-15
* Preliminary version 4.1.
* From this project are removed utilities for conversion XML schema to/from
X-definition (classes `org.xdef.util.XdefToXsd`, `org.xdef.util.XsdToXdef`).
* to the interface ‘org.xdef.XDPool’ added method `genXComponent`.
* added X-script type `InetAddr`
* added X-script type `Currency`
* X-component generator now generates for XON/JSON components the method `toXon`
* fixed bug in X-component generation with `%bind` command
* The method
`XDDocument.setStreamWriter(Writer out, String encoding, boolean writeHeader)`
is now deprecated. Please use `OutputStream` instead of `Writer`.

# Version 40.1.5, release-date 2021-06-25
* fixed bug in nested type declarations.
* fixed few bugs in parsing of email address (it’s now up to rfc288).
* X-definition 2.0 is now deprecated.
* removed deprecated type methods: `ISODay`, `ISOMonth`, `ISOMonthDay`,
`ISOyearMonth`, `ISOYear`, `ISOdateTime`, `ISOdate`, `tokens`, `tokensi`,
`ISOduration`, `ISOlanguage`, `parseISODate`, `parseSequence`, `ListOf`.
* implemented new X-script types `URI` and `EmailAddr`.
* changed names of validation methods: `email` to `emailAddr` and `emailList`
to `emailAddrList`.

# Version 40.1.2, release-date 2021-02-15
* corrected the bug in the X-script method `s.contains(s)`.
* corrected the bug in the construction node of JSON.
* corrected the bug in JSON parser: duplicated name in object not reported.
* corrected the bug in JSON parser: after decimal point and before decimal point
must be a digit.
* to `org.xdef.XDDocument` it is implemented the new method
`Object jcreate(String name, ReportWriter reporter)`.
This method allows to construct JSON data acccording to JSON model with given
name. The method returns constructed JSON object.
* to `org.xdef.proc.XXNode` it is implemented the new method
`public void setJSONContext(Object data)`.
This method sets the context with JSON data used in the construction mode.
* to the BNF grammar are implemented new inline functions `$skipToNextLine`,
`$UTFChar`, and it is implemented the possibility to specify case insensitive
terminal symbols (when the terminal symbol specification follows percentage
character).
* if in the date and datetime validation method is specified any of constraining
facets `%minInclusive`, `%maxInclusive`, `%minExclusive` or `%maxExclusive`,
then it is now skipped the test of date validity (which can be set
by properties or by methods `setMinDate` or `setMaxDate`).
* the method `setBufIndex(int)` in the class org.xdef.sys.StringParser was
renamed to `setIndex(int)`.
* implemented new version of transformation of XML to JSON and of JSON to XML.

# Version 40.1.0, release-date 2020-07-26
* corrected bug Illegal type in `ObjectReader` when the code contains an item
with `uniqueSetKey`.
* in the X-script is implemented the new type `uniqueSetKey`. This type of
object enables to save the actual value of the key of an `uniqueSet`. To do it
you can invoke the new implemented method `getActualKey()` from `uniqueSet`
object. With the new method `resetKey` form `uniqueSetKey` the actulal key
of given `uniqueSet` object is set to the saved value. E.g.:
<NodeValue xd:script=
‘var uniqueSetKey k; init k=nodeSet.getActualKey(); finally k.resetKey();’>

* implemented the new X-script method `bindSet(uniqueSet u1[,uniqueSet u2…])`.
This method can be specified only in the `init` section of the X-script
of model of Element. At the end of processing of the element where it was
invoked it sets to all specified `uniqueSet` parameters the value of the
actual key which was at init time (it happens after `finally` event).

# Version 40.0.1, release-date 2020-05-03
* improved JSON error reporting.
* corrected bug when a JSON string value contains some of escape characters.

# Version 40.0.0, release-date 2020-04-24
* new implementation of processing of JSON data.
* xd:def may now contain attribute xd:importLocal (the list of X-definition names from where are imported local declarations).
* xd:root may refer also to named xd:choice.
* corrected bug in error reporting (in some special cases was incorrect xpath).
* corrected bug in invoking methods from referred types.
* to the class org.xdef.XDFactory are implemented methods writeXDPool and readXDPool.
* in X-script is implemented method getCreateContextElement() which in the construction mode returns the actual element from context, otherwise it returns null.
* the default scope of accessibility of items from the xd:declaration declared as child of xd:def is now local (in previous versions it was global).
* to xd:def element is no possible to write the attribute “importLocal”. The value of this attribute is the comma separated list of names of X-definitions from which are imported items from local xd:declarations (the “noname” X-definition is specified by the character “#”).
* NOTE that the implementation of JSON is preliminary, it may be changed in future versions.

# Version 32.5.1, release-date 2019-09-24
– Corrected org.xdef.sys.SDatetime methods implemented from javax.xml.datatype.XMLGregorianCalendar.
– implemented the access to XML data or X-definition data with  an URL-like form where the protocol name is “classpath”.
E.g.:
String urlName = “classpath://org.xdefimpl.compile.XdefOfXdefBase.xdef”;
This form may be used to parse XML source data:
Document dom = KXmlUtils.parseXml(urlName);
or to X-definition in compilation of XDPool:
XDPool xp = XDFactory.compileXD(null, urlName);
or in the attribute “xd:include” in header of X-definition:
<xd:def xmlns:xd =”http://www.syntea.cz/xdef/3.1″
xd:include = “classpath://org.xdefimpl.compile.XdefOfXdefBase.xdef,
classpath://org.xdefimpl.compile.XdefOfXdef20.xdef,
classpath://org.xdefimpl.compile.XdefOfXdef31.xdef”
>  …

# Version 32.5.0, release-date 2019-07-11
– Prepared the EXPERIMENTAL version for processing JSON data (it does not influence the processing of XML data). The X-component has the new method toJson which returns a JCON object. It is also now available the new class org.xdef.json.JsonUtil which enables to work with JSON objects (conversion JSON to XML, XML to JSON,
parse source JSON data, compare JSON objects). In the X-definition is now possible to specify a JSON model written to an element js:json as a text child. The namespace assigned to the prefix “js” can be either: http://www.xdef.org/json/1.0 (see XDConstants.JSON_NS_URI) used for X-definition version of JSON to XML coversion
or http://www.w3.org/2005/xpath-functions (see XDConstants.JSON_NS_URI_W3C) used for W3C version of conversion to XML In the class XDDocument are now implemented the methods “jparse” (parsing of an JSON objects with X-definition).
Example:
X-definition:
<xd:def xmlns:xd=”http://www.xdef.org/xdef/3.2″
xmlns:js=”http://www.xdef.org/json/1.0″
xd:name=”Test” xd:root=”js:json”>
<js:json>
{“Person”:
{
“Name”: “jstring(1, 50); onFalse outln(‘Incorrect name’)”,
“Salary”: “int(1000, 1000000)”,
“Vehicle”: “optional enum(‘Skoda’,’Ford’,’WW’,’Other’);”
}
}
</js:json>
</xd:def>
JSON data:
{“Person”:
{ “Name”: “John Smith”, “Salary”: 3500, “Vehicle”: “Ford” }
}
Program in Java:
””
File json; // file with JSON data
File xdef; // file with X-definition
XDPool xp = XDFactory.compileXD(null, xdef); // compile X-definition
XDDocument xd = xp.createXDDocument(“test”);
// parse json source and return parsed JSON object
Object result = xd.jparse(json, “js:json”, null);
// result will be the instance of java.util.Map

# Version 32.3.1, release-date 2019-03-21
– fixed error in generation of X-components from models with namespace URI.
Previous build info:
# Version 32.3.0, release-date 2019-03-12
– to the X-script added method XDValue replaceItem(int index, XDValue value). This method is member of the Container objects,
– fixed errors in conversion of X-definition to XML schema (in declared types).

– Added x-script validation method “xdType”. It checks if the text value  is a specification of predefined validation method. The result is saved to the parsed result.

– The type “uniqueSet” is extended. It is now possible to declare a value connected with a key (see BNF rule “UniqueSetVar”): UniqueSetDeclaration ::= “uniqueSet” S Identifier S? UniqueSetDeclarationBody
UniqueSetDeclarationBody ::=
(“{” UniqueSetItem (S?”;” UniqueSetItem)* (S?”;”S?)? S? “}”) | Method
/* The method must be a parser. */
UniqueSetItem ::= S? (UniqueSetVar | UniqueSetKey)
UniqueSetKey ::= S? Identifier (S?”:”S? ((“?” | “optional”) S? )? Method )?
/* The method must be a parser. */
UniqueSetVar ::= S? “var” S TypeIdentifier S Identifier
(S? “,” S? TypeIdentifier S Identifier)*
Example:
<xd:declaration> uniqueSet u {a: string(); var Parser x} </xd:declaration>

<def Name=’u.a.ID();’ Type=’xdType(); onTrue u.x=getParsedValue();’ />

<Param Name=’u.a.CHKID();’ Value=’u.x; ‘/>

– added the utility cz.syntea.xdef.util.GUIEditor. It enables to edit  and to debug projects with X-definitions.

– The attributes are processed in order of order as declared in X-definition.

– to the class cz.syntea.xdef.sys.BFFGrammar was added the method trace(PrintStream out) if the parameter is not null, the trace information is printed. If it is null no trace information is generated.

– to the X-skript was added the method “getTextContent()”, which returns the concatenated string with the text nodes of the current element and all   the descendants.

– added property “xdef.ignoreunresovedentities” with value “true” or “false”, default value is “false” – see cz.syntea.xdef.sys.XDConstants:
XDPROPERTY_IGNOREUNRESOLVEDENTITIES
XDPROPERTYVALUE_IGNOREUNRESOLVEDENTITIES_FALSE
XDPROPERTYVALUE_IGNOREUNRESOLVEDENTITIES_TRUE
– if value is “true” then the unresolved refenrences in DTD are ignored
– following methods in XDPool are removed from the implementation:
setResolveIncludes(boolean x)
setDisplayMode(byte mode)
setMinYear(int x);
setMaxYear(int x);
setSpecialDates(SDatetime[] x);
because they violated reentrantibility of the object XDPool, perameters is now possible to set only via properties.

– on the Script of X-definition is implemented the new type of value “Locale”
this value is possible to create with following constructors:
new Locale(language) or
new Locale(language, country) or
new Locale(language, country, variant), where language is lowercase two-letter ISO-639 code, country is uppercase two-letter ISO-3166 code, variant is Java library vendor and browser specific code

– in the Script of X-definition are now implemented new methods:
format(mask, v1, …) creates string from arguments v1, …according to given mask
format(local, mask, v1, …) creates string from arguments v1, …according to given mask and according to specific geographical, political or cultural region from the parameter local (type Locale)
printf(mask, v1,…) prints string from arguments v1, … to standard output according to given mask
printf(local, mask, v1,…) prints string from arguments v1, … to standard output according to given mask and according to specific geographical, political or cultural region from the parameter local (type Locale)
printf(out, mask, v1,…) prints string from arguments v1, … to the output stream out according to given mask
printf(out, local, mask, v1,…) prints string from arguments v1, … to the output stream out according to given mask and according to specific geographical, political or cultural region from the parameter local (type Locale)
out.printf(mask, v1,…) prints string from arguments v1, … to the output stream out according to given mask
out.printf(local, mask, v1,…)  prints string from arguments v1, … to the output stream out according to given mask and according to specific geographical, political or cultural region from the parameter local (type Locale)

– repaired StringIndexOutOfBoundsException when the file name of X-definition is an empty string
– repaired bug in the Script method “error” with the parameter type of “Report”
– on the standard output streams (System.err, System.out) is now at the end of process invoked the method flush()
– repaired bug in the Script methods “setParameter” and “settType” on the type Report (and corrected documentation of it)
– declaration of external methods is now recorded to by the command external method deklarace metody; or external method { deklarace metody; … }
– repaired bug in some case of specified quantifier occurs 2..2
– the following classes were moved from the package cz.syntea.xdef to cz.syntea.xdef.proc: XXNode, XXDocument, XXEelement, XXData
– repaired NullPointerException in some cases when a rule of the BNF grammar does not exist
– the default X-definition verison is switched from 2.0 to 3.1
BACK