From 009930791aea678f64b40f82eed92f9c4aaa6fca Mon Sep 17 00:00:00 2001 From: "Kian-Meng, Ang" Date: Tue, 14 Sep 2021 08:19:33 +0800 Subject: [PATCH] Fix typos --- README.md | 2 +- examples/complex_form/erlsom_complex_form.erl | 4 ++-- examples/erlsom_sax_example/sax_example.xml | 2 +- make-release | 6 ++--- src/erlsom.erl | 2 +- src/erlsom_compile.erl | 12 +++++----- src/erlsom_compile.hrl | 2 +- src/erlsom_lib.erl | 8 +++---- src/erlsom_parse.erl | 22 +++++++++---------- src/erlsom_parse.hrl | 2 +- src/erlsom_parseXsd.erl | 2 +- src/erlsom_pass2.erl | 6 ++--- src/erlsom_sax.hrl | 4 ++-- src/erlsom_sax_latin1.erl | 8 +++---- src/erlsom_sax_latin9.erl | 8 +++---- src/erlsom_sax_list.erl | 8 +++---- src/erlsom_sax_utf16be.erl | 8 +++---- src/erlsom_sax_utf16le.erl | 8 +++---- src/erlsom_sax_utf8.erl | 8 +++---- src/erlsom_type2xsd.erl | 2 +- src/erlsom_ucs.erl | 4 ++-- src/erlsom_write.erl | 6 ++--- src/erlsom_writeHrl.erl | 2 +- 23 files changed, 68 insertions(+), 68 deletions(-) diff --git a/README.md b/README.md index 8d8a689..4b0976d 100644 --- a/README.md +++ b/README.md @@ -378,7 +378,7 @@ The output can be interpreted as a structure built from Erlang records. The definition of these records can either be generated by erlsom:write_xsd_hrl_file/3, or you can define them yourself (or a combination: you can run write_xsd_hrl_file and change a few fieldnames and add some -defaults). An extract of the .hrl file genrated by write_xsd_hrl_file/3: +defaults). An extract of the .hrl file generated by write_xsd_hrl_file/3: ```erlang -record('USAddress', {anyAttribs :: anyAttribs(), diff --git a/examples/complex_form/erlsom_complex_form.erl b/examples/complex_form/erlsom_complex_form.erl index 724fff5..3730de9 100644 --- a/examples/complex_form/erlsom_complex_form.erl +++ b/examples/complex_form/erlsom_complex_form.erl @@ -1,6 +1,6 @@ %%% translate XML to the output format used by XMERL. %%% The output is not complete: some fields in the XMERL output records -%%% are not populated. But is it enough to use the XPATH fucntions (at +%%% are not populated. But is it enough to use the XPATH functions (at %%% least for the examples that I tried). %%% %%% Note: this hasn't been tested properly. See it as an example of how @@ -17,7 +17,7 @@ -include_lib("erlsom/src/erlsom_sax.hrl"). -%% The record defintions below are copied from xmerl hrl files! +%% The record definitions below are copied from xmerl hrl files! %% XML Element %% content = [#xmlElement()|#xmlText()|#xmlPI()|#xmlComment()|#xmlDecl()] -record(xmlElement,{ diff --git a/examples/erlsom_sax_example/sax_example.xml b/examples/erlsom_sax_example/sax_example.xml index eaecbe1..23d7894 100644 --- a/examples/erlsom_sax_example/sax_example.xml +++ b/examples/erlsom_sax_example/sax_example.xml @@ -5,7 +5,7 @@ - + diff --git a/make-release b/make-release index 8687d72..0015054 100755 --- a/make-release +++ b/make-release @@ -3,7 +3,7 @@ set -x . ./vsn.mk -echo tagging and packing release ${ERLSOM_VSN} +echo tagging and packing release ${ERLSOM_VSN} CVS_RSH=ssh Y=`echo ${ERLSOM_VSN} | sed 's/\./-/g'` @@ -18,7 +18,7 @@ rm -rf erlsom-0.0.1 2> /dev/null cvs tag -F erlsom-${Y} -rm -rf tmp +rm -rf tmp mkdir tmp cvs export -d tmp -r erlsom-$Y . @@ -30,7 +30,7 @@ mv erlsom erlsom-${ERLSOM_VSN} tar cfz erlsom-${ERLSOM_VSN}.tar.gz erlsom-${ERLSOM_VSN} -echo new release resides in `pwd`/erlsom-${ERLSOM_VSN}.tar.gz +echo new release resides in `pwd`/erlsom-${ERLSOM_VSN}.tar.gz diff --git a/src/erlsom.erl b/src/erlsom.erl index c4c43b5..7ecb7cc 100644 --- a/src/erlsom.erl +++ b/src/erlsom.erl @@ -375,7 +375,7 @@ write(Struct, Model, Options) -> %% description of the events %% - State - a term() %% -%% EventFun should return State, a term() that wil be passed back to +%% EventFun should return State, a term() that will be passed back to %% the next invocation of EventFun. %% %% Options - [Option] diff --git a/src/erlsom_compile.erl b/src/erlsom_compile.erl index 2acf491..26a6b8a 100644 --- a/src/erlsom_compile.erl +++ b/src/erlsom_compile.erl @@ -43,7 +43,7 @@ %% - special treatment is necessary for choices where (some or all) %% alternatives have the same type: otherwise it will not be possible %% to recognise from the result which alternative was selected. For -%% the moment this is only implented for 'text' alternatives. +%% the moment this is only implemented for 'text' alternatives. %% Ideally it should also take care of: %% - attribute groups @@ -81,7 +81,7 @@ %% with multiple XSDs). imported = [], %% a list of imported namespaces, to prevent %% getting into a loop when there are circular - %% refernces. + %% references. path = []}). %% path @@ -234,7 +234,7 @@ compile_parsed_xsd(ParsedXsd, Prefix, Namespaces, IncludeFun, IncludeDirs, Inclu end, ImportedNs = [Uri || {Uri, _} <- AlreadyImported], %% Here we are introducing #ns{} records with no value for efd. They - %% will be removed later on... (clean_up fucntion, see below). + %% will be removed later on... (clean_up function, see below). ImportedNsMapping = [#ns{prefix = P, uri = U} || {U, P} <- AlreadyImported], %ToBeImportedNsMapping = [#ns{prefix = P, uri = U} || {U, P, _} <- IncludeFiles], Acc = #p1acc{tns = TargetNs, @@ -273,7 +273,7 @@ clean_up(Namespaces) -> %% -record(schemaType, {targetNamespace, elementFormDefault, elements}). transform(#schemaType{elements=Elements, imports=Impts}, Acc = #p1acc{}) -> - %% transorm element and types etc. + %% transform element and types etc. %% in TransformedTypes the top-level types have to be recognisable somehow. Acc2 = processImports(Impts, Acc), transformTypes(Elements, Acc2). @@ -534,7 +534,7 @@ transformTypes([#globalComplexTypeType{name=Name, model=Model, attributes=Attrib %%-record(globalSimpleTypeType, {name, annotation, model}). %% TODO: better would be to avoid getting the 'any' stuff in the -%% translation of the XSD alltogether. +%% translation of the XSD altogether. %% transformTypes([#globalSimpleTypeType{name=Name, model=undefined}| Tail], transformTypes([#globalSimpleTypeType{name=Name}| Tail], Acc = #p1acc{tps = ResultSoFar, nsp = Prefix}) -> @@ -777,7 +777,7 @@ findAnyAlternative(Alternatives) -> {true, AnyAlternative} end. -%% for now only consider elements that are truely wildcards, because they seem +%% for now only consider elements that are truly wildcards, because they seem %% to be the most common type and they are the easiest to deal with. isAny(#alt{tag = '#any', anyInfo = #anyInfo{prCont = "lax", ns = "##any"}}) -> true; diff --git a/src/erlsom_compile.hrl b/src/erlsom_compile.hrl index 1792188..ab5d4e3 100644 --- a/src/erlsom_compile.hrl +++ b/src/erlsom_compile.hrl @@ -68,7 +68,7 @@ strict = false :: boolean(), %% enforce additional type checks/conversions include_any_attrs = false, %% if true, the second element in the result %% types will be used for - %% atributes that were not explicitly declared + %% attributes that were not explicitly declared value_fun %% Function that is called after the parsing %% of a complex type (resulting in creation of a %% record) has been created. Can be used diff --git a/src/erlsom_lib.erl b/src/erlsom_lib.erl index cccba8e..b21224f 100644 --- a/src/erlsom_lib.erl +++ b/src/erlsom_lib.erl @@ -327,7 +327,7 @@ translateType(String, true) -> {integer, negativeInteger}; "float" -> float; - % no disctinction between double and float - both are mapped to + % no distinction between double and float - both are mapped to % erlang float, no chcecks on size will be performed "double" -> float; @@ -468,7 +468,7 @@ makeTypeRefAtom(Qname, Namespaces) -> end. %% makeTypeRef creates a reference to a type. This can either be a type -%% defined in the XSD (or an imorted XSD), or a predefined type (like +%% defined in the XSD (or an imported XSD), or a predefined type (like %% xsd:string). %% For the predefined types special codes are returned ({'#PCDATA', ...}). %% input is a qname. @@ -480,7 +480,7 @@ makeTypeRefAtom(Qname, Namespaces) -> %% TODO: should return an atom (or {'PCDATA', ...})? makeTypeRef(undefined, _, _) -> - %% the 'ur-type': any type (and any attibute). + %% the 'ur-type': any type (and any attribute). {'#PCDATA', 'char'}; makeTypeRef(Qname = #qname{uri = NS, localPart = Local}, Namespaces, Strict) -> @@ -571,7 +571,7 @@ makeTag(NameInXsd, #schemaInfo{elementFormDefault="qualified", targetNamespace=T end; makeTag(NameInXsd, _SchemaInfo) -> - %% defaultElementForm = unqualified, do not add the prefix (TODO: exept for global elements and types). + %% defaultElementForm = unqualified, do not add the prefix (TODO: except for global elements and types). NameInXsd. listLength(undefined) -> 0; diff --git a/src/erlsom_parse.erl b/src/erlsom_parse.erl index decc688..e471253 100644 --- a/src/erlsom_parse.erl +++ b/src/erlsom_parse.erl @@ -26,7 +26,7 @@ %% translate XML (that follows a certain schema - grammar) to a %% predefined structure (a set of linked records). %% -%% The XSD is translated to a stucture (called the 'Model'in the code below) +%% The XSD is translated to a structure (called the 'Model'in the code below) %% that drives the parser, the parser self is generic. %% %% The main function is a callback that will be called by the SAX parser. @@ -93,7 +93,7 @@ %% Each Alternative is of the form {Tag, TypeReference, MinOccurs, MaxOccurs, %% RealElement}. %% - Tag is generally the tag of the element. In case of a 'choice', the -%% combination of the Tag and the next event determines which altenative is +%% combination of the Tag and the next event determines which alternative is %% selected. Tag can also be '#text', in which case we expect a 'character' %% event. %% - TypeReference is either a reference to a Type (a TypeName), or a tuple @@ -541,7 +541,7 @@ stateMachine(Event, State = #state{currentState = #altState{name=Name, type=Type %% check on MaxOccurs if %%{ Max /= unbound, Count >= Max -> - %% debug("But we have already recieved this event the maximum number of times"), + %% debug("But we have already received this event the maximum number of times"), %% pop. {NewCurrentState, Acc2} = pop(lists:reverse(Acc), Head, VFun, ValueAcc), NewState = State#state{currentState = NewCurrentState, @@ -560,7 +560,7 @@ stateMachine(Event, State = #state{currentState = #altState{name=Name, type=Type resultSoFar = [State#state.currentState | State#state.resultSoFar]}; _Else -> %% not text: a complex type. - %% look for the type discription + %% look for the type description %% debug("Not text: a complex type"), TypeDef = findType(Real, Type, Types, Attributes, TypeHierarchy, Namespaces, NamespaceMapping), %% #type{els = Elements, atts = ListOfAttributes, nr = NrOfElements} = TypeDef, @@ -787,7 +787,7 @@ stateMachine(Event, State = #state{currentState = #cs{re = RemainingElements, %% debug("This is a valid alternative"), if MaxOccurs /= unbound, ReceivedSoFar >= MaxOccurs -> - %% debug("But we have already recieved this event the maximum number of times"), + %% debug("But we have already received this event the maximum number of times"), %% move on NewState = State#state{currentState = #cs{re = NextElements, sf = 0, @@ -821,7 +821,7 @@ stateMachine(Event, State = #state{currentState = #cs{re = RemainingElements, end; _Else -> %% not text: a complex type. - %% look for the type discription + %% look for the type description %% debug("Not text: a complex type"), %% Look for xsi:type attribute TypeDef = findType(RealElement2, Type, Types, Attributes, TypeHierarchy, Namespaces, NamespaceMapping), @@ -990,13 +990,13 @@ stateMachine(Event, State = #state{currentState = #cs{re = RemainingElements, %% debug("odd case"), %% TODO: this seems to be a bit odd? What is this is a reference to a group? %% a helper element for this text - %% look for the type discription + %% look for the type description TypeDef = erlsom_lib:findType(Type, Types), %% create new record for this element %% (can't have any attributes) NewRecord = newRecord(TypeDef, StoreAnyAttr), %% push the current status, create a new level in the state machine - %% (we know that this is a helperElement, therfore RealElement = false) + %% (we know that this is a helperElement, therefore RealElement = false) NewState = State#state{currentState = #cs{re = TypeDef#type.els, sf = 0, er = NewRecord, @@ -1087,7 +1087,7 @@ stateMachine(Event, State = #state{currentState = #all{re = RemainingElements, end; _Else -> %% not text: a complex type. - %% look for the type discription + %% look for the type description %% Look for xsi:type attribute TypeDef = findType(RealElement, Type, Types, Attributes, TypeHierarchy, Namespaces, NamespaceMapping), #type{els = Elements, tp = Tp} = TypeDef, @@ -1127,7 +1127,7 @@ stateMachine(Event, State = #state{currentState = #all{re = RemainingElements, end; {characters, Characters} -> - %% should be be extended to deal with mixed alements, or wit simple elements with attributes? + %% should be be extended to deal with mixed alements, or with simple elements with attributes? %% not sure... throw({error, pp("Unexpected characters event in All: ~s", [Characters])}); @@ -1478,7 +1478,7 @@ printResultSoFar([_H | T], Acc) -> %% loop go through the list of elements, checking whether the %% tag occurs as an alternative in any one of them. %% return the alternative and remove this element from the list of elements. -%% if the elemnt is not found, return false +%% if the element is not found, return false findTagInElements(Tag, Elements) -> findTagInElements(Tag, Elements, []). findTagInElements(_Tag, [], _) -> false; diff --git a/src/erlsom_parse.hrl b/src/erlsom_parse.hrl index 38d1ce3..73c58d1 100644 --- a/src/erlsom_parse.hrl +++ b/src/erlsom_parse.hrl @@ -43,7 +43,7 @@ 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 + %% include an additional prefix to differentiate between elements, types %% and groups. -record(el, {alts, mn = 1, mx = 1, nillable, nr %% nr is actually the position of the value in the diff --git a/src/erlsom_parseXsd.erl b/src/erlsom_parseXsd.erl index 02221f7..12a5caf 100644 --- a/src/erlsom_parseXsd.erl +++ b/src/erlsom_parseXsd.erl @@ -269,7 +269,7 @@ xsdModel(Namespaces) -> nr = 3}, %% -record(simpleContentType, {annotation, model}). -%% simpleContent - extension can contain attibutes, so we have to parse +%% simpleContent - extension can contain attributes, so we have to parse %% one additional level. #type{nm = simpleContentType, anyAttr = AnyAttr, diff --git a/src/erlsom_pass2.erl b/src/erlsom_pass2.erl index ae360e3..c889979 100644 --- a/src/erlsom_pass2.erl +++ b/src/erlsom_pass2.erl @@ -73,7 +73,7 @@ secondPass(IntermediateStruct, Types2 = pass3(Types1, Info), Types3 = pass4(Types2, Info), DocType = make_Document(GlobalElements, [], Info), - %% fiddle a bit more - replace refernces in the _document that point + %% fiddle a bit more - replace references in the _document that point %% to unknown types by {#PCDATA, ...}, assuming that they point to %% simple types that are no longer visible. Even if that assumption %% would be wrong, it wouldn't have worked otherwise either, so it won't @@ -377,7 +377,7 @@ seqOrAll(all) -> all; seqOrAll(_) -> sequence. %% purpose of 'Count' is to make sure that we don't get into an infinite loop in case -%% of circular refernces in attributeGroups +%% of circular references in attributeGroups translateAttributes(_, _Acc, _Pos, _Info, 10) -> throw({error, "circular reference in attribute group?"}); translateAttributes(undefined, _Acc, _Pos, _Info, _Count) -> @@ -430,7 +430,7 @@ translateAlternatives([], Acc, _Types) -> %% -record(alternative, {tag, type, real, min, max}). %% Each Alternative is of the form {Tag, TypeReference, RealElement, min, max}. %% - Tag is generally the tag of the element. In case of a 'choice', the -%% combination of the Tag and the next event determines which altenative is +%% combination of the Tag and the next event determines which alternative is %% selected. Tag can also be '#text', in which case we expect a 'character' %% event. %% - TypeReference is either a reference to a Type (a TypeName), or a tuple diff --git a/src/erlsom_sax.hrl b/src/erlsom_sax.hrl index b3b20c1..bbcc1e1 100644 --- a/src/erlsom_sax.hrl +++ b/src/erlsom_sax.hrl @@ -36,7 +36,7 @@ current_entity = '__top', namespaces = [], endtags = [], - output, %% determines the encoding of text and atttribute values + output, %% determines the encoding of text and attribute values expand_entities = true, %% if false, user defined entities will %% be ignored in the DTD, and use of entities %% will fail. @@ -68,7 +68,7 @@ -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 +-define(is_namestart_char2(C), %% also for characters <> 7 bit ascii C > 96, C < 123; C > 64, C < 91; C =:= $_; C > 191, C =/= 215, C =/= 247). %% this check is far from complete! diff --git a/src/erlsom_sax_latin1.erl b/src/erlsom_sax_latin1.erl index 99b5c4a..57a815a 100644 --- a/src/erlsom_sax_latin1.erl +++ b/src/erlsom_sax_latin1.erl @@ -626,7 +626,7 @@ parseStartTag(Tail, State) -> parseTagName(?STR1_T(Char, Tail), State) when ?is_namestart_char(Char) -> %% this should differentiate between 'with namespaces'and 'without' - %% for the moment the assumption is 'with', therfore a name cannot + %% for the moment the assumption is 'with', therefore a name cannot %% start with a ':'. parseTagName([Char], Tail, State); parseTagName(?EMPTY, State) -> @@ -1025,8 +1025,8 @@ parseTextNoIgnoreBinary(Head, Tail, State) -> EncodedChar = erlsom_ucs:char_to_utf8(Char), parseTextNoIgnoreBinary(<>, Tail2, State2). -%% entity refernces in attribute values differ fundamentally from -%% refernces in elements and in entity definitions +%% entity references in attribute values differ fundamentally from +%% references in elements and in entity definitions %% Context can be: element, attribute, definition parseReference(Head, Context, ?STR1_T($;, Tail), State) -> translateReference(lists:reverse(Head), Context, Tail, State); @@ -1044,7 +1044,7 @@ parseReference(Head, Context, Tail, State) -> %% other entities are added to the tail (they still have to be parsed). %% The problem here is that we have to make sure that we don't get into an infinite %% loop. This solved as follows: -%% We proceed by parsing only the entity (while registring in the state that we +%% We proceed by parsing only the entity (while registering in the state that we %% are parsing this particular entity). However, we replace the continuation function %% by something that simply returns (in stead of calling the function that it was %% working on recursively). We then proceed. diff --git a/src/erlsom_sax_latin9.erl b/src/erlsom_sax_latin9.erl index d432518..fbc3ec2 100644 --- a/src/erlsom_sax_latin9.erl +++ b/src/erlsom_sax_latin9.erl @@ -626,7 +626,7 @@ parseStartTag(Tail, State) -> parseTagName(?STR1_T(Char, Tail), State) when ?is_namestart_char(Char) -> %% this should differentiate between 'with namespaces'and 'without' - %% for the moment the assumption is 'with', therfore a name cannot + %% for the moment the assumption is 'with', therefore a name cannot %% start with a ':'. parseTagName([Char], Tail, State); parseTagName(?EMPTY, State) -> @@ -1025,8 +1025,8 @@ parseTextNoIgnoreBinary(Head, Tail, State) -> EncodedChar = erlsom_ucs:char_to_utf8(Char), parseTextNoIgnoreBinary(<>, Tail2, State2). -%% entity refernces in attribute values differ fundamentally from -%% refernces in elements and in entity definitions +%% entity references in attribute values differ fundamentally from +%% references in elements and in entity definitions %% Context can be: element, attribute, definition parseReference(Head, Context, ?STR1_T($;, Tail), State) -> translateReference(lists:reverse(Head), Context, Tail, State); @@ -1044,7 +1044,7 @@ parseReference(Head, Context, Tail, State) -> %% other entities are added to the tail (they still have to be parsed). %% The problem here is that we have to make sure that we don't get into an infinite %% loop. This solved as follows: -%% We proceed by parsing only the entity (while registring in the state that we +%% We proceed by parsing only the entity (while registering in the state that we %% are parsing this particular entity). However, we replace the continuation function %% by something that simply returns (in stead of calling the function that it was %% working on recursively). We then proceed. diff --git a/src/erlsom_sax_list.erl b/src/erlsom_sax_list.erl index 5bbaec0..8459f23 100644 --- a/src/erlsom_sax_list.erl +++ b/src/erlsom_sax_list.erl @@ -626,7 +626,7 @@ parseStartTag(Tail, State) -> parseTagName(?STR1_T(Char, Tail), State) when ?is_namestart_char(Char) -> %% this should differentiate between 'with namespaces'and 'without' - %% for the moment the assumption is 'with', therfore a name cannot + %% for the moment the assumption is 'with', therefore a name cannot %% start with a ':'. parseTagName([Char], Tail, State); parseTagName(?EMPTY, State) -> @@ -1025,8 +1025,8 @@ parseTextNoIgnoreBinary(Head, Tail, State) -> EncodedChar = erlsom_ucs:char_to_utf8(Char), parseTextNoIgnoreBinary(<>, Tail2, State2). -%% entity refernces in attribute values differ fundamentally from -%% refernces in elements and in entity definitions +%% entity references in attribute values differ fundamentally from +%% references in elements and in entity definitions %% Context can be: element, attribute, definition parseReference(Head, Context, ?STR1_T($;, Tail), State) -> translateReference(lists:reverse(Head), Context, Tail, State); @@ -1044,7 +1044,7 @@ parseReference(Head, Context, Tail, State) -> %% other entities are added to the tail (they still have to be parsed). %% The problem here is that we have to make sure that we don't get into an infinite %% loop. This solved as follows: -%% We proceed by parsing only the entity (while registring in the state that we +%% We proceed by parsing only the entity (while registering in the state that we %% are parsing this particular entity). However, we replace the continuation function %% by something that simply returns (in stead of calling the function that it was %% working on recursively). We then proceed. diff --git a/src/erlsom_sax_utf16be.erl b/src/erlsom_sax_utf16be.erl index cd66e45..a87f7ea 100644 --- a/src/erlsom_sax_utf16be.erl +++ b/src/erlsom_sax_utf16be.erl @@ -626,7 +626,7 @@ parseStartTag(Tail, State) -> parseTagName(?STR1_T(Char, Tail), State) when ?is_namestart_char(Char) -> %% this should differentiate between 'with namespaces'and 'without' - %% for the moment the assumption is 'with', therfore a name cannot + %% for the moment the assumption is 'with', therefore a name cannot %% start with a ':'. parseTagName([Char], Tail, State); parseTagName(?EMPTY, State) -> @@ -1025,8 +1025,8 @@ parseTextNoIgnoreBinary(Head, Tail, State) -> EncodedChar = erlsom_ucs:char_to_utf8(Char), parseTextNoIgnoreBinary(<>, Tail2, State2). -%% entity refernces in attribute values differ fundamentally from -%% refernces in elements and in entity definitions +%% entity references in attribute values differ fundamentally from +%% references in elements and in entity definitions %% Context can be: element, attribute, definition parseReference(Head, Context, ?STR1_T($;, Tail), State) -> translateReference(lists:reverse(Head), Context, Tail, State); @@ -1044,7 +1044,7 @@ parseReference(Head, Context, Tail, State) -> %% other entities are added to the tail (they still have to be parsed). %% The problem here is that we have to make sure that we don't get into an infinite %% loop. This solved as follows: -%% We proceed by parsing only the entity (while registring in the state that we +%% We proceed by parsing only the entity (while registering in the state that we %% are parsing this particular entity). However, we replace the continuation function %% by something that simply returns (in stead of calling the function that it was %% working on recursively). We then proceed. diff --git a/src/erlsom_sax_utf16le.erl b/src/erlsom_sax_utf16le.erl index c5311af..7cc26c3 100644 --- a/src/erlsom_sax_utf16le.erl +++ b/src/erlsom_sax_utf16le.erl @@ -626,7 +626,7 @@ parseStartTag(Tail, State) -> parseTagName(?STR1_T(Char, Tail), State) when ?is_namestart_char(Char) -> %% this should differentiate between 'with namespaces'and 'without' - %% for the moment the assumption is 'with', therfore a name cannot + %% for the moment the assumption is 'with', therefore a name cannot %% start with a ':'. parseTagName([Char], Tail, State); parseTagName(?EMPTY, State) -> @@ -1025,8 +1025,8 @@ parseTextNoIgnoreBinary(Head, Tail, State) -> EncodedChar = erlsom_ucs:char_to_utf8(Char), parseTextNoIgnoreBinary(<>, Tail2, State2). -%% entity refernces in attribute values differ fundamentally from -%% refernces in elements and in entity definitions +%% entity references in attribute values differ fundamentally from +%% references in elements and in entity definitions %% Context can be: element, attribute, definition parseReference(Head, Context, ?STR1_T($;, Tail), State) -> translateReference(lists:reverse(Head), Context, Tail, State); @@ -1044,7 +1044,7 @@ parseReference(Head, Context, Tail, State) -> %% other entities are added to the tail (they still have to be parsed). %% The problem here is that we have to make sure that we don't get into an infinite %% loop. This solved as follows: -%% We proceed by parsing only the entity (while registring in the state that we +%% We proceed by parsing only the entity (while registering in the state that we %% are parsing this particular entity). However, we replace the continuation function %% by something that simply returns (in stead of calling the function that it was %% working on recursively). We then proceed. diff --git a/src/erlsom_sax_utf8.erl b/src/erlsom_sax_utf8.erl index 0a8aa65..d1b954b 100644 --- a/src/erlsom_sax_utf8.erl +++ b/src/erlsom_sax_utf8.erl @@ -626,7 +626,7 @@ parseStartTag(Tail, State) -> parseTagName(?STR1_T(Char, Tail), State) when ?is_namestart_char(Char) -> %% this should differentiate between 'with namespaces'and 'without' - %% for the moment the assumption is 'with', therfore a name cannot + %% for the moment the assumption is 'with', therefore a name cannot %% start with a ':'. parseTagName([Char], Tail, State); parseTagName(?EMPTY, State) -> @@ -1025,8 +1025,8 @@ parseTextNoIgnoreBinary(Head, Tail, State) -> EncodedChar = erlsom_ucs:char_to_utf8(Char), parseTextNoIgnoreBinary(<>, Tail2, State2). -%% entity refernces in attribute values differ fundamentally from -%% refernces in elements and in entity definitions +%% entity references in attribute values differ fundamentally from +%% references in elements and in entity definitions %% Context can be: element, attribute, definition parseReference(Head, Context, ?STR1_T($;, Tail), State) -> translateReference(lists:reverse(Head), Context, Tail, State); @@ -1044,7 +1044,7 @@ parseReference(Head, Context, Tail, State) -> %% other entities are added to the tail (they still have to be parsed). %% The problem here is that we have to make sure that we don't get into an infinite %% loop. This solved as follows: -%% We proceed by parsing only the entity (while registring in the state that we +%% We proceed by parsing only the entity (while registering in the state that we %% are parsing this particular entity). However, we replace the continuation function %% by something that simply returns (in stead of calling the function that it was %% working on recursively). We then proceed. diff --git a/src/erlsom_type2xsd.erl b/src/erlsom_type2xsd.erl index fa7d184..a088bdd 100644 --- a/src/erlsom_type2xsd.erl +++ b/src/erlsom_type2xsd.erl @@ -280,7 +280,7 @@ make_xsd(Schema) -> {ok, R} = erlsom:write(Schema, Model), erlsom_lib:prettyPrint(R). -%% if no elements are declared explitly, all will be part of the XSD. +%% if no elements are declared explicitly, all will be part of the XSD. exportElement(_Element, []) -> true; exportElement(Element, List) -> diff --git a/src/erlsom_ucs.erl b/src/erlsom_ucs.erl index e37b36d..f0cf736 100644 --- a/src/erlsom_ucs.erl +++ b/src/erlsom_ucs.erl @@ -64,7 +64,7 @@ from_utf8(List) -> %% expand_utf8([Byte]) -> {[UnicodeChar], Tail, NumberOfBadBytes} %% Expand UTF8 byte sequences to ISO 10646/Unicode -%% charactes. Any illegal bytes are removed and the number of +%% characters. Any illegal bytes are removed and the number of %% bad bytes are returned. %% %% Modification (WdJ): Added an output parameter (Tail): @@ -136,7 +136,7 @@ expand_utf8_1([], Acc, Bad) -> {lists:reverse(Acc), [], Bad}. %% from_utf16be(List) -> {[UnicodeChar], Tail, NumberOfBadBytes} %% Expand UTF16 byte sequences to ISO 10646/Unicode -%% charactes. Any illegal bytes are removed and the number of +%% characters. Any illegal bytes are removed and the number of %% bad bytes are returned. %% %% Modification (WdJ): Added an output parameter (Tail): diff --git a/src/erlsom_write.erl b/src/erlsom_write.erl index 8158e83..17cdbbb 100644 --- a/src/erlsom_write.erl +++ b/src/erlsom_write.erl @@ -23,7 +23,7 @@ %%% ==================================================================== %%% This is the companion of erlsom_parse, which performs the inverse operation. -%%% Both modules use the same 'model' that descibes the translation, see the +%%% Both modules use the same 'model' that describes the translation, see the %%% introduction to erlsom_parse for the definition of this model. -module(erlsom_write). @@ -315,7 +315,7 @@ processAlternativeValue(Value, Count, TagAsText = atom_to_list(Tag), if RealElement -> - %% proces the attributes + %% process the attributes {AttributesString, NewDeclaredNamespaces} = processAttributes(Value, [], Attributes, Namespaces, DeclaredNamespaces), %% process anyAttributes %% for now we don't check whether 'anyAttributes' are allowed! @@ -718,7 +718,7 @@ printNilValue([#alt{tag=Tag, tp = RecordType}], Value, #model{tps = Types, any_a TypeRecord = findType(RecordType, Types), Attributes = TypeRecord#type.atts, - %% proces the attributes + %% process the attributes {AttributesString, NewDeclaredNamespaces} = processAttributes(Value, [], Attributes, Namespaces, DeclaredNamespaces), %% process anyAttributes %% for now we don't check whether 'anyAttributes' are allowed! diff --git a/src/erlsom_writeHrl.erl b/src/erlsom_writeHrl.erl index 28bc9e9..21c4140 100644 --- a/src/erlsom_writeHrl.erl +++ b/src/erlsom_writeHrl.erl @@ -22,7 +22,7 @@ %%% Writes record definitions, to be used with Erlsom. %%% ==================================================================== -%%% Writes record defintions, taking a 'model' (from erlsom_compile) as +%%% Writes record definitions, taking a 'model' (from erlsom_compile) as %%% input. -module(erlsom_writeHrl).