Xmlsq 1.0.0

Classes | Methods | Enumerations | Index
Xmlsq Namespace

The .NET interface to Xmlsq.

Classes

Methods

Gen Class Methods

Query Class Methods


Gen.CompileTime Method

Get date and time the core diXmlsq DLL module was last compiled.

Syntax

[C#]
public static string CompileTime()
[VB.NET]
Public Shared Function CompileTime As String

Return Value

Date and time value.

Gen.ModuleName Method

Get full path name of the current process's core library DLL.

Syntax

[C#]
public static string ModuleName()
[VB.NET]
Public Shared Function ModuleName As String

Return Value

Path name.

Remarks

Note C:\WINDOWS\SYSTEM32\ may be returned even if it is really C:\WINDOWS\SYSWOW64\.

Gen.NetVersion Method

Return the version of this .NET module.

Syntax

[C#]
public static string NetVersion()
[VB.NET]
Public Shared Function NetVersion As String

Return Value

Version string, e.g. "01.02.03"

Gen.Platform Method

Get platform on which the core diXmlsq DLL is running.

Syntax

[C#]
public static string Platform()
[VB.NET]
Public Shared Function Platform As String

Return Value

"Win32" or "Win64"

Gen.Version Method

Get version number of core diXmlsq DLL.

Syntax

[C#]
public static int Version()
[VB.NET]
Public Shared Function Version As Integer

Return Value

Version number in form Major * 10000 + Minor * 100 + Release

Remarks

E.g. version 1.2.3 returns 10203

Query.Count Method

Compute the count for the XPath query.

Syntax

[C#]
public static int Count(
	string xmlFile,
	string query
)
[VB.NET]
Public Shared Function Count ( _
	xmlFile As String, _
	query As String _
) As Integer

Parameters

xmlFile
Name of XML file or string containing XML data.
query
XPath 1.0 expression. This must evaluate to a node or node set.

Return Value

The integer value of count(query).

Exceptions

ExceptionCondition
Xmlsq.XmlsqErrorExceptionBad input: missing file or invalid XML or invalid XPath.

Query.FullQuery Method (String, String)

Perform a full XPath query on the XML input.

Syntax

[C#]
public static string FullQuery(
	string xmlFile,
	string query
)
[VB.NET]
Public Shared Function FullQuery ( _
	xmlFile As String, _
	query As String _
) As String

Parameters

xmlFile
Name of XML file or string containing XML data.
query
XPath 1.0 expression.

Return Value

String containing result of query.

Exceptions

ExceptionCondition
Xmlsq.XmlsqErrorExceptionBad input: missing file or invalid XML or invalid XPath.

Query.FullQuery Method (String, String, Query.Opts)

Perform a full XPath query on the XML input with options.

Syntax

[C#]
public static string FullQuery(
	string xmlFile,
	string query,
	Query.Opts opts
)
[VB.NET]
Public Shared Function FullQuery ( _
	xmlFile As String, _
	query As String, _
	opts As Query.Opts _
) As String

Parameters

xmlFile
Name of XML file or string containing XML data.
query
XPath 1.0 expression.
opts
Type: Query.Opts
Formatting options for output.

Return Value

String containing result of query.

Exceptions

ExceptionCondition
Xmlsq.XmlsqErrorExceptionBad input: missing file or invalid XML or invalid XPath.

Query.GetText Method (String, String)

Extract text from the first matching XML file node.

Syntax

[C#]
public static string GetText(
	string xmlFile,
	string query
)
[VB.NET]
Public Shared Function GetText ( _
	xmlFile As String, _
	query As String _
) As String

Parameters

xmlFile
Name of XML file or string containing XML data.
query
XPath 1.0 expression to select a node. This must evaluate to a node or node set.

Return Value

Extracted text

Exceptions

ExceptionCondition
Xmlsq.XmlsqErrorExceptionBad input: missing file or invalid XML or invalid XPath.

Query.GetText Method (String, String, Query.Opts)

Extract text from the first matching XML file node with options.

Syntax

[C#]
public static string GetText(
	string xmlFile,
	string query,
	Query.Opts opts
)
[VB.NET]
Public Shared Function GetText ( _
	xmlFile As String, _
	query As String, _
	opts As Query.Opts _
) As String

Parameters

xmlFile
Name of XML file or string containing XML data.
query
XPath 1.0 expression to select a node. This must evaluate to a node or node set.
opts
Type: Query.Opts
Formatting options for output.

Return Value

Extracted text

Exceptions

ExceptionCondition
Xmlsq.XmlsqErrorExceptionBad input: missing file or invalid XML or invalid XPath.

Enumerations

Query.Opts Enumeration

Options for queries.

Syntax

[C#]
public enum Opts
[VB.NET]
Public Enumeration Opts

Members

Member nameDescription
Default
Use default options.
Asciify
Asciify the output as XML character references [default=UTF-8-encoded].
Raw
Output nodeset in raw format [default=prettify].
Trim
Trim leading and trailing whitespace (and collapse whitespace for an attribute value).

Index

Classes
Enumerations
Gen Class
Methods
Query Class
Xmlsq Namespace