Replace incomplete csdgmAliases with module parsed from complete text file
Opened this issue · 0 comments
JeffJacobson commented
Parse the reference/csdgm.txt
file into JSON to get complete list of elements. This can be used to replace the csdgmAliases.js
file.
-
Read text line by line.
-
Use the regular expression see if the current line is the first line of an element definition.
// Matches first line of element definition var firstLine = /^\s*([\d\.]+)\s+(.+)\s-+\s(.+)/; /* [ entire match, element index number, element long name, description (until line break) ] */
-
Lines after the first line of an element definition are a continuation of the description from the first line.
-
The description stops when a line starting with (not including spaces)
Type:
is encountered. -
The
Short Name:
line indicates what the XML nodes name will be. -
Keep reading lines until another "first line" is encountered, which indicates a new element definition.