Using large xml file as Linq data source
Data
01 Syntax
02 Methods
| Name | Overloads | Summary |
|---|---|---|
| LoadXmlDocument | 1 | Load a specific xml file from a file location pathOrDoc/ or a xml text document data into a XmlDocument object. |
| GetTypeName | 1 | Using default string name or MemberInfo.Name |
| GetNodeNameDefine | 1 | 分别解析XmlTypeAttribute,XmlRootAttribute,如果这两个定义都不存在的话就返回MemberInfo.Name |
| InternalIterates | 1 | 使用XmlDocument进行小文件的加载操作 |
| LoadXmlDataSet | 1 | Only works for the xml file that contains a list or array of xml element, and then this function using this list element as linq data source. |
| NodeInstanceBuilder | 1 | 从给定的文本之中利用反序列化从XML字符串构建出.NET对象 |
| LoadUltraLargeXMLDataSet | 2 | Apply on a ultra large size XML database, which its data size is greater than 1GB to 100GB or even more. |
| LoadArrayNodes | 1 | Parse xml element array from a given xml document text |
| IteratesArrayNodes | 1 | 可以使用函数Data.GetXmlNodeDoc())来进行类型的转换操作 |
| GetXmlNodeDoc | 1 | |
| LoadXmlDataSet | 1 | |
| NodeStream | 1 | |
| CreateNodeObject | 1 | |
| LoadUltraLargeXMLDataSet | 1 | |
| LoadArrayNodes | 1 | |
| ArrayNodesFromDocument | 1 | |
| PopulateXmlElementText | 1 |
03 Members
String, Func(Of String, String))Load a specific xml file from a file location pathOrDoc/ or a xml text document data into a XmlDocument object.
using internally XDocument.Load() to parse whole XML at once
| Name | Type | Description |
|---|---|---|
pathOrDoc | String | - |
Type, String)Using default string name or MemberInfo.Name
| Name | Type | Description |
|---|---|---|
type | Type | - |
default$ | String | If this parameter value is StringHelpers.StringEmpty(), then |
Type)分别解析XmlTypeAttribute,XmlRootAttribute,如果这两个定义都不存在的话就返回MemberInfo.Name
| Name | Type | Description |
|---|---|---|
type | Type | - |
String, String, Func(Of String, Boolean))使用XmlDocument进行小文件的加载操作
| Name | Type | Description |
|---|---|---|
XML$ | String | - |
nodeName$ | String | - |
filter | Func(Of String, Boolean) | - |
String, String, String, Boolean, Func(Of String, Boolean), Boolean)Only works for the xml file that contains a list or array of xml element, and then this function using this list element as linq data source.
(这个函数只建议在读取比较小的XML文件的时候使用,并且这个XML文件仅仅是一个数组或者列表的序列化结果)
| Name | Description |
|---|---|
T |
| Name | Type | Description |
|---|---|---|
XML$ | String | 超大的XML文件的文件路径 |
typeName | String | 列表之中的节点在XML之中的tag标记名称,假若这个参数值为空的话,则会默认使用目标类型名称 |
xmlns | String | Using for the namespace replacement. (当这个参数存在的时候,目标命名空间申明将会被替换为空字符串,数据对象才会被正确的加载) |
elementFilter | Boolean | 如果这个函数指针返回true, 则表示当前的数据元素节点需要被抛弃 |
IEnumerable(Of String), String, String, Boolean, Type())从给定的文本之中利用反序列化从XML字符串构建出.NET对象
| Name | Description |
|---|---|
T |
| Name | Type | Description |
|---|---|---|
nodes | IEnumerable(Of String) | - |
replaceXmlns$ | String | - |
xmlNode$ | String | 文件之中的节点名称 |
String, String, String, Func(Of XElement, Boolean), Func(Of String, String), Boolean, Type(), Boolean)Apply on a ultra large size XML database, which its data size is greater than 1GB to 100GB or even more.
(这个函数是直接忽略掉根节点的名称以及属性的,使用这个函数只需要关注于需要提取的数据的节点名称即可)
| Name | Description |
|---|---|
T |
| Name | Type | Description |
|---|---|---|
path | String | 文件路径 |
typeName | String | 目标节点名称,默认是使用类型T的名称 |
xmlns | String |
|
selector | Func(Of XElement, Boolean) | 在加载数据集的时候,过滤掉一些不使用的数据,可以节省很多内存以及减少数据的加载时间. 因为后续的Xml反序列化操作在大数据集合下话费的时间会非常长 |
Stream, String, String, Func(Of XElement, Boolean), Func(Of String, String), Boolean, Type(), Boolean)Apply on a ultra large size XML database, which its data size is greater than 1GB to 100GB or even more.
(这个函数是直接忽略掉根节点的名称以及属性的,使用这个函数只需要关注于需要提取的数据的节点名称即可)
| Name | Description |
|---|---|
T |
| Name | Type | Description |
|---|---|---|
s | Stream | The document stream data |
typeName | String | 目标节点名称,默认是使用类型T的名称 |
xmlns | String |
|
selector | Func(Of XElement, Boolean) | 在加载数据集的时候,过滤掉一些不使用的数据,可以节省很多内存以及减少数据的加载时间. 因为后续的Xml反序列化操作在大数据集合下话费的时间会非常长 |
preprocess | Func(Of String, String) | pre-processing the each xml document text block before parsed as the target clr object |
String, String, String, Func(Of XElement, Boolean), Boolean, Boolean)Parse xml element array from a given xml document text
| Name | Description |
|---|---|
T |
| Name | Type | Description |
|---|---|---|
documentText | String | the xml document text |
typeName$ | String | - |
xmlns$ | String | - |
selector | Func(Of XElement, Boolean) | - |
ignoreError | Boolean | - |
tqdm | Boolean | - |
String, String, Func(Of XElement, Boolean), Boolean)可以使用函数Data.GetXmlNodeDoc()来进行类型的转换操作
| Name | Type | Description |
|---|---|---|
path$ | String | - |
typeName$ | String | - |
XElement)String, String, String, Boolean, Func(Of String, Boolean), Boolean)IEnumerable(Of String), String, String, Boolean)String, String, String)String, String, String, Func(Of XElement, Boolean), Func(Of String, String), Boolean, Type(), Boolean)String, String, String, Func(Of XElement, Boolean), Boolean, Boolean)String, String, Func(Of XElement, Boolean), Boolean)String, String, Func(Of XElement, Boolean), Boolean)