LT NSL/XML Changes

XML Version 1.2 September 2000

  This is the first release under the GNU GPL.

  Several bugs and memory leaks fixed (thanks to several testers).

  Some missing validity checks added.

  File I/O under WIN32 now uses binary mode; text mode is not suitable
  for non-ascii-superset encodings.

  NSL_read_defaulted_attributes flag added.

  LinkItem and LinkText now take a doctype argument (needed for
  thread-safety).

  Experimental (and as yet undocumented) namespace support.

XML Version 1.1 July 1999

  Validation (NSL_read_validate flag and -V option)

  Many bugs and memory leaks fixed (thanks to several testers)

  Various changes for thread-safety (a couple of API functions now
  take additional arguments)

  Intersect program restored to distribution

XML Version 1.0 June 1998

  Content models in element type declarations now parsed, checked for
   well-formedness

  Documentation up-to-date, MS Word and HTML versions provided

  More memory leaks plugged

  New standard -e flag to preserve entity references unexpanded

  New NSL_read_* flags (replacing NSL_read_raw)

  Several minor bug fixes (thanks to our beta-testers!)

  LoadDoctype function added

XML Version 1.0 beta May 1998

  Documentation nearly up-to-date

  Command-line interface to all tools standardised

  Standard Setup-based installation for WIN32

  Memory leaks plugged

  sgrpg portability improved

  More tests

  A few new functions added to the API

  Renamed 8-bit libraries to lt8std.dll and lt8api.dll (WIN32)
	 16-bit libraries to lt16std.dll and lt16api.dll (WIN32)

XML Version 1.0 alpha March 1998

  XML and nSGML processing separated from nSGML production, which will be in
  a forthcoming NSL release.

  Full XML 1.0 support, based on RXP parser

  Behaviour of warnings and error messages changed substantially to fit
  the XML standard better.

  Changes in the API are restricted to the addition of arguments for
  doctypes and/or character encodings where we have found this necessary.
  Details of changes to follow.

  Renamed libraries to libltstdNN.a and libltapiNN.a (UN*X)
		       ltstdNN.dll and ltapiNN.dll (WIN32)
   where NN is version number, i.e. 10 for this release.

  Changed destination directories for installation (UN*X)

XML Version 0.9.6 August 1997
NSL Version 1.6   August 1997

  Fixed memory leak on large files.

XML Version 0.9.5 August 1997
NSL Version 1.5   August 1997

  To be supplied.

XML Version 0.9.1 May 1997

  Fixed some problems with DTD handling in XML.

  Changed tar file name to ltxml-...

  Included flex and yacc output.

  Added http: support, courtesy of Mutel Alexandre (absolute URLs only)
  Changed file: support to be more in line with standard, i.e. not to
  require file:, but side-effect is that ALL relative URLs are treated
  as file URLs relative to current working directory.

  Fixed bug in simpleq, which only showed up under LINUX.

NSL Version 1.5 April 1997
XML Version 0.9 May 1997

  Added XML support, made separate LT XML release w/o mknsg, etc.

  A new flex/yacc-based front-end is in operation, implying a change in
  the contents of Bits, Items and Data:  all these are now allocated in
  the normal way, removing the upper bound on file size but requiring
  more attention to Freeing things.  There are still some memory leaks
  as a result.

  CopyData and CopyItem have lost their copyText argument, as the above
  change implies this is always necessary.

   The declarations of the types NSL_ElementSummary and NSL_Doctype
  are no longer typedefs including const, but rather preprocessor
  macros, which means they cannot be used to declare more than one
  variable etc.

  The man pages for the built-in tools all refer to normalised SGML
  files: these references should all be understood as requiring or
  producing well-formed XML files in the XML release.  Command line
  switches intended to provide alternative LT NSL .ddb files have no
  effect in the XML release.

  DoctypeFromDdb always returns NULL in the XML release.

  ElementUniqueName, FindElementAndName, AttrUniqueName and
  FindAttrSumAndName always succeed in XML mode, with the side-effect of
  sometimes creating or modifying existing entries in the doctype.
  These are the only mechanism for programmatically introducing new
  elements and attributes. Use ElementExists and AttrExists to simply
  check for existence without possible side-effects.  See the definition
  of FindAttrSumAndName in the full documentation for further
  discussion.

Version 1.4.6 March 1997

  Changed .C to .cxx throughout.

  INCOMPATIBLE CHANGES

  Made attribute names unique in DDB file in same way element names are.
  All functions with attribute name arguments now require unique names,
  use AttrUniqueName(NSL_Doctype,char*) to get them.  This makes access
  much faster and DDB files smaller.  Some calling sequences have
  changed as a result.

  This means that DDB files created with earlier versions of nsgml will
  no longer work with version 1.4.6, and should be deleted (nsgml/mknsg
  will then recreate them in the new format).

  Stopped upper-casing various bits of files on input, now depends on
  GIs, attribute names and tokens being all upper case in nSGML files.
  Only a problem if you produce nSGML by hand, as output of mknsg is
  guaranteed to have the relevant markup in upper case.

  Renamed libraries as follows (to avoid clashes with another NSL library):

  OLD		NEW

  libstd		libltstd
  libnsl		libltnsl

  Renamed programs as follows (to try to prevent confusion with the SP
  parser nsgmls):

  OLD	NEW

  nsgml	mknsg
  sgmls	pesis

  UPWARD COMPATIBLE CHANGES

  We have tentatively changed the prohibition on <!DOCTYPE ...> in nSGML
  files, i.e. it is now possible for the first element in an nSGML file
  to be a DOCTYPE statement, and so have files which are both SGML and
  nSGML conformant. These DOCTYPEs are now ignored by LT NSL but passed
  through where possible.

  A new bit of query syntax, #, which matches text pseudo-elements, has
  been added.  It can only appear as the last part of a query
  (e.g. '.*/P/#').  Not supported by sggrep, but see sgrpg below.

  Query parsing and processing have been revamped to take account of
  unique attribute names, and support for pseudo-elements has been
  added.

  NEW TOOLS

  sgrpg: An experimental approach to transformation and report
  generation.  Extends sggrep by allowing nested sub-queries, OR groups,
  formatted selective output.  See lib/sgrpg.dtd for structure of
  control information when provided from a file.  Command line use looks
  like this:

  sgrpg '.*/W' '.' '' "%s/%s^j" '<DATA>' 'TYPE' < simple.nsg

  <others?>

Version 1.4.5	(LTG internal 28 August 1996)

* Changed the makefiles and installation procedure.

* Fixed bug in GetAttrVal and similar functions as follows:

	If you asked for the value of an attribute of an NSL_Item
	which had no explicit value for this attribute AND whose default value
	in the DTD was #IMPLIED or #CONREF, then you got a bogus
	value for the value of the attribute (actually, the name of the
	previous attribute :-).

  GetattrVal, and GetAttrStringVal now, in this case, return a
  pointer to a particular constant empty string 
  NSL_Implied_Attribute_Value (defined in nsl.h).

* Introduced two new nsl tools 'nslmkddb' and 'nslshowddb' for creating and
  printing ddb files.

* Re-introduced and updated set of functions for recording and accessing cross
  references between items. sgmllink.c (Only compiled if XDEFINES
  contains -D_LinkIDs_ (see Makefile.env)).

* Fixed bug on processing #CONREF attributes. NSL now processes these
  correctly, i.e. if a value is explicitly given to a #CONREF
  attribute on an SGML element, then the element is empty, 
  otherwise it is non-empty. This invloved changing the definition of 
  NSL_ADefType (extra value NSL_defval_conref added at end).

  NewAttrVal has been changed, so that if you set a CONREF attribute,
  you mark the item as being empty.

* Implemented #CURRENT attribute values properly.
  In nSGML any CURRENT attribute will be given an explicit value on
  every element where it is defined. This seemed the safest way of
  ensuring that there is no confusion about what CURRENT attribute
  values are. This implementation is similar to how NSGMLS (SP) handles
  CURRENT attributes.

* Split the libstd library into two libraries libstd and libnslsup
  This is because libstd will be used by other packages which do not
  need to use NSL.

  libstd:
  -------
   H files
  	comment.h hash.h macros.h memory.h mttslib.h safe.h
  	sstring.h umalloc.h usage.h errmsg.h hsregexp.h
  	regmagic.h defs.h env.h file.h
   C files
  	safe.c memory.c sstring.c hash.c umalloc.c
  	regexp.c regsub.c file.c env.c
  
  libnslsup:
  ----------
   H files
  	err.h cstring.h ddb.h dumpddb.H readddb.h rhash.h tok.h
	nsl-comment.h
   C files
  	err.c token.c rhash.c cstring.c readddb.c dumpddb.C 
  
* Fixed BUG in src/nsg/knitGenerator.C 

	If an attribute value contained a SDATA attribute, then in the
	output of mknsg it was being incorrectly quoted. So for

		<fred bloggs='abc&def;'>

	output was

		<FRED BLOGGS=\000abc&def;\000>

	where \000 means a zero byte. 

* Fixed makedepend bug on Solaris

* Reorganised code by moving believed stale code to a new file stale.c
  Mainly from select.c

* Let the application see Processing instructions

  If IGNORE_PIS is defined when compiling, then previous behaviour is kept,
  i.e. GetNextBit never returns PIs. If IGNORE_PIS is not defined (the
  new default), then GetNextBit returns PIs (except for NSL PIs
  (i.e. those which start with "NSL ")), whose text field is the
  text of the PI, i.e. for <?PI xyz> the text is "PI xyz".

  Also need to make it work for Items, i.e. in GetNextItem and
  GetMatchingComponent and maybe in ItemParse.

  Added new type NSL_pi_data, to NSL_Data_Type (types of NSL_Datas).
  Modified ItemParse to add NSL_Data (type=NSL_pi_data) when we find a
  PI. GetMatchingComponent and GetNextItem are (so far) unchanged.

  FreeData needs case for NSL_pi_data.

  Also need to modify PrintDataInternal (sgmloutput) to handle data of
  type NSL_pi_data. New function PrintProcessingInstructionInternal.

  PrintBit now prints PIs as well.

* Added a new function 
	char *GetIdVal( const NSL_Item *item ); 
  which returns the value of the attribute of item which is an ID
  attribute. You do not not need to know the name of the ID attribute
  for this to work. Returns NULL if there is no ID attribute specified on the
  item.

* Add functionality to access file position in sgml files.
   Start position of items and Bits.

  Modified NextBit and MakeTag in sgmlfiles.c to keep track of the
  character offset (in the input file) of the last read bit and item.
  Two new functions, CurrentBitOffset() and CurrentItemOffset() have
  been provided.

* Checked code for portability to Linux (thanks to Andrei)

* BUG we dont like ">" inside attribute values.

   NextBit(sgmlfiles) loop around MakeTag is the problem.

  Fixed. NextBit

* Jeanc BUG "Too many open files" is DDB file not being closed.
   Re also Matt - there is no FreeDoctype - should there be.

  Fixed: changed mmapfile so that it closes the DDB file channel after
  memory mapping it.

* BUG segmentation fault in sggrep if not enough arguments are given.

  Fixed.

* Allow more flexibility about <!DOCTYPE> statements in nSGML files

  Changed the definition of nSGML (normalised SGML) to allow an
  optional <!DOCTYPE ...> at the beginning of an nSGML file. This to
  allow files which are both nSGML and valid SGML.

  The LT NSL interface ignores such <!DOCTYPE ...> but passes them
  through unchanged.
  
  Also modified SFFopen, so that if we open an output file, and the
  NSL_Doctype has a <!DOCTYPE> statement associated, then we print
  that to the output stream before the <?NSL DDB> statement.
	
  The net result of these is that <!DOCTYPE>s (if present) will be
  passed through the LT NSL API, (as a string no parsing done).

* Document hyperlinking and make it more robust.

   Now allows id to be upper case as well.
   Now allows DOC to be not necessarily on the first source element.

   NB If there is already content in the source element, then the
  hyperlinked elements go at the start, before the existing stuff.

* Interface to DDB file (ie DTD information)

  A new files have been created dtdaccess.c and which
  defines the following functions for accessing information in the DTD.
  At the moment this information is largely to do with attributes
  and entities, other functions may be provided later if they are wanted.
  The functions are:

const NSL_ElementSummary FindElementByName( const NSL_Doctype doctype,
					    const char *elementname );

NSL_AttributeSummary *ElementAttributes(NSL_ElementSummary eltsum,
					   int *numAttr );

const char * AttributeName(NSL_AttributeSummary *atsum);

NSL_AttributeSummary FindAttrSpec(const NSL_ElementSummary elts,
			       const char *attrname);

Char *GetAttrDefVal( NSL_AttributeSummary atsum)

NSL_AVType GetAttrDeclaredValue(NSL_AttributeSummary atsum);

NSL_ADefType GetAttrDefaultValueType(NSL_AttributeSummary atsum);

const Char *GetAttrAllowedValues(NSL_AttributeSummary atsum,
					 int *numVals);
NSL_EntitySummary GetEntity( NSL_Doctype doctype,
				    const char *entityName );

NSL_Entity_DataType GetEntityDataType(NSL_EntitySummary entsum);

const Char *GetEntityValue(NSL_EntitySummary entsum);

  see the documentation for details.

============================================================================
Version 1.4.4	(LTG 23 April 1996)

Changes since 0.9 beta

* Changed version numbering (!) to bring external and internal into line.

* Support for multiple open documents added, with knock-on effect of
requiring an additional NSL_Doctype argument for many functions -- see
src/nsl/nslfunc.h for prototypes.

* Substantial reorganisation of error handling, see documentation for
details.  In summary, all functions now return an error value (NULL,
-1 or FALSE depending on function type).  Users can broadly control
when errors will exit and when they will try to carry on, via an error
level argument (new) to NSLInit.  Three levels are currently used:

  0  Warnings
  1  Errors
  2  Catastrophes

The normal pattern is to call NSLInit(0), which means Warnings will be
printed and carry on, but Errors and Catastrophes will error exit
after printing.

* Support for regular expressions in attribute value patterns in queries,
see documentation for details.

* Makefile and directory structuring modified, should be transparent, but
see Makefile.usr for a template Makefile for user applications.

* 'const' has been added in many function prototypes where it's true (:-),
see nslfunc.h.

* The function SFFopen a new parameter, a string to identify the
stream for error reporting.

* The function NSLInit has a new parameter, to control error
behaviour.

* The enumeration types NSL_ItemType and NSL_Bit_Type have been merged
and replaced by NSL_BI_Type.

* New functions SFFreopen, SFseek, and SFtell have been added for
additional file handling functionality.

* A new function ParseRCData has been added to allow the expansion of
SDATA entities as required by the application.

* A new function ForceOutput has been added to allow the flushing of
output NSL file streams.

* A new boolean parameter has been added to CopyData and CopyItem to
control the copying of strings.

* A set of new functions, NewTextNSLData, NewItemNSLData,
MoveDataTail, InstallDataTail and InstallData have been added to
support common editing operations on NSL tree structures.

* A new function ParseQueryR has been added to allow regular
expressions inside NSL queries.

* The function FindElementAndName has been removed.

* The item parameter of CopyAttr has been removed, as it was not
needed.
