diff --git a/README.rst b/README.rst
index 1eb2a50..f39f3b1 100644
--- a/README.rst
+++ b/README.rst
@@ -42,7 +42,7 @@ Installation
com.github.mfatihercikdsm
- 1.0.2
+ 1.0.3
@@ -50,7 +50,7 @@ Installation
.. code-block:: xml
- compile ('com.github.mfatihercik:dsm:1.0.2')
+ compile ('com.github.mfatihercik:dsm:1.0.3')
=============================================================
`Documentation `_.
diff --git a/docs/build/doctrees/environment.pickle b/docs/build/doctrees/environment.pickle
new file mode 100644
index 0000000..31ac141
Binary files /dev/null and b/docs/build/doctrees/environment.pickle differ
diff --git a/docs/build/doctrees/index.doctree b/docs/build/doctrees/index.doctree
new file mode 100644
index 0000000..fcad9dd
Binary files /dev/null and b/docs/build/doctrees/index.doctree differ
diff --git a/docs/build/doctrees/quick-start-guide.doctree b/docs/build/doctrees/quick-start-guide.doctree
new file mode 100644
index 0000000..68f8a84
Binary files /dev/null and b/docs/build/doctrees/quick-start-guide.doctree differ
diff --git a/docs/build/doctrees/specification/AbsoluteTagPath.doctree b/docs/build/doctrees/specification/AbsoluteTagPath.doctree
new file mode 100644
index 0000000..37908ab
Binary files /dev/null and b/docs/build/doctrees/specification/AbsoluteTagPath.doctree differ
diff --git a/docs/build/doctrees/specification/DefaultObject.doctree b/docs/build/doctrees/specification/DefaultObject.doctree
new file mode 100644
index 0000000..166ec0d
Binary files /dev/null and b/docs/build/doctrees/specification/DefaultObject.doctree differ
diff --git a/docs/build/doctrees/specification/Expressions.doctree b/docs/build/doctrees/specification/Expressions.doctree
new file mode 100644
index 0000000..dff9d2f
Binary files /dev/null and b/docs/build/doctrees/specification/Expressions.doctree differ
diff --git a/docs/build/doctrees/specification/FieldAssignmentOrder.doctree b/docs/build/doctrees/specification/FieldAssignmentOrder.doctree
new file mode 100644
index 0000000..d2587de
Binary files /dev/null and b/docs/build/doctrees/specification/FieldAssignmentOrder.doctree differ
diff --git a/docs/build/doctrees/specification/MergeOfDocument.doctree b/docs/build/doctrees/specification/MergeOfDocument.doctree
new file mode 100644
index 0000000..a470d25
Binary files /dev/null and b/docs/build/doctrees/specification/MergeOfDocument.doctree differ
diff --git a/docs/build/doctrees/specification/NodeObject.doctree b/docs/build/doctrees/specification/NodeObject.doctree
new file mode 100644
index 0000000..1f6814a
Binary files /dev/null and b/docs/build/doctrees/specification/NodeObject.doctree differ
diff --git a/docs/build/doctrees/specification/RootObject.doctree b/docs/build/doctrees/specification/RootObject.doctree
new file mode 100644
index 0000000..1195347
Binary files /dev/null and b/docs/build/doctrees/specification/RootObject.doctree differ
diff --git a/docs/build/doctrees/specification/TransformationElement.doctree b/docs/build/doctrees/specification/TransformationElement.doctree
new file mode 100644
index 0000000..fb15d5a
Binary files /dev/null and b/docs/build/doctrees/specification/TransformationElement.doctree differ
diff --git a/docs/build/doctrees/specification/XMLObject.doctree b/docs/build/doctrees/specification/XMLObject.doctree
new file mode 100644
index 0000000..c984798
Binary files /dev/null and b/docs/build/doctrees/specification/XMLObject.doctree differ
diff --git a/docs/build/doctrees/specification/index.doctree b/docs/build/doctrees/specification/index.doctree
new file mode 100644
index 0000000..63745f9
Binary files /dev/null and b/docs/build/doctrees/specification/index.doctree differ
diff --git a/docs/build/doctrees/specification/main.doctree b/docs/build/doctrees/specification/main.doctree
new file mode 100644
index 0000000..de40aee
Binary files /dev/null and b/docs/build/doctrees/specification/main.doctree differ
diff --git a/docs/build/doctrees/specification/parsingElement/fields.doctree b/docs/build/doctrees/specification/parsingElement/fields.doctree
new file mode 100644
index 0000000..8e077e6
Binary files /dev/null and b/docs/build/doctrees/specification/parsingElement/fields.doctree differ
diff --git a/docs/build/doctrees/specification/parsingElement/filter.doctree b/docs/build/doctrees/specification/parsingElement/filter.doctree
new file mode 100644
index 0000000..935c8b8
Binary files /dev/null and b/docs/build/doctrees/specification/parsingElement/filter.doctree differ
diff --git a/docs/build/doctrees/specification/parsingElement/main.doctree b/docs/build/doctrees/specification/parsingElement/main.doctree
new file mode 100644
index 0000000..6281d4c
Binary files /dev/null and b/docs/build/doctrees/specification/parsingElement/main.doctree differ
diff --git a/docs/build/doctrees/specification/parsingElement/tagPathAndTagParentPath.doctree b/docs/build/doctrees/specification/parsingElement/tagPathAndTagParentPath.doctree
new file mode 100644
index 0000000..d994731
Binary files /dev/null and b/docs/build/doctrees/specification/parsingElement/tagPathAndTagParentPath.doctree differ
diff --git a/docs/build/doctrees/specification/parsingElement/tagTypeAndTagTypeParams.doctree b/docs/build/doctrees/specification/parsingElement/tagTypeAndTagTypeParams.doctree
new file mode 100644
index 0000000..18fddf1
Binary files /dev/null and b/docs/build/doctrees/specification/parsingElement/tagTypeAndTagTypeParams.doctree differ
diff --git a/docs/build/doctrees/specification/schema.doctree b/docs/build/doctrees/specification/schema.doctree
new file mode 100644
index 0000000..14b0c69
Binary files /dev/null and b/docs/build/doctrees/specification/schema.doctree differ
diff --git a/docs/build/html/.buildinfo b/docs/build/html/.buildinfo
new file mode 100644
index 0000000..4b0334a
--- /dev/null
+++ b/docs/build/html/.buildinfo
@@ -0,0 +1,4 @@
+# Sphinx build info version 1
+# This file hashes the configuration used when building these files. When it is not found, a full rebuild will be done.
+config: 6d7e903a09e56c93182a30b0c665fd08
+tags: 645f666f9bcd5a90fca523b33c5a78b7
diff --git a/docs/build/html/_sources/index.rst.txt b/docs/build/html/_sources/index.rst.txt
new file mode 100644
index 0000000..a22c2d4
--- /dev/null
+++ b/docs/build/html/_sources/index.rst.txt
@@ -0,0 +1,25 @@
+Declarative Stream Mapping (DSM)
+================================
+
+
+.. toctree::
+ :maxdepth: 5
+ :caption: Quick Start Guide:
+
+ Quick Start Guide
+
+
+.. toctree::
+ :maxdepth: 5
+ :caption: Specification:
+
+ specification/index
+
+
+
+Indices and tables
+==================
+
+* :ref:`genindex`
+* :ref:`modindex`
+* :ref:`search`
diff --git a/docs/build/html/_sources/quick-start-guide.rst.txt b/docs/build/html/_sources/quick-start-guide.rst.txt
new file mode 100644
index 0000000..45ae6c7
--- /dev/null
+++ b/docs/build/html/_sources/quick-start-guide.rst.txt
@@ -0,0 +1,290 @@
+
+
+Introduction
+============
+
+Declarative Stream Mapping(DSM) is a *stream* deserializer library that makes parsing of **XML and JSON** easy.
+DSM allows you to make custom parsing, filtering,
+transforming, aggregating, grouping on any
+JSON or XML document at stream time(read only once).
+DSM uses yaml or json for configuration definitions
+
+**If you parsing a complex, huge file and
+want to have high performance and low memory usage then DSM is for you.**
+
+
+Simple Example
+===============
+
+**Lets Parse below simple JSON and XML file with DSM**
+
+File contents are taken from `Swagger Petstore example `_. Slightly changed.
+
+**Source file**
+
+.. content-tabs::
+
+ .. tab-container:: tab1
+ :title: JSON
+
+ .. code-block:: json
+
+ {
+ "id": 1,
+ "name": "Van Kedisi",
+ "status": "sold",
+ "createDate": "01/24/2019",
+ "category": {"id": 1,"name": "Cats"},
+ "tags": [
+ {"id": 1,"name": "Cute"},
+ {"id": 2,"name": "Popular"}
+ ],
+ "photoUrls": ["url1","url2" ]
+ }
+
+ .. tab-container:: tab2
+ :title: XML
+
+ .. code-block:: xml
+
+
+
+
+ Van Kedisi
+ sold
+ 01/24/2019
+
+ 1
+ Cats
+
+
+
+ 1
+ Cute
+
+
+ 2
+ Popular
+
+
+
+ url1
+ url2
+
+
+
+
+
+
+**Those are rules that we want to apply during parsing**.
+
+- exclude "photoUrls" tag.
+- read only "name" field of "tags" tag.
+- read only "name" field of "category" tag.
+- **add new the "isPopular" field that it's value is true, if "tag.name" has "Popular" value**
+
+
+**DSM config file**
+
+
+
+[YAML]
+
+.. code-block:: yaml
+
+ params:
+ dateFormat: MM/dd/yyyy
+ result:
+ type:object
+ path: /
+ xml:
+ path: /Pet
+ filter: $self.data.status=='sold'
+ fields:
+ id:
+ dataType: int
+ xml:
+ attribute: true
+ name: string
+ status: status
+ createDate: date
+ category:
+ path: category/name
+ isPopular:
+ default: $self.data.tags.contains("Popular")
+ tags:
+ type:array
+ path: tags/name |tags/tag/name # this is a regex expression. works for both JSON and XML
+
+
+
+**Class to deserialize**
+
+[JAVA]
+
+.. code-block:: java
+
+ public class Pet {
+ private int id;
+ private String name;
+ private boolean isPopular;
+ private String status;
+ private String category;
+ private Date createDate;
+ private List tags;
+
+ // getter/setter
+ }
+
+
+
+**Read Data**
+
+.. code-block:: java
+
+ DSMBuilder builder = new DSMBuilder("dsm-config-file.yaml");
+ DSM dsm = builder.setType(DSMBuilder.XML).create();
+ Pet pet = dsm.toObject(new File("path/to/xmlFile.xml"),Pet.class); // read data from xml file
+
+ dsm = builder.setType(DSMBuilder.JSON).create();
+ pet = dsm.toObject(new File("path/to/jsonFile.json"),Pet.class); // read data from json file
+
+
+
+
+
+Features
+==============
+
+
+- **Work** for both **XML** and **JSON**
+- **Custom stream parsing**
+- **Filtering** by value on any field with very **low cognitive complexity**
+- Flexible value **transformation**.
+- **Default value assignment**
+- Custom **function calling** during parsing
+- **Powerful Scripting**(`Apache JEXL `_, Groovy, Javascript and other jsr223 implementations are supported)
+- **Multiple inheritance** between DSM config file (DSM file can **extends to another config file**)
+- **Reusable fragments support**
+- Very **short learning curve**
+- **Memory** and **CPU** efficient
+- **Partial data extraction** from JSON or XML
+- **String manipulation** with expression
+
+
+
+
+Installation
+==============
+
+.. content-tabs::
+
+ .. tab-container:: tab1
+ :title: Maven
+
+ **Jackson**
+
+ .. code-block:: xml
+
+
+ com.github.mfatihercik
+ dsm
+ 1.0.3
+
+
+ .. tab-container:: tab2
+ :title: Gradle
+
+ **Jackson**
+
+ .. code-block:: xml
+
+ compile ('com.github.mfatihercik:dsm:1.0.3')
+
+
+
+
+
+
+
+Sample Config File
+===================
+
+Detailed documentation and all option is `here `_.
+
+This config file contains some possible option and their short description.
+
+[header.yaml]
+
+.. code-block:: yaml
+
+ params:
+ dateFormat: MM/dd/yyyy # define date format for "date" data type
+ transformations:
+ SOLD_STATUS: # value transformation for "isAvailable" property
+ map:
+ sold: false
+ pending: false
+ available: true
+ DEFAULT: false
+ SOLD_STATUS_SKIP:
+ $ref: $transformations.SOLD_STATUS # extends to "SOLD_STATUS" transformation.
+ map:
+ DEFAULT: exclude # exclude default value
+ onlyIfExist: # make transformation only source value exist in transformation map other wise return as it is
+ functions:
+ insertPet: com.example.InsertPet # declare a function to declare at Parsing Element.
+
+ fragments: # create reusable fragment
+ category:
+ type:object
+ fields:
+ id: int
+ name: string
+ type: string
+
+
+[main.yaml]
+
+.. code-block:: yaml
+
+ $extends: header.yaml # extends to header.yaml config.
+ result:
+ type:array # result is an array
+ path: / | /Pets/Pet # start reading form beginning for json. path is a regex. we can define both for xml and json same time. or we can declare for xml in XML field.
+ xml:
+ path: /Pets/Pet # start reading from /Pets/Pet for xml
+
+ filter: $self.data.isAvailable # filter by "isAvailable" property. "self" key word refers to current Node. self.parent refers to parent Node. self.data refers to current node data
+
+ function: insertPet # call "insertPet" function for every element of "result" array
+ fields:
+ name: string # read name as string.
+ id:
+ dataType: int # read id as int
+ xml:
+ attribute: true # id is an attribute on /Pets/Pet tag.
+ createDate: date # use dateFormat in params then convert string to date
+ isAvailable:
+ path: status # read isAvailable as string from "status" tag
+ dataType: boolean
+ transformationCode: SOLD_STATUS # user "SOLD_STATUS" transformation to map from "status" to "isAvailable"
+ category:
+ $ref: $fragments.category # extends to "fragment.category"
+ fields:
+ type: exclude # exclude "type" field from "category" fragment
+ name:
+ default: 'Animal' #set default value to 'Animal' if "category/name" tag not exist in source document
+ isPopular:
+ default: $self.data.tags.contains("Popular") # set default value of "isPopular" property
+
+ tags:
+ type:array
+ path: tags/name
+ filter: $value.length>15 # filter by length of value.
+ xml:
+ path: tags/tag/name
+
+
+
+
diff --git a/docs/build/html/_sources/specification/AbsoluteTagPath.rst.txt b/docs/build/html/_sources/specification/AbsoluteTagPath.rst.txt
new file mode 100644
index 0000000..62af998
--- /dev/null
+++ b/docs/build/html/_sources/specification/AbsoluteTagPath.rst.txt
@@ -0,0 +1,127 @@
+
+.. _absolute:
+
+*********************
+Absolute Path
+*********************
+
+--------------------------------------
+
+Absolute Path is found by **joining all tag name from top to bottom with "/"** character until specified tag.
+
+Below example is json representation of array of Pet object.
+
+Absolute tag paths are listed below.
+
+.. code-block:: json
+
+ [
+ {
+ "id": 1,
+ "category": {
+ "id": 1,
+ "name": "Cats"
+ },
+ "name": "PetNameForm",
+ "photoUrls": [
+ "url1",
+ "url2",
+ "url3"
+ ],
+ "tags": [
+ {
+ "id": 2,
+ "name": "New"
+ },
+ {
+ "id": 2,
+ "name": "Cute"
+ },
+ ],
+ "status": "sold"
+ ]
+
+Absolute tag paths of all field in above json document are listed below.
+
+.. csv-table::
+ :header: Field Name, Absolute Path
+ :stub-columns: 1
+ :delim: |
+
+ | /
+ Pet:id | /id
+ Pet:category | /category
+ Pet:category.id | /category/id
+ Pet:category.name | /category/name
+ Pet:name | /name
+ Pet:photoUrls | /photoUrls
+ Pet:photoUrls.(item) | /photoUrls
+ Pet:tags | /tags
+ Pet:tags.id | /tags/id
+ Pet.tags.name | /tags/name
+ Pet.status | /status
+
+
+Same Example for XML:
+
+.. code-block:: json
+
+
+
+
+ 1589257917030308320
+ Cats
+
+ 6598053714149410844
+ PetNameForm
+
+ url1
+ url2
+ url3
+
+ sold
+
+
+ 4250197027829930927
+ New
+
+
+ 8271965854563266871
+ Cute
+
+
+ 3487705188883980239
+ Popular
+
+
+
+
+
+Absolute tag paths of all field in above XML document are listed below.
+
+.. csv-table::
+ :header: Field Name, Absolute Path
+ :stub-columns: 1
+ :delim: |
+
+ | /
+ Pets array | /Pets
+ Pets array item | /Pets/Pet
+ Pet:id | //Pets/Pet/id
+ Pet:category | /Pets/Pet/category
+ Pet:category.id | /Pets/Pet/category/id
+ Pet:category.name | /Pets/Pet/category/name
+ Pet:name | /name
+ Pet:photoUrls | /Pets/Pet/photoUrls
+ Pet:photoUrls.(item) | /Pets/Pet/photoUrls
+ Pet:tags | /Pets/Pet/tags
+ Pet:id | /Pets/Pet/tags/id
+ Pet:tags.name | /Pets/Pet/tags/name
+ Pet.status | /Pets/Pet/status
+
+
+.. seealso::
+
+ path_
+
+ parentPath_
\ No newline at end of file
diff --git a/docs/build/html/_sources/specification/DefaultObject.rst.txt b/docs/build/html/_sources/specification/DefaultObject.rst.txt
new file mode 100644
index 0000000..3c487c5
--- /dev/null
+++ b/docs/build/html/_sources/specification/DefaultObject.rst.txt
@@ -0,0 +1,55 @@
+_`Default Object`
+==================
+
+---------------------
+
+Default Object determines how the default_ field is assigned.
+
+Fields:
+ .. csv-table::
+ :header: Field Name, Type, Description
+ :stub-columns: 1
+ :delim: |
+
+ value_ | string | **REQUIRED** default value that is assigned to current field
+ force | string | Use the default value, even if the tag specified in the "path_" field is in the source file.
+ atStart | string | assign default value at start of tag.
+
+_`value`
+------------
+
+**REQUIRED**
+it holds default value that is assigned to current field
+
+if the value starts with the "$" character, it is treated as "expression" and is resolved by expression resolver.
+
+The following objects are available in Expression Context.
+
+
+.. csv-table::
+ :header: Name, Data Type, Description, Example
+ :stub-columns: 1
+ :delim: |
+
+ params_ | Map | params_ object. | **params.dateFormat** =='dd.MM.yyyy'
+ self_ | Node_ | current node object that hold data of current complex type_ | **self.data.foo** => foo field of current node, **self.parent.data.foo** => foo field of parent node, **self.data.bar.foo** => foo field of bar object in current node.
+ all_ | Map | A map that stores all nodes by the "fieldName" of `Parsing Element Object`_ | **all.bar.data.foo** => foo field of **bar** node, **all.barList.data[0].foo** => *foo* field of first item of *barList* node
+
+_`force`
+----------------
+
+
+if it's value is true, it means Use the default value,
+even if the tag specified in the "path_" field is in the source file.
+if force value is true, default value is assigned both start and end of parentPath_.
+It is mostly used with filter field or with value in params_.
+The default value is false.
+
+_`atStart`
+----------------
+
+if atStart_ filed is true, default value is assigned at start of the tag. other wise default value is assigned at the end of the tag.
+
+.. seealso::
+
+ default_
\ No newline at end of file
diff --git a/docs/build/html/_sources/specification/Expressions.rst.txt b/docs/build/html/_sources/specification/Expressions.rst.txt
new file mode 100644
index 0000000..7bbd15c
--- /dev/null
+++ b/docs/build/html/_sources/specification/Expressions.rst.txt
@@ -0,0 +1,279 @@
+.. _expression:
+
+*********************
+_`Expressions` and Scripting
+*********************
+
+-------------------------
+
+
+Expressions makes DSM very flexible. Expression allows a value to be filtered, manipulated, modified etc.
+Expressions can access objects in the expression context and do operations by using these objects.
+
+Expressions can be used at both `source document`_ parsing time and `DSM document`_ loading time.
+
+Expressions are resolved by one of Scripting language such a Javascript,
+Groovy, Apache JEXL or other JSR223 implementations.
+Expressions must be written with scripting language syntax.
+**Default scripting language is Apache JEXL**
+
+.. seealso::
+
+ `Apache JEXL `_
+
+
+
+
+There are two type of expression, **Loading Time** and **Parsing Time** expressions.
+
+
+Loading Time Expression
+==========================
+
+---------------------------
+
+
+Loading Time Expression is expressions that is **only used during loading of `DSM document`.**
+It allows you to **modify structure of DSM document.**
+
+Loading Time Expressions are defined in the `$extends`_ and or `$ref`_ fields. For more detail check `$extends`_ and or `$ref`_ field.
+
+.. seealso::
+
+ `$extends`_
+
+ `$ref`_
+
+The following fields are available in the expression context.
+
+.. csv-table::
+ :header: Name, Data Type, Description, Example
+ :stub-columns: 1
+ :delim: |
+
+ params_ | Map | params_ object. | **params.dateFormat** =='dd.MM.yyyy'
+
+
+**Example**
+------------
+
+-------------------------
+
+.. content-tabs::
+
+ .. tab-container:: yaml
+ :title: YAML
+
+
+ .. code-block:: yaml
+
+ version: 1.0
+ params:
+ rootPath: /bar/foo/
+ $extends:
+ - /foo/bar/external.yaml
+ - $params.rootPath.concat("externalWithExpression.yaml") # use "params" object in expression context to get "rootPath" property
+
+ .. tab-container:: json
+ :title: JSON
+
+
+ .. code-block:: json
+
+ {
+ "version": 1.0,
+ "params":{
+ "rootPath":"/bar/foo/"
+ },
+ "$extends": ["/foo/bar/external.json","$params.rootPath.concat('externalWithExpression.json')"]
+ }
+
+
+Parsing Time Expression
+==========================
+
+--------------------------
+
+Parsing Time Expression is expressions that is **only used during parsing of `source document`.**
+It allows you to change the structure of the output, change the property value, import a specific part of the `source document`_, filter by property , transform a property, and almost all operations that can be done with custom coding.
+
+The Parsing Time Expressions can be defined in the filter_, default_, and normalize_ fields.
+
+The following objects are available in the expression context.
+
+
+.. csv-table::
+ :header: Name, Data Type, Description, Example
+ :stub-columns: 1
+ :delim: |
+
+ params_ | Map | params_ object. | **params.dateFormat** =='dd.MM.yyyy'
+ all_ | Map | A map that stores all nodes by the "uniqueName_" of `Parsing Element Object`_ | **all.bar.data.foo** => foo field of **bar** node, **all.barList.data[0].foo** => *foo* field of first item of *barList* node
+ self_ | Node_ | current node object that hold data of current complex type_ | **self.data.foo** => foo field of current node, **self.parent.data.foo** => foo field of parent node, **self.data.bar.foo** => foo field of bar object in current node.
+ value | string | (not available in default_ field) The raw string value of the current tag in `source document`_ | **value=='Computer'**,**value.startWith('bar')**
+
+.. seealso::
+
+ Node_ , default_, filter_, normalize_, `$extends`_, `$ref`_
+
+
+
+
+_`all`
+---------
+
+-------------------------
+
+Each complex type_ creates a node_. The created nodes can be accessed using the "all" object in the expressions.
+Each node is stored in all_ map with the uniqueName_ of the `Parsing Element`_ that creates the node.
+
+
+
+
+
+.. code-block:: yaml
+
+ result:
+ type: array
+ fields:
+ order:
+ type: object
+ fields:
+ state: string
+ createDate: date
+ saleLines:
+ type: array
+ fields:
+ product:
+ type: object
+ fields:
+ id: string
+ name: string
+ price: string
+ quantity: long
+ unit: string
+
+ company:
+ type: object
+ fields:
+ id: string
+ name: string
+ price: string
+
+
+for configuration at above following all_ map is created.
+
+
+.. code-block:: yaml
+
+ result:
+ parent: null
+ data:
+ order: order.data # contains data of the order node
+ company: company.data
+ order:
+ parent: result
+ data:
+ orderLines: orderLines.data
+ company:
+ parent: result
+ data: {}
+ orderLines:
+ parent: order
+ data: [{ product:product.data }] # data is array. each item contains product data
+ product:
+ parent: orderLines
+ data: {}
+
+Example usages:
+
+:product.parent: is equals orderLine node
+:product.parent.data: is equals orderLine.data
+:product.parent.parent: is equals order
+:product.parent.parent.data: is equals order.data
+:product.parent.parent.parent: is equals result
+:order.data.orderLine: is equals orderLine.data
+:order.data.orderLine[lastIndex].product: is equals product.data
+
+
+_`self`
+---------------
+
+-------------------------
+
+current node object that hold data of current complex type_.
+
+Example usages:
+
+:self.parent: parent node
+:self.data.foo: foo field of current object
+:self.data[0]: First element of current array
+
+
+**Example**
+------------
+
+------------------------------
+
+.. content-tabs::
+
+ .. tab-container:: yaml
+ :title: YAML
+
+ .. code-block:: yaml
+
+ version: 1.0
+ result:
+ type: object
+ path: /
+ fields:
+ name:
+ - filter: $ self.data.categoryType=='foo' # filter expression.
+ default:
+ value: foo # force set name to foo with filter
+ force: true
+ - path: name
+ category:
+ type: object
+ fields:
+ id: int
+ name:
+ default: self.parent.data.categoryType=='foo'? 'Foo':'Bar' # default value is expression.
+ categoryType:
+ default: all.data.categoryType=='foo'? 'Foo':'Bar' # default value is expression. and its is equivalent of expression in category.name property.
+ productUnit:
+ default: $ self.data.categoryType=='foo'? 'LT': 'KG' # default value is expression.
+ categoryType:
+ default: "foo" # default value a is a string.
+
+ .. tab-container:: json
+ :title: JSON
+
+ .. code-block:: json
+
+ {
+ "version": 1.0,
+ "result":{
+ "type":object",
+ "path":"/" ,
+ "fields":{
+ "name":"string",
+ "category":{
+ "id": "int",
+ "name": {
+ "default": "self.parent.data.categoryType=='foo'? 'Foo':'Bar'",
+ },
+ "categoryType": {
+ "default": "default: all.data.categoryType=='foo'? 'Foo':'Bar'",
+ }
+ },
+ "productUnit":{
+ "default": " $self.data.categoryType=='foo'? 'LT': 'KG'"
+ },
+ "categoryType":{
+ "default": "foo"
+ }
+ }
+ }
+ }
+
diff --git a/docs/build/html/_sources/specification/FieldAssignmentOrder.rst.txt b/docs/build/html/_sources/specification/FieldAssignmentOrder.rst.txt
new file mode 100644
index 0000000..a5c09ee
--- /dev/null
+++ b/docs/build/html/_sources/specification/FieldAssignmentOrder.rst.txt
@@ -0,0 +1,262 @@
+.. _`assignment order`:
+
+**************************
+Property Assignment Order
+**************************
+
+-----------------------------------
+
+The property assignment order is very important for the correct operation of the expressions in the filter field and in the default field
+Referencing a not existing field in "self.data" can cause NullPointerException.
+
+DSM reads `source document` top to bottom in one pass as a stream.
+Once it reads a tag `source document`, it checks whether absolute_ path of the tag match with tagAbsolutePath_ or taParentAbsolutePath_ of any of `Parsing Element`_
+if Parsing Element founds, value of tag is assigned according to `Parsing Element`_ definitions.
+
+The Property assignment work as follows:
+
+let's name the tag that is pointed by path_ as **current tag** and the tag that is pointed by parentPath as **parent tag**
+
+The property is assigned when **current tag** is closed except attribute_ properties for the XML document.
+The attribute_ properties is assigned at start of **parent tag** by reading attribute value of **parent tag**
+
+
+Order of the property assignment as follows:
+ - the closing of `current tag`_ is near to the document header(starting of _`parent tag`" for attribute )
+ - deeper `current tag`_
+ - Parsing Element definition close to the document header.(**assignment start from top to bottom** )
+
+The default_ value of a property is assigned when current tag not exist in source document and **parent tag"** is closed(for all property, include attribute_).
+
+default_ value is assigned only once except force_ field is true. if force_ field is true default value is assigned at both start and close of **parent tag**
+
+Order of the default value of property assignment as follows:
+ - assure the property is not assigned or force field is true
+ - the closing of `parent tag`_is near to the document header.
+ - deeper `parent tag`_
+ - Parsing Element definition far to the document header.(**assignment start bottom to top** )
+
+
+Example:
+
+.. code-block:: xml
+
+
+
+
+ 1
+ Cats
+
+ 6598053714149410844
+ Van Kedisi
+
+ url1
+ url2
+ url3
+
+ sold
+
+
+ 1
+ New
+
+
+ 2
+ Cute
+
+
+ 3
+ Popular
+
+
+
+
+
+.. code-block:: yaml
+
+ result:
+ type: array
+ path: /
+ xml:
+ path: "/Pets/Pet"
+ fields:
+ id:long
+ name:
+ status:
+ isPopular:
+ default $self.data.tags.stream().anyMatch(s->s.name=='Popular')
+ category:
+ type: object
+ fields:
+ name:
+ id: long
+ photoUrls:
+ type: array
+ path: photoUrls
+ xml:
+ path: photoUrls/photoUrls
+ tags:
+ type: array
+ path: tags
+ xml:
+ path: tags/tag
+ fields:
+ id:int
+ name:
+
+
+
+DSM read document top to bottom.
+
+- it founds **/Pets/Pet** absolute_ path that match with **result** Parsing Element. Then create a **array** and put first item into the array.
+
+.. code-block:: json
+
+ result=[{}]
+
+- it founds **/Pets/Pet/category** match with **category** Parsing Element. then it create a **object** and assign it to **category** property
+
+.. code-block:: json
+
+ result=[{
+ "category":{}
+ }]
+
+
+- it founds **/Pets/Pet/category/id** match with **category.id** Parsing Element. then it assign it to **id** property of **category object**.
+
+.. code-block:: json
+
+ result=[{
+ "category":{
+ "id": 3
+ }
+ }]
+- it founds **/Pets/Pet/category/name** match with **category.name** Parsing Element. then the value is assigned
+
+.. code-block:: json
+
+ result=[{
+ "category":{
+ "id": 3,
+ "name": "Cats"
+ }
+ }]
+
+
+- it founds **/Pets/Pet/id** match with **id** then the value is assigned
+
+.. code-block:: json
+
+ result=[{
+ "category":{
+ "id": 3,
+ "name": "Cats"
+ }
+ "id":1
+ }]
+
+
+- it founds **/Pets/Pet/name** match with **name** then the value is assigned
+
+.. code-block:: json
+
+ result=[{
+ "category":{
+ "id": 3,
+ "name": "Cats"
+ },
+ "id":1,
+ "name":"Van Kedisi",
+ }]
+
+
+- it founds **/Pets/Pet/photoUrls/photoUrl** match with **photoUrls** Parsing Element then the new array is created and assigned
+
+.. code-block:: json
+
+ result=[{
+ "category":{
+ "id": 3,
+ "name": "Cats"
+ },
+ "id":1,
+ "name":"Van Kedisi",
+ "photoUrls":[]
+ }]
+
+- it founds **/Pets/Pet/photoUrls/photoUrl** match with **photoUrls** then the value of **photoUrls** is assigned
+
+.. code-block:: json
+
+ result=[{
+ "category":{
+ "id": 3,
+ "name": "Cats"
+ },
+ "id":1,
+ "name":"Van Kedisi",
+ "photoUrls":["url1","url2","url3"]
+ }]
+
+after reading all fields under **/Pets/Pet** path following result generated.
+
+
+.. code-block:: json
+
+ result=[{
+ "category":{
+ "id": 3,
+ "name": "Cats"
+ },
+ "id":1,
+ "name":"Van Kedisi",
+ "photoUrls":["url1","url2","url3"],
+ "status":"sold",
+ "tags":[
+ {
+ "id":1,
+ "name": "New"
+ },
+ {
+ "id":1,
+ "name": "Cute"
+ },
+ {
+ "id":1,
+ "name": "Popular"
+ }
+ ]
+
+ }]
+
+- it can't find **/Pets/Pet/isPopular** but **isPopular** property has **default** value. When **/Pets/Pet** (**parent tag**) tag is closed then it's expression is evaluated. The result of expression is assigned to **isPopular** property.
+
+.. code-block:: json
+
+ result=[{
+ "category":{
+ "id": 3,
+ "name": "Cats"
+ },
+ "id":1,
+ "name":"Van Kedisi",
+ "photoUrls":["url1","url2",url3"],
+ "status":"sold",
+ "tags":[
+ {
+ "id":1,
+ "name": "New"
+ },
+ {
+ "id":1,
+ "name": "Cute"
+ },
+ {
+ "id":1,
+ "name": "Popular"
+ }
+ ],
+ "isPopular": true
+ }]
+
diff --git a/docs/build/html/_sources/specification/MergeOfDocument.rst.txt b/docs/build/html/_sources/specification/MergeOfDocument.rst.txt
new file mode 100644
index 0000000..c549cc1
--- /dev/null
+++ b/docs/build/html/_sources/specification/MergeOfDocument.rst.txt
@@ -0,0 +1,117 @@
+
+.. _merge:
+.. _merged:
+.. _extended:
+.. _extend:
+.. _extends:
+
+*************************
+Merge of DSM Document
+*************************
+
+---------------------
+
+
+`DSM document`_ can extends to another DSM document by using `$extends`_ field.
+
+`Parsing Element`_ can extends to another Parsing Element by using `$ref`_ field.
+
+DSM documents and Parsing Elements are merged with each other.
+
+Before going to explain merge process lets make some definition.
+
+source:
+ DSM Document or Parsing Element that we want to extend to another.
+
+target:
+ DSM Document or Parsing Element that we want to extend to.
+
+
+Merge process work as follows:
+ for every field of target do followings:
+ 1. if field **not exist** in source, **copy** value of target to source.
+
+ 2. if field **exist** in source do followings
+
+ 2.1. if **dataType** of fields is **different** then **skip** this field.
+
+ 2.2. if **dataType** of fields is **same** then do followings
+
+ 2.2.1. if **dataType** is **simpleDataType** (string,number) then **skip** this field (do not copy target to source)
+
+ 2.2.2. if **dataType** is **array** then **add** target values to **start of** the source values
+
+ 2.2.3. if **dataType** is **map** then **start Merge process** for those two map.
+
+Example merge process of DSM documents:
+
+external DSM Document:(external.yaml)
+
+.. code-block:: yaml
+
+ version: 1.0
+ params:
+ dateFormat: dd.MM.yyyy
+ rootPath: /foo/bar
+ acceptedCountryCode: [TR,US,FR]
+ transformations:
+ COUNTRY_CODE_TO_NAME:
+ map:
+ DEFAULT: Other
+ TR: Turkey
+ US: United States
+ result:
+ fields:
+ id: string
+ name: string
+ price: double
+
+
+current DSM Document:
+
+.. code-block:: yaml
+
+ version: 1.0
+ $extends: $params.rootPath.concat("external.yaml") # resolve expression
+ params:
+ rootPath: /DSM/MAIN
+ acceptedCountryCode: [UK]
+ transformations:
+ COUNTRY_CODE_TO_NAME:
+ map:
+ UK: United Kingdom
+ result:
+ type: object
+ path: /
+ fields:
+ category: string
+
+
+After merge process following configuration will take effect:
+
+
+.. code-block:: yaml
+
+ version: 1.0
+ $extends: $params.rootPath.concat("external.yaml")
+ params:
+ dateFormat: dd.MM.yyyy # (rule 1) imported from external document
+ rootPath: /DSM/MAIN # (rule 2.2.1) overwritten by current DSM document
+ acceptedCountryCode: [TR,US,FR,UK] #(rule 2.2.2) external list element added to start off current list element(UK is only exist in current document and located at the end )
+ transformations: #(rule 2.2.3) transformations field exist in both source and target and type is MAP
+ COUNTRY_CODE_TO_NAME: #(rule 2.2.3)
+ map:
+ UK: United Kingdom # only exist in current DSM document
+ DEFAULT: Other # (rule 1) imported from external document
+ TR: Turkey # (rule 1) imported from external document
+ US: United States # (rule 1) imported from external document
+
+ result:
+ type: object # exist only current DSM document
+ path: /
+ fields:
+ category: string # exist only current DSM document
+ id: string
+ name: string # imported from external document
+ price: double
+
diff --git a/docs/build/html/_sources/specification/NodeObject.rst.txt b/docs/build/html/_sources/specification/NodeObject.rst.txt
new file mode 100644
index 0000000..f4d1f62
--- /dev/null
+++ b/docs/build/html/_sources/specification/NodeObject.rst.txt
@@ -0,0 +1,77 @@
+.. _node:
+.. _nodes:
+
+Node Object
+============
+The node is a data structure used in the DSM to store data and create the hierarchy of the DSM document.
+Nodes are created with the complex type_ definition during parsing of source document.
+It can be used in the parsing time expressions
+
+Fields:
+
+.. csv-table::
+ :header: Field Name, Type, Description
+ :stub-columns: 1
+ :delim: |
+
+ parent | Node | parent node.
+ data | Map, List