From 7a9b12187c4265eba16aa75ee45301f7f2c586e8 Mon Sep 17 00:00:00 2001 From: Lars Thorsen Date: Wed, 7 Sep 2016 15:29:56 +0200 Subject: [xmerl] Fix link problems in documentation --- lib/xmerl/src/xmerl_eventp.erl | 84 ++++++++++++++++++++++++++++++++++++++++++ lib/xmerl/src/xmerl_scan.erl | 5 ++- lib/xmerl/src/xmerl_xpath.erl | 30 +++++++++++---- lib/xmerl/src/xmerl_xs.erl | 7 +--- lib/xmerl/src/xmerl_xsd.erl | 13 ++++--- 5 files changed, 119 insertions(+), 20 deletions(-) (limited to 'lib/xmerl/src') diff --git a/lib/xmerl/src/xmerl_eventp.erl b/lib/xmerl/src/xmerl_eventp.erl index 2cb76abc6e..8d7ea25e24 100644 --- a/lib/xmerl/src/xmerl_eventp.erl +++ b/lib/xmerl/src/xmerl_eventp.erl @@ -25,6 +25,90 @@ %% Each contain more elaborate settings of xmerl_scan that makes usage of %% the customization functions. %% +%% @type xmlElement() = #xmlElement{}. +%% +%% @type option_list().

Options allow to customize the behaviour of the +%% scanner. +%% See also tutorial on customization +%% functions. +%%

+%%

+%% Possible options are: +%%

+%%
+%%
{acc_fun, Fun}
+%%
Call back function to accumulate contents of entity.
+%%
{continuation_fun, Fun} | +%% {continuation_fun, Fun, ContinuationState}
+%%
Call back function to decide what to do if the scanner runs into EOF +%% before the document is complete.
+%%
{event_fun, Fun} | +%% {event_fun, Fun, EventState}
+%%
Call back function to handle scanner events.
+%%
{fetch_fun, Fun} | +%% {fetch_fun, Fun, FetchState}
+%%
Call back function to fetch an external resource.
+%%
{hook_fun, Fun} | +%% {hook_fun, Fun, HookState}
+%%
Call back function to process the document entities once +%% identified.
+%%
{close_fun, Fun}
+%%
Called when document has been completely parsed.
+%%
{rules, ReadFun, WriteFun, RulesState} | +%% {rules, Rules}
+%%
Handles storing of scanner information when parsing.
+%%
{user_state, UserState}
+%%
Global state variable accessible from all customization functions
+%% +%%
{fetch_path, PathList}
+%%
PathList is a list of +%% directories to search when fetching files. If the file in question +%% is not in the fetch_path, the URI will be used as a file +%% name.
+%%
{space, Flag}
+%%
'preserve' (default) to preserve spaces, 'normalize' to +%% accumulate consecutive whitespace and replace it with one space.
+%%
{line, Line}
+%%
To specify starting line for scanning in document which contains +%% fragments of XML.
+%%
{namespace_conformant, Flag}
+%%
Controls whether to behave as a namespace conformant XML parser, +%% 'false' (default) to not otherwise 'true'.
+%%
{validation, Flag}
+%%
Controls whether to process as a validating XML parser: +%% 'off' (default) no validation, or validation 'dtd' by DTD or 'schema' +%% by XML Schema. 'false' and 'true' options are obsolete +%% (i.e. they may be removed in a future release), if used 'false' +%% equals 'off' and 'true' equals 'dtd'.
+%%
{schemaLocation, [{Namespace,Link}|...]}
+%%
Tells explicitly which XML Schema documents to use to validate +%% the XML document. Used together with the +%% {validation,schema} option.
+%%
{quiet, Flag}
+%%
Set to 'true' if xmerl should behave quietly and not output any +%% information to standard output (default 'false').
+%%
{doctype_DTD, DTD}
+%%
Allows to specify DTD name when it isn't available in the XML +%% document. This option has effect only together with +%% {validation,'dtd' option.
+%%
{xmlbase, Dir}
+%%
XML Base directory. If using string/1 default is current directory. +%% If using file/1 default is directory of given file.
+%%
{encoding, Enc}
+%%
Set default character set used (default UTF-8). +%% This character set is used only if not explicitly given by the XML +%% declaration.
+%%
{document, Flag}
+%%
Set to 'true' if xmerl should return a complete XML document +%% as an xmlDocument record (default 'false').
+%%
{comments, Flag}
+%%
Set to 'false' if xmerl should skip comments otherwise they will +%% be returned as xmlComment records (default 'true').
+%%
{default_attrs, Flag}
+%%
Set to 'true' if xmerl should add to elements missing attributes +%% with a defined default value (default 'false').
+%%
+%% -module(xmerl_eventp). -vsn('0.19'). -date('03-09-17'). diff --git a/lib/xmerl/src/xmerl_scan.erl b/lib/xmerl/src/xmerl_scan.erl index 2147a46a13..5e0459ec21 100644 --- a/lib/xmerl/src/xmerl_scan.erl +++ b/lib/xmerl/src/xmerl_scan.erl @@ -111,13 +111,16 @@ %%
Set to 'true' if xmerl should add to elements missing attributes %% with a defined default value (default 'false').
%% +%% @type xmlElement() = #xmlElement{}. +%% The record definition is found in xmerl.hrl. +%% @type xmlDocument() = #xmlDocument{}. +%% The record definition is found in xmerl.hrl. %% @type document() = xmlElement() | xmlDocument().

%% The document returned by xmerl_scan:string/[1,2] and %% xmerl_scan:file/[1,2]. The type of the returned record depends on %% the value of the document option passed to the function. %%

- -module(xmerl_scan). -vsn('0.20'). -date('03-09-16'). diff --git a/lib/xmerl/src/xmerl_xpath.erl b/lib/xmerl/src/xmerl_xpath.erl index bbebda1030..6146feba49 100644 --- a/lib/xmerl/src/xmerl_xpath.erl +++ b/lib/xmerl/src/xmerl_xpath.erl @@ -43,13 +43,27 @@ %% %% %% @type nodeEntity() = -%% xmlElement() -%% | xmlAttribute() -%% | xmlText() -%% | xmlPI() -%% | xmlComment() -%% | xmlNsNode() -%% | xmlDocument() +%% #xmlElement{} +%% | #xmlAttribute{} +%% | #xmlText{} +%% | #xmlPI{} +%% | #xmlComment{} +%% | #xmlNsNode{} +%% | #xmlDocument{} +%% +%% @type docNodes() = #xmlElement{} +%% | #xmlAttribute{} +%% | #xmlText{} +%% | #xmlPI{} +%% | #xmlComment{} +%% | #xmlNsNode{} +%% +%% @type docEntity() = #xmlDocument{} | [docNodes()] +%% +%% @type xPathString() = string() +%% +%% @type parentList() = [{atom(), integer()}] +%% %% @type option_list().

Options allows to customize the behaviour of the %% XPath scanner. %%

@@ -115,7 +129,7 @@ string(Str, Doc, Options) -> %% Parents = parentList() %% Doc = nodeEntity() %% Options = option_list() -%% Scalar = xmlObj +%% Scalar = #xmlObj{} %% @doc Extracts the nodes from the parsed XML tree according to XPath. %% xmlObj is a record with fields type and value, %% where type is boolean | number | string diff --git a/lib/xmerl/src/xmerl_xs.erl b/lib/xmerl/src/xmerl_xs.erl index 3e9f6622b8..1ce76cfa41 100644 --- a/lib/xmerl/src/xmerl_xs.erl +++ b/lib/xmerl/src/xmerl_xs.erl @@ -45,7 +45,6 @@ % XSLT package which is written i C++. % See also the Tutorial. %

- -module(xmerl_xs). -export([xslapply/2, value_of/1, select/2, built_in_rules/2 ]). @@ -71,15 +70,13 @@ %% xslapply(fun template/1, E), %% "</h1>"]; %% - xslapply(Fun, EList) when is_list(EList) -> - lists:map( Fun, EList); + lists:map(Fun, EList); xslapply(Fun, E = #xmlElement{})-> lists:map( Fun, E#xmlElement.content). - %% @spec value_of(E) -> List -%% E = unknown() +%% E = term() %% %% @doc Concatenates all text nodes within the tree. %% diff --git a/lib/xmerl/src/xmerl_xsd.erl b/lib/xmerl/src/xmerl_xsd.erl index 4b5efae8dd..a89b3159ec 100644 --- a/lib/xmerl/src/xmerl_xsd.erl +++ b/lib/xmerl/src/xmerl_xsd.erl @@ -49,6 +49,7 @@ %%
It is possible by this option to provide a state with process %% information from an earlier validation.
%% +%% @type filename() = string() %% @end %%%------------------------------------------------------------------- -module(xmerl_xsd). @@ -138,7 +139,7 @@ state2file(S=#xsd_state{schema_name=SN}) -> %% @spec state2file(State,FileName) -> ok | {error,Reason} %% State = global_state() -%% FileName = filename() +%% FileName = string() %% @doc Saves the schema state with all information of the processed %% schema in a file. You can provide the file name for the saved %% state. FileName is saved with the .xss extension @@ -153,7 +154,7 @@ state2file(S,FileName) when is_record(S,xsd_state) -> %% @spec file2state(FileName) -> {ok,State} | {error,Reason} %% State = global_state() -%% FileName = filename() +%% FileName = string() %% @doc Reads the schema state with all information of the processed %% schema from a file created with state2file/[1,2]. The %% format of this file is internal. The state can then be used @@ -202,7 +203,7 @@ xmerl_xsd_vsn_check(S=#xsd_state{vsn=MD5_VSN}) -> process_validate(Schema,Xml) -> process_validate(Schema,Xml,[]). %% @spec process_validate(Schema,Element,Options) -> Result -%% Schema = filename() +%% Schema = string() %% Element = XmlElement %% Options = option_list() %% Result = {ValidXmlElement,State} | {error,Reason} @@ -282,7 +283,7 @@ validate3(_,_,S) -> process_schema(Schema) -> process_schema(Schema,[]). %% @spec process_schema(Schema,Options) -> Result -%% Schema = filename() +%% Schema = string() %% Result = {ok,State} | {error,Reason} %% State = global_state() %% Reason = [ErrorReason] | ErrorReason @@ -324,7 +325,7 @@ process_schema2({SE,_},State,_Schema) -> process_schemas(Schemas) -> process_schemas(Schemas,[]). %% @spec process_schemas(Schemas,Options) -> Result -%% Schemas = [{NameSpace,filename()}|Schemas] | [] +%% Schemas = [{NameSpace,string()}|Schemas] | [] %% Result = {ok,State} | {error,Reason} %% Reason = [ErrorReason] | ErrorReason %% Options = option_list() @@ -5426,7 +5427,7 @@ add_key_once(Key,N,El,L) -> %% {filename:join([[io_lib:format("/~w(~w)",[X,Y])||{X,Y}<-Parents],Type]),Pos}. %% @spec format_error(Errors) -> Result -%% Errors = error_tuple() | [error_tuple()] +%% Errors = tuple() | [tuple()] %% Result = string() | [string()] %% @doc Formats error descriptions to human readable strings. format_error(L) when is_list(L) -> -- cgit v1.2.3