Notes
Outline
Flexsys and XML
Scandura
Flexsys Overview
AST (w/ semantic attributes) representation and manipulation of data/processes:
   - manually in visual Flexforms
   - automatically via High Level
     Design and/or C/C++ API
Slide 3
Flexsys and XML Conversion
XML Reverse Engineer & Generator
XML Converter
 On-the_Job Converter
    (planned)
Creating XML Reverse Engineer
Create bison/yaac compatible XML grammar
Flexsys automatically identifies terminal tokens
Define patterns (regular expressions) for tokens
Specify XML constructs to appear in Flexforms
Specify relationships between Flexform structure and productions in grammar
Flexsys automatically generates default commands
Customize commands as desired
Flexsys automatically generates XML reverse engineer and lexical analyzer
Illustrative XML Grammar
Goal -> DTD  FULL_BODY
DTD -> < !DOCTYPE ID [ ELEMENTS ]
ELEMENTS -> < !ELEMENT ID ( ID_list ) >
             -> < !ELEMENT ID ( ID_list ) * >
                     -> < !ELEMENT ELEMENTS
ID_list   ->
     -> ID
     -> ID ID_list
FULL_BODY -> < NAME > BODY
BODY -> < ID >  text < neg_ID >
           -> < ID > BODY < neg_ID >
neg_ID -> < / ID >
NAME -> < DOCUMENT > NOTE: ID stands for identifier, and text for any text string.
Grammar in Flexform
(after reverse engineering)
Define Token Patterns
Specify Flexform Structure
Specify Relationships Between Grammar & Flexform Structure 1
Specify Relationships Between Grammar & Flexform Structure 2
XML Reverse Engineer
Generating Reverse Engineer (approx. 1 min.)
Process XML Doc as Text
Process after Reengineering
(as Flexform in structured display)
XML Conversion
Define DTD Patterns
Flexsys Generates Code to Detect Patterns and Assigns Names to Key Parts of Patterns
Use High Level HLD Language to Manipulate Patterns
Flexsys Creates Custom Converter
Specify Pattern to Detect
Use HLD to Manipulate Matching Source Structures
Auto-Customize Flexsys
Task: Convert Data Base &
Create Subroutine
Slide 21
Output
Summary
XML lends itself to Flexform Representation
Flexsys makes it easy to detect and manipulate Flexform patterns
Obvious Application: Use Flexsys to convert between different XML documents (based on different DTD patterns)
Sample XML Document Type Declaration / DTD (Opt.)
<? XML version = “1.”?>            // globally applicable XML prolog
<!DOCTYPE DOCUMENT [     //Document Type Declaration
<!ELEMENT DOCUMENT (CUSTOMER)*>
                                                      // DTD defines XML document
<!ELEMENT CUSTOMER (NAME, ORDERS)>
<!ELEMENT NAME (LAST_NAME, FIRST_NAME)>
<!ELEMENT ORDERS (ITEM)*>
     ]>
        NOTE:  A DTD is equivalent to a Flexsys program declaration.
DTD’s as Flexform Patterns
DOCUMENT
CUSTOMER
NAME
LAST_NAME
FIRST_NAME
ORDERS
ITEM
NOTE: This has the advantage of making it easy to check that otherwise valid XML documents conform to given DTD definition
On-the Job XML Converter
What You Can Do
Represent Source/Target XML DTDs as Flexform patterns
   -- extend reverse engineer
Specify source -> target DTD mapping between patterns
   -- available in Flexforms, w/ GUI option
Automatically generate HLD conversion code from the mapping       -- preliminary plan
Sample HLD Conversion Code
Benefits
Structured XML Editing
Easier Maintenance
Protection Against Standards Changes
Automated Custom Conversions
Ease of Use
Extendable to Legacy Integration
XML Commercialization Partner