diff --git a/XmlStructLoader.jl/dev/.documenter-siteinfo.json b/XmlStructLoader.jl/dev/.documenter-siteinfo.json index 44886f8..8eb97a7 100644 --- a/XmlStructLoader.jl/dev/.documenter-siteinfo.json +++ b/XmlStructLoader.jl/dev/.documenter-siteinfo.json @@ -1 +1 @@ -{"documenter":{"julia_version":"1.10.4","generation_timestamp":"2024-07-19T19:52:48","documenter_version":"1.5.0"}} \ No newline at end of file +{"documenter":{"julia_version":"1.10.4","generation_timestamp":"2024-07-19T20:00:10","documenter_version":"1.5.0"}} \ No newline at end of file diff --git a/XmlStructLoader.jl/dev/docstrings/index.html b/XmlStructLoader.jl/dev/docstrings/index.html index 030e90c..b404c83 100644 --- a/XmlStructLoader.jl/dev/docstrings/index.html +++ b/XmlStructLoader.jl/dev/docstrings/index.html @@ -1,7 +1,7 @@ -Docstrings · XmlStructLoader.jl
XmlStructLoader.get_base_field_typeMethod
get_field_type(::Type{T}, field_specification::Union{Symbol, Int}) where T <: Any

For a given type T return the type of the field determined by either the index or symbol field_specification. If the type is a Union return the first type different from Nothing. This is intended to handle types of the pattern Union{Nothing, S} which is intended to represent optional types.

source
XmlStructLoader.import_module_from_xmlMethod
import_module_from_xml(xml_path::AbstractString, module_path::AbstractString)::Module

Import the module from the .jl files in the module_path and return a reference to this module. This reference can be passed into the load function.

Examples

julia> using XmlStructLoader
-julia> module_ref = import_module_from_xml(path/to/xml/file.xml, path/to/module/module.jl)
source
XmlStructLoader.loadMethod
load(xml_path::AbstractString, module_path::AbstractString; validate::Bool=true)

Load the given XML file into the structs defined in the given module and return the loaded struct. The module has to be generated by XsdToStruct.jl. By default the loader will validate if the data in the given XML conforms to the restrictions specified in the XSD. To skip this validation the keyword argument validate can be set to false.

Examples

julia> using XmlStructLoader
-julia> load(joinpath("path", "to", "xml", "file.xml"), joinpath("path", "to", "xsd", "module.jl"))
source
XmlStructLoader.loadMethod
load(xml_path::AbstractString, module_ref::Module; validate::Bool=true)

Load the given XML file into the structs defined in the given module and return the loaded struct. The module has to be generated by XsdToStruct.jl. By default the loader will validate if the data in the given XML conforms to the restrictions specified in the XSD. To skip this validation the keyword argument validate` can be set to false.

Examples

julia> using XmlStructLoader
+Docstrings · XmlStructLoader.jl
XmlStructLoader.get_base_field_typeMethod
get_field_type(::Type{T}, field_specification::Union{Symbol, Int}) where T <: Any

For a given type T return the type of the field determined by either the index or symbol field_specification. If the type is a Union return the first type different from Nothing. This is intended to handle types of the pattern Union{Nothing, S} which is intended to represent optional types.

source
XmlStructLoader.import_module_from_xmlMethod
import_module_from_xml(xml_path::AbstractString, module_path::AbstractString)::Module

Import the module from the .jl files in the module_path and return a reference to this module. This reference can be passed into the load function.

Examples

julia> using XmlStructLoader
+julia> module_ref = import_module_from_xml(path/to/xml/file.xml, path/to/module/module.jl)
source
XmlStructLoader.loadMethod
load(xml_path::AbstractString, module_path::AbstractString; validate::Bool=true)

Load the given XML file into the structs defined in the given module and return the loaded struct. The module has to be generated by XsdToStruct.jl. By default the loader will validate if the data in the given XML conforms to the restrictions specified in the XSD. To skip this validation the keyword argument validate can be set to false.

Examples

julia> using XmlStructLoader
+julia> load(joinpath("path", "to", "xml", "file.xml"), joinpath("path", "to", "xsd", "module.jl"))
source
XmlStructLoader.loadMethod
load(xml_path::AbstractString, module_ref::Module; validate::Bool=true)

Load the given XML file into the structs defined in the given module and return the loaded struct. The module has to be generated by XsdToStruct.jl. By default the loader will validate if the data in the given XML conforms to the restrictions specified in the XSD. To skip this validation the keyword argument validate` can be set to false.

Examples

julia> using XmlStructLoader
 julia> include(joinpath("path", "to", "xsd", "module.jl"))
 julia> using .XsdModule
 julia> load(joinpath("path", "to", "xml", "file.xml"), XsdModule)

or:

julia> using XmlStructLoader
@@ -10,5 +10,5 @@
 julia> load(joinpath("path", "to", "xml", "file.xml"), XsdModule)

or to skip validation:

julia> using XmlStructLoader
 julia> include(joinpath("path", "to", "xsd", "module.jl"))
 julia> using .XsdModule
-julia> load(joinpath("path", "to", "xml", "file.xml"), XsdModule, validate=false)
source
XmlStructLoader.type_in_moduleMethod
(type_in_module(::Type{T}, module_ref::Module)::Bool) where T <: Any

Determine if given type T is defined in the module specified by module_symbol.

source
XmlStructLoader.use_module_from_xmlMethod
use_module_from_xml(xml_path::AbstractString, module_path::AbstractString)::Module

Use the module from the .jl files in the module_path and return a reference to this module. This reference can be passed into the load function.

Examples

julia> using XmlStructLoader
-julia> module_ref = use_module_from_xml(path/to/xml/file.xml, path/to/module/module.jl)
source
+julia> load(joinpath("path", "to", "xml", "file.xml"), XsdModule, validate=false)
source
XmlStructLoader.type_in_moduleMethod
(type_in_module(::Type{T}, module_ref::Module)::Bool) where T <: Any

Determine if given type T is defined in the module specified by module_symbol.

source
XmlStructLoader.use_module_from_xmlMethod
use_module_from_xml(xml_path::AbstractString, module_path::AbstractString)::Module

Use the module from the .jl files in the module_path and return a reference to this module. This reference can be passed into the load function.

Examples

julia> using XmlStructLoader
+julia> module_ref = use_module_from_xml(path/to/xml/file.xml, path/to/module/module.jl)
source
diff --git a/XmlStructLoader.jl/dev/index.html b/XmlStructLoader.jl/dev/index.html index 4293e1f..0c494a4 100644 --- a/XmlStructLoader.jl/dev/index.html +++ b/XmlStructLoader.jl/dev/index.html @@ -19,4 +19,4 @@ xsd_module_dir = joinpath("XsdModules", "ExampleXml") # can also be the module path xml_path = joinpath("path", "to", "ExampleXml.xml") -example_xml = load(xml_path, xsd_module_dir)

Validating the *.xml file

By default the load function will validate the input xml with respect to the restrictions specified in the xsd from which the xsd module was generated. To disable this validation pass the keyword argument validate=false to the load function.

+example_xml = load(xml_path, xsd_module_dir)

Validating the *.xml file

By default the load function will validate the input xml with respect to the restrictions specified in the xsd from which the xsd module was generated. To disable this validation pass the keyword argument validate=false to the load function.