Class CldrExtensions
Extensions to make CLDR access easier.
Inherited Members
Namespace: Sepia.Globalization
Assembly: Sepia.Globalization.dll
Syntax
public static class CldrExtensions
Remarks
These are simple XPath lookups for multiple documents. CLDR inheritance is not performed.
The CldrContext is used to provide extra XPath varaibles and functions.
Methods
| Improve this Doc View SourceElements(IEnumerable<XPathDocument>, String)
Find all the elements that match the XPATH expression in the sequence of documents.
Declaration
public static IEnumerable<XPathNavigator> Elements(this IEnumerable<XPathDocument> docs, string predicate)
Parameters
Type | Name | Description |
---|---|---|
IEnumerable<XPathDocument> | docs | The documents to search. |
String | predicate | The XPATH expression. |
Returns
Type | Description |
---|---|
IEnumerable<XPathNavigator> | Sequence of matched elements. |
FirstElement(IEnumerable<XPathDocument>, String)
Find the first element that matches the XPATH expression in the sequence of documents.
Declaration
public static XPathNavigator FirstElement(this IEnumerable<XPathDocument> docs, string predicate)
Parameters
Type | Name | Description |
---|---|---|
IEnumerable<XPathDocument> | docs | The documents to search. |
String | predicate | The XPATH expression. |
Returns
Type | Description |
---|---|
XPathNavigator | The matched element. |
Exceptions
Type | Condition |
---|---|
KeyNotFoundException | No elements match the |
FirstElementOrDefault(IEnumerable<XPathDocument>, String)
Find the first element that matches the XPATH expression in the sequence of documents or return null.
Declaration
public static XPathNavigator FirstElementOrDefault(this IEnumerable<XPathDocument> docs, string predicate)
Parameters
Type | Name | Description |
---|---|---|
IEnumerable<XPathDocument> | docs | The documents to search. |
String | predicate | The XPATH expression. |
Returns
Type | Description |
---|---|
XPathNavigator | The matched element or null. |
FirstElementOrDefault(IEnumerable<XPathDocument>, String, Func<IEnumerable<XPathDocument>, XPathNavigator>)
Find the first element that matches the XPATH expression in the sequence of documents or return a default value.
Declaration
public static XPathNavigator FirstElementOrDefault(this IEnumerable<XPathDocument> docs, string predicate, Func<IEnumerable<XPathDocument>, XPathNavigator> defaultAction)
Parameters
Type | Name | Description |
---|---|---|
IEnumerable<XPathDocument> | docs | The documents to seatch. |
String | predicate | The XPATH expression. |
Func<IEnumerable<XPathDocument>, XPathNavigator> | defaultAction | The action to perform when no elements match
the |
Returns
Type | Description |
---|---|
XPathNavigator | The matched element. |
Exceptions
Type | Condition |
---|---|
KeyNotFoundException | No elements match the |