diff --git a/include/erlsom.hrl b/include/erlsom.hrl
deleted file mode 100644
index e3b520f..0000000
--- a/include/erlsom.hrl
+++ /dev/null
@@ -1,27 +0,0 @@
-%%% Copyright (C) 2006 - 2008 Willem de Jong
-%%%
-%%% This file is part of Erlsom.
-%%%
-%%% Erlsom is free software: you can redistribute it and/or modify
-%%% it under the terms of the GNU Lesser General Public License as
-%%% published by the Free Software Foundation, either version 3 of
-%%% the License, or (at your option) any later version.
-%%%
-%%% Erlsom is distributed in the hope that it will be useful,
-%%% but WITHOUT ANY WARRANTY; without even the implied warranty of
-%%% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-%%% GNU Lesser General Public License for more details.
-%%%
-%%% You should have received a copy of the GNU Lesser General Public
-%%% License along with Erlsom. If not, see
-%%% .
-%%%
-%%% Author contact: w.a.de.jong@gmail.com
-
-%%% ====================================================================
-%%% Header file for erlsom
-%%% ====================================================================
-
-%% prefix=the prefix that will be used in the result
--record(ns, {uri, prefix}).
--record(qname, {uri, localPart, prefix, mappedPrefix}).
diff --git a/include/erlsom_compile.hrl b/include/erlsom_compile.hrl
deleted file mode 100644
index 18c13ea..0000000
--- a/include/erlsom_compile.hrl
+++ /dev/null
@@ -1,91 +0,0 @@
-%%% Copyright (C) 2006 - 2008 Willem de Jong
-%%%
-%%% This file is part of Erlsom.
-%%%
-%%% Erlsom is free software: you can redistribute it and/or modify
-%%% it under the terms of the GNU Lesser General Public License as
-%%% published by the Free Software Foundation, either version 3 of
-%%% the License, or (at your option) any later version.
-%%%
-%%% Erlsom is distributed in the hope that it will be useful,
-%%% but WITHOUT ANY WARRANTY; without even the implied warranty of
-%%% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-%%% GNU Lesser General Public License for more details.
-%%%
-%%% You should have received a copy of the GNU Lesser General Public
-%%% License along with Erlsom. If not, see
-%%% .
-%%%
-%%% Author contact: w.a.de.jong@gmail.com
-
-%%% ====================================================================
-%%% Header file for erlsom_compile
-%%% ====================================================================
-
-
-%% records for the structures as found in the XSD
--record(schemaType,
- {elInfo, targetNamespace, elementFormDefault, attributeFormDefault, blockDefault, finalDefault,
- version, id, imports, elements}).
--record(importType, {elInfo, id, namespace, schemaLocation, annotation}).
--record(includeType, {elInfo, id, schemaLocation, annotation}).
--record(redefineType, {elInfo, id, schemaLocation, elements}).
--record(globalElementType, {elInfo, name, type, default, fixed, id, abstract, substitutionGroup, final, nillable,
- annotation, simpleOrComplex, unique}).
--record(localElementType, {elInfo, name, type, default, fixed, form, ref, minOccurs, maxOccurs, nillable, annotation,
- simpleOrComplex, unique}).
--record(globalComplexTypeType, {elInfo, name, final, abstract, block, mixed, id, annotation, model, attributes, anyAttribute}).
--record(localComplexTypeType, {elInfo, mixed, annotation, model, attributes, anyAttribute}).
--record(globalSimpleTypeType, {elInfo, name, id, annotation, model}).
--record(localSimpleTypeType, {elInfo, annotation, model}).
--record(simpleContentType, {elInfo, annotation, model, id}).
--record(groupDefType, {elInfo, name, annotation, model}).
--record(groupRefType, {elInfo, ref, minOccurs, maxOccurs}).
--record(annotationType, {elInfo, annotation}).
--record(globalAttributeType, {elInfo, name, type, use, fixed, default, id, model}).
--record(localAttributeType, {elInfo, name, type, use, ref, fixed, form, default, model}).
--record(choiceType, {elInfo, id, minOccurs, maxOccurs, annotation, alternatives}).
--record(sequenceType, {elInfo, annotation, elements, minOccurs, maxOccurs}).
--record(allType, {elInfo, annotation, elements, minOccurs, maxOccurs}).
--record(attributeGroupDefType, {elInfo, id, name, annotation, attributes, anyAttribute}).
--record(attributeGroupRefType, {elInfo, ref, id}).
--record(anyType, {elInfo, any, minOccurs, maxOccurs, namespace, processContents}).
--record(anyAttributeType, {elInfo, id, namespace, processContents, annotation}).
--record(extensionType, {elInfo, base, annotation, attributes, anyAttribute}).
--record(extensionTypeC, {elInfo, base, annotation, model, attributes, anyAttribute}).
--record(restrictionType, {elInfo, annotation, any, attributes, anyAttribute, base}).
--record(restrictionTypeC, {elInfo, base, annotation, model, attributes, anyAttribute}).
--record(complexContentType, {elInfo, annotation, model, mixed}).
-
-%% This is added to the XSD to allow generation of an XML document
--record(namespaceType, {prefix, 'URI'}).
-
-%% the rest is for internal use in the translation of the XSD to the
-%% format used by the parser
-%% path is used to give local elements a unique name (the 'path' to the element)
--record(schemaInfo, {targetNamespace, elementFormDefault, namespacePrefix, namespaces, path=[], attGrps, atts, th}).
-
-%% typeInfo - the intermediate format.
-%% global (true or false): we need to find out in the
-%% end whether this type should be available as 'top level' element in the
-%% xml document.
--record(typeInfo, {typeName,
- global,
- typeType,
- typeRef,
- elements,
- attributes = [],
- anyAttr,
- seqOrAll,
- extends,
- restricts,
- mixed,
- base,
- substitutionGroup,
- min = 1,
- max = 1}).
-
--record(elementInfo, {alternatives, min = 1, max = 1, nillable}).
--record(alternative, {tag, type, real, min = 1, max = 1, anyInfo}).
--record(attrib, {name, optional, type, ref}).
--record(attGrp, {name, atts, anyAttr}).
diff --git a/include/erlsom_parse.hrl b/include/erlsom_parse.hrl
deleted file mode 100644
index f34fff8..0000000
--- a/include/erlsom_parse.hrl
+++ /dev/null
@@ -1,72 +0,0 @@
-%%% Copyright (C) 2006 - 2008 Willem de Jong
-%%%
-%%% This file is part of Erlsom.
-%%%
-%%% Erlsom is free software: you can redistribute it and/or modify
-%%% it under the terms of the GNU Lesser General Public License as
-%%% published by the Free Software Foundation, either version 3 of
-%%% the License, or (at your option) any later version.
-%%%
-%%% Erlsom is distributed in the hope that it will be useful,
-%%% but WITHOUT ANY WARRANTY; without even the implied warranty of
-%%% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-%%% GNU Lesser General Public License for more details.
-%%%
-%%% You should have received a copy of the GNU Lesser General Public
-%%% License along with Erlsom. If not, see
-%%% .
-%%%
-%%% Author contact: w.a.de.jong@gmail.com
-
-%%% ====================================================================
-%%% header file for erslom_parse
-%%% ====================================================================
-
-%% header file for erlsom_parse. Contains the record definitions.
-
-%% the records that form the model - see erlsom_parse.erl for a
-%% description.
-
--record(model, {tps, nss,
- tns, %% target namespace (the URI, a string)
- th %% type hierarchy, see 'tree'-functions in erlsom_lib
- }).
--record(type, {nm, tp = sequence, els, atts = [], anyAttr, nillable, nr,
- mn = 1, mx = 1, mxd = false, %% mn & mx are only used by erlsom_compile
- typeName}).
- %% typeName is the 'real' name, to be used in xsi:type attributes
- %% for derived types. The 'nm' field is actually a key, which may
- %% include an additional prefix to differntiate between elements, types
- %% and groups.
--record(el, {alts, mn = 1, mx = 1, nillable, nr}).
--record(alt, {tag, tp, nxt = [], mn = 1, mx = 1, rl = true, anyInfo}).
--record(att, {nm, nr, opt, tp}).
-%% -record(ns, {uri, pf}).
--record(elInfo, {anyAttr}).
--record(anyAttr, {prCont, ns, tns}). %% for anyAttributes
--record(anyInfo, {prCont, ns, tns}). %% for any elements
-
--record(state, {currentState, resultSoFar, model, namespaces,
- allNamespaces, continuationState}).
-
--record(cs, {re, %% remaining elements
- sf, %% nr of elements of the current type received so far
- er, %% element record: the result (so far) for this type
- rl, %% 'real element': do we expect an end-tag?
- mxd}). %% is this a mixed type?
-
--record(all, {re, %% remaining elements
- nr, %% the sequence number of the current element
- er}). %% element record: the result (so far) for this type
-
-%% altState is used for parsing alternatives within
-%% a choice that can occur more than once
--record(altState, {name, %% the tag we are processing
- type, %% the type of this element
- real, %% is this a 'real' element or a group ref
- receivedSoFar, %% number of elements received
- acc, %% values of elements already processed
- min, %% minOccurs
- max}). %% maxOccurs
-
--record(anyState, {anyInfo}).
diff --git a/include/erlsom_sax.hrl b/include/erlsom_sax.hrl
deleted file mode 100644
index 4d6ad06..0000000
--- a/include/erlsom_sax.hrl
+++ /dev/null
@@ -1,90 +0,0 @@
-%%% Copyright (C) 2006 - 2008 Willem de Jong
-%%%
-%%% This file is part of Erlsom.
-%%%
-%%% Erlsom is free software: you can redistribute it and/or modify
-%%% it under the terms of the GNU Lesser General Public License as
-%%% published by the Free Software Foundation, either version 3 of
-%%% the License, or (at your option) any later version.
-%%%
-%%% Erlsom is distributed in the hope that it will be useful,
-%%% but WITHOUT ANY WARRANTY; without even the implied warranty of
-%%% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-%%% GNU Lesser General Public License for more details.
-%%%
-%%% You should have received a copy of the GNU Lesser General Public
-%%% License along with Erlsom. If not, see
-%%% .
-%%%
-%%% Author contact: w.a.de.jong@gmail.com
-
-%%% ====================================================================
-%%% data structures produced by erlsom_sax
-%%% ====================================================================
-
-%% data structures produced by sax.erl.
-
--record(attribute, {localName, prefix = [], uri = [], value}).
-
--record(erlsom_sax_state,
- {user_state,
- callback,
- encoding, %% of input document
- continuation_state,
- entities = [],
- par_entities = [],
- current_entity = '__top',
- namespaces = [],
- endtags = [],
- output, %% determines the encoding of text and atttribute values
- expand_entities = true, %% if false, user defined entities will
- %% be ignored in the DTD, and use of entities
- %% will fail.
- max_entity_depth = 2, %% Maximum level of nesting of entities. 2 means: an
- %% an entity can refer to 1 or more other entities,
- %% but none of those can contain entity references.
- max_entity_size = 2000, %% Maximum size of a single entity
- max_nr_of_entities = 100, %% Maximum number of entities that can be defined.
- %% Note that a large number can lead to long
- %% processing to find cycles, unless max depth has
- %% been set to a small number.
- max_expanded_entity_size = 10000000, %% Maximum total number of bytes of all
- %% expanded entities together.
- entity_size_acc = 0, %% accumulated size of entities
- continuation_fun,
- %% entity_relations is used to check on circular definitions
- entity_relations = []}).
-
-%% useful macro approach copied from xmerl
--define(space, 32).
--define(cr, 13).
--define(lf, 10).
--define(tab, 9).
-
-%% whitespace consists of 'space', 'carriage return', 'line feed' or 'tab'
--define(is_whitespace(C),
- C =:= ?space; C =:= ?cr ; C =:= ?lf; C =:= ?tab).
-
--define(is_namestart_char(C),
- C > 96, C < 123; C > 64, C < 91; C =:= $_).
-
--define(is_namestart_char2(C), %% also for characters <> 7 bit asscii
- C > 96, C < 123; C > 64, C < 91; C =:= $_;
- C > 191, C =/= 215, C =/= 247). %% this check is far from complete!
-
--define(is_name_char(C),
- C > 96, C < 123;
- C > 64, C < 91;
- C > 47, C < 58;
- C =:= $_;
- C =:= $-;
- C =:= $.).
-
--define(is_name_char2(C), %% also for characters <> 7 bit ascii
- C > 96, C < 123;
- C > 64, C < 91;
- C > 47, C < 58;
- C =:= $_;
- C =:= $-;
- C =:= $.;
- C > 191, C /= 215, C /= 247). %% this check is far from complete!
diff --git a/rebar.config b/rebar.config
index 01cde8d..dcb5ac3 100644
--- a/rebar.config
+++ b/rebar.config
@@ -10,6 +10,8 @@
%% Erlang compiler options
{erl_opts, [ debug_info
% , warnings_as_errors
+ , {i, "include"}
+ , {i, "deps/*/include"}
]}.
diff --git a/src/demo.erl b/src/demo.erl
deleted file mode 100755
index 841ab61..0000000
--- a/src/demo.erl
+++ /dev/null
@@ -1,49 +0,0 @@
--module(demo).
-
--compile(export_all).
-
-gen_hrl()->
- write_hrl:write_hrl_file(
- "../tests/vodkatv/vodkatv.xsd",
- "vodkatv.hrl").
-
-gen_eqc_statem()->
- write_eqc_statem:write_eqc_statem(
- "../tests/vodkatv/vodkatv.wsdl",
- "../tests/vodkatv/vodkatv.xsd",
- none,
- "vodkatv_sut",
- tuple,
- "vodkatv_eqc.erl").
-
-gen_sut_api() ->
- write_sut_api:write_sut_api(
- none,
- "../tests/vodkatv/vodkatv.wsdl",
- "../tests/vodkatv/vodkatv.xsd",
- "http://localhost:8082/vodkatv/",
- "vodkatv_sut.erl").
-
-
-gen_diff() ->
- ws_diff:gen_diff("../tests/vodkatv-wsdl-evolution/2014-01-29",
- "../tests/vodkatv-wsdl-evolution/2014-02-17").
-
-
-gen_refac_script() ->
- gen_refac_script:gen_refac_script(
- {"../tests/vodkatv-wsdl-evolution/2014-01-29/vodkatv.wsdl",
- "../tests/vodkatv-wsdl-evolution/2014-01-29/vodkatv.xsd"},
- {"../tests/vodkatv-wsdl-evolution/2014-02-17/vodkatv.wsdl",
- "../tests/vodkatv-wsdl-evolution/2014-02-17/vodkatv.xsd"},
- "refac_script.erl").
-
-
-gen_eqc_statem_140129()->
- write_eqc_statem:write_eqc_statem(
- "../tests/vodkatv-wsdl-evolution/2014-01-29/vodkatv.wsdl",
- "../tests/vodkatv-wsdl-evolution/2014-01-29/vodkatv.xsd",
- none,
- "vodkatv_sut",
- non_tuple,
- "vodkatv_eqc_140129.erl").
diff --git a/src/gen_refac_script.erl b/src/gen_refac_script.erl
index 626fcb9..b7473e4 100644
--- a/src/gen_refac_script.erl
+++ b/src/gen_refac_script.erl
@@ -37,9 +37,9 @@
-export([test/0, test1/0]).
--include("../include/erlsom_parse.hrl").
--include("../include/erlsom.hrl").
--include("../include/wsdl20.hrl").
+-include_lib("erlsom/include/erlsom_parse.hrl").
+-include_lib("erlsom/include/erlsom.hrl").
+-include("wsdl20.hrl").
-define(Editor, emacs).
diff --git a/src/gen_xsd_model.erl b/src/gen_xsd_model.erl
index 47aedc8..d45d875 100644
--- a/src/gen_xsd_model.erl
+++ b/src/gen_xsd_model.erl
@@ -35,10 +35,10 @@
-export([test/0, test1/0, test2/0, test3/0]).
--include("../include/erlsom_parse.hrl").
--include("../include/erlsom.hrl").
+-include_lib("erlsom/include/erlsom_parse.hrl").
+-include_lib("erlsom/include/erlsom.hrl").
-include_lib("xmerl/include/xmerl.hrl").
--include("../include/wsdl20.hrl").
+-include("wsdl20.hrl").
%%@private
test()->
diff --git a/src/write_data_gen.erl b/src/write_data_gen.erl
index 831986e..50b38a1 100644
--- a/src/write_data_gen.erl
+++ b/src/write_data_gen.erl
@@ -39,9 +39,9 @@
-compile(export_all).
--include("../include/erlsom_parse.hrl").
--includeb("../include/erlsom.hrl").
--include("../include/wsdl20.hrl").
+-include_lib("erlsom/include/erlsom_parse.hrl").
+-include_lib("erlsom/include/erlsom.hrl").
+-include("wsdl20.hrl").
-include_lib("eqc/include/eqc.hrl").
%%@private
diff --git a/src/write_eqc_statem.erl b/src/write_eqc_statem.erl
index c62f2ac..23a662a 100644
--- a/src/write_eqc_statem.erl
+++ b/src/write_eqc_statem.erl
@@ -35,9 +35,9 @@
-export([test0/0, test1/0, test2/0, test3/0]).
--include("../include/erlsom_parse.hrl").
--include("../include/erlsom.hrl").
--include("../include/wsdl20.hrl").
+-include_lib("erlsom/include/erlsom_parse.hrl").
+-include_lib("erlsom/include/erlsom.hrl").
+-include("wsdl20.hrl").
-type module_name()::atom().
@@ -99,6 +99,7 @@ test3() ->
write_eqc_statem(WsdlFile, XsdFile,HrlFile, SUT, Style, OutFile) ->
{ok, Model} = erlsom:compile_xsd_file("../priv/wsdl20.xsd"),
Model1 = erlsom:add_xsd_model(Model),
+% io:format("--> ~p~n", [Model1]),
Result=erlsom:parse_file(WsdlFile, Model1),
case Result of
{ok, Res} ->
diff --git a/src/write_hrl.erl b/src/write_hrl.erl
index 9f255c3..764b80c 100644
--- a/src/write_hrl.erl
+++ b/src/write_hrl.erl
@@ -36,8 +36,8 @@
-export([test/0]).
--include("../include/erlsom_parse.hrl").
--include("../include/erlsom.hrl").
+-include_lib("erlsom/include/erlsom_parse.hrl").
+-include_lib("erlsom/include/erlsom.hrl").
-compile(export_all).
diff --git a/src/write_sut_api.erl b/src/write_sut_api.erl
index 311a6db..6fc0d30 100644
--- a/src/write_sut_api.erl
+++ b/src/write_sut_api.erl
@@ -39,9 +39,9 @@
-compile(export_all).
--include("../include/erlsom_parse.hrl").
--include("../include/erlsom.hrl").
--include("../include/wsdl20.hrl").
+-include_lib("erlsom/include/erlsom_parse.hrl").
+-include_lib("erlsom/include/erlsom.hrl").
+-include("wsdl20.hrl").
vodkatv_sut() ->
write_sut_api(
diff --git a/src/ws_diff.erl b/src/ws_diff.erl
index 49078ec..0c63289 100644
--- a/src/ws_diff.erl
+++ b/src/ws_diff.erl
@@ -34,9 +34,9 @@
-export([test/0]).
--include("../include/erlsom_parse.hrl").
--include("../include/erlsom.hrl").
--include("../include/wsdl20.hrl").
+-include_lib("erlsom/include/erlsom_parse.hrl").
+-include_lib("erlsom/include/erlsom.hrl").
+-include("wsdl20.hrl").
-compile(export_all).
diff --git a/src/ws_lib.erl b/src/ws_lib.erl
index 7021698..3000835 100644
--- a/src/ws_lib.erl
+++ b/src/ws_lib.erl
@@ -34,8 +34,8 @@
-compile(export_all).
--include("erlsom_parse.hrl").
--include("erlsom.hrl").
+-include_lib("erlsom/include/erlsom_parse.hrl").
+-include_lib("erlsom/include/erlsom.hrl").
is_simple_type(#type{anyAttr=Attrs})->