本文整理汇总了C#中HandCoded.Xml.NodeIndex.GetElementsByName方法的典型用法代码示例。如果您正苦于以下问题:C# NodeIndex.GetElementsByName方法的具体用法?C# NodeIndex.GetElementsByName怎么用?C# NodeIndex.GetElementsByName使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类HandCoded.Xml.NodeIndex
的用法示例。
在下文中一共展示了NodeIndex.GetElementsByName方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Evaluate
/// <summary>
/// Evaluates this <see cref="Precondition"/> against the contents of the
/// indicated <see cref="NodeIndex"/>.
/// </summary>
/// <param name="nodeIndex">The <see cref="NodeIndex"/> of a <see cref="XmlDocument"/>.</param>
/// <param name="cache">A cache of previously evaluated precondition results.</param>
/// <returns>A <see cref="bool"/> value indicating the applicability of this
/// <see cref="Precondition"/> to the <see cref="XmlDocument"/>.</returns>
public override bool Evaluate(NodeIndex nodeIndex, Dictionary<Precondition, bool> cache)
{
foreach (string rootElement in release.RootElements) {
XmlNodeList list = nodeIndex.GetElementsByName (rootElement);
if (list.Count == 1) {
XmlElement fpml = list [0] as XmlElement;
if (fpml.LocalName.Equals("FpML"))
return (fpml.GetAttribute ("version").Equals (release.Version));
else
return (fpml.GetAttribute ("fpmlVersion").Equals (release.Version));
}
}
return (false);
}
示例2: Rule09
//---------------------------------------------------------------------
private static bool Rule09(string name, NodeIndex nodeIndex, ValidationErrorHandler errorHandler)
{
bool result = true;
foreach (XmlElement context in nodeIndex.GetElementsByName ("cashSettlementPaymentDate"))
result &= Rule09 (name, context.GetElementsByTagName ("businessDateRange"), errorHandler);
return (result);
}
示例3: Rule02
// --------------------------------------------------------------------
private static bool Rule02(string name, NodeIndex nodeIndex, ValidationErrorHandler errorHandler)
{
if (nodeIndex.HasTypeInformation)
return (Rule02 (name, nodeIndex, nodeIndex.GetElementsByType (DetermineNamespace (nodeIndex), "PaymentCalculationPeriod"), errorHandler));
return (Rule02 (name, nodeIndex, nodeIndex.GetElementsByName ("paymentCalculationPeriod"), errorHandler));
}
示例4: Rule14
// --------------------------------------------------------------------
private static bool Rule14(string name, NodeIndex nodeIndex, ValidationErrorHandler errorHandler)
{
bool result = true;
foreach (XmlElement context in nodeIndex.GetElementsByName ("creditDefaultSwap")) {
foreach (XmlElement seller in XPath.Paths (context, "protectionTerms", "creditEvents", "creditEventNotice", "notifyingParty", "sellerPartyReference")) {
if (Equal (seller.GetAttribute ("href"),
XPath.Path (context, "generalTerms", "sellerPartyReference").GetAttribute ("href")))
continue;
errorHandler ("305", context,
"If protectionTerms/creditEvents/creditEventNotice/notifyingParty/sellerPartyReference " +
"is present, its @href attribute must match that of generalTerms/sellerPartyReference",
name, null);
result = false;
}
}
return (result);
}
示例5: Rule12
// --------------------------------------------------------------------
private static bool Rule12(string name, NodeIndex nodeIndex, ValidationErrorHandler errorHandler)
{
bool result = true;
foreach (XmlElement context in nodeIndex.GetElementsByName ("referenceInformation")) {
if (Exists (context ["referencePrice"])) {
if (GreaterOrEqual (context ["referencePrice"], 0.0))
continue;
errorHandler ("305", context,
"If referencePrice is present it must not have a negative " +
"value",
name, context ["referencePrice"].InnerText);
result = false;
}
}
return (result);
}
示例6: Rule10
// --------------------------------------------------------------------
private static bool Rule10(string name, NodeIndex nodeIndex, ValidationErrorHandler errorHandler)
{
bool result = true;
foreach (XmlElement context in nodeIndex.GetElementsByName ("referenceInformation")) {
string primaryReference;
string primaryId;
foreach (XmlElement primary in XPath.Paths (context, "referenceObligation", "guarantorReference")) {
if (Equal (
primaryReference = primary.GetAttribute ("href"),
primaryId = context ["referenceEntity"].GetAttribute ("id")))
continue;
errorHandler ("305", context,
"Primary obligor reference '" + primaryReference +
"' should point to the reference entity ' " + primaryId + "'",
name, null);
result = false;
}
}
return (result);
}
示例7: Rule06
// --------------------------------------------------------------------
private static bool Rule06(string name, NodeIndex nodeIndex, ValidationErrorHandler errorHandler)
{
bool result = true;
foreach (XmlElement context in nodeIndex.GetElementsByName ("generalTerms")) {
XmlElement buyer = context ["buyerPartyReference"];
XmlElement seller = context ["sellerPartyReference"];
if ((buyer == null) || (seller == null) ||
NotEqual (buyer.GetAttribute ("href"), seller.GetAttribute ("href")))
continue;
errorHandler ("305", context,
"Buyer party reference is equal to seller party reference",
name, seller.GetAttribute ("href"));
result = false;
}
return (result);
}
示例8: Rule44
// --------------------------------------------------------------------
private static bool Rule44(string name, NodeIndex nodeIndex, ValidationErrorHandler errorHandler)
{
return (Rule44 (name, nodeIndex.GetElementsByName ("creditDefaultSwap"), errorHandler));
}
示例9: Rule28
// --------------------------------------------------------------------
private static bool Rule28(string name, NodeIndex nodeIndex, ValidationErrorHandler errorHandler)
{
bool result = true;
foreach (XmlElement context in nodeIndex.GetElementsByName ("creditDefaultSwap")) {
XmlElement paymentDate;
XmlElement effectiveDate;
if (Implies (
Exists (XPath.Path (context, "feeLeg", "periodicPayment", "firstPaymentDate")),
Greater (
paymentDate = XPath.Path (context, "feeLeg", "periodicPayment", "firstPaymentDate"),
effectiveDate = XPath.Path (context, "generalTerms", "effectiveDate", "unadjustedDate"))))
continue;
errorHandler ("305", context,
"First periodic payment date '" + paymentDate.InnerText + "' " +
"must be after the effective date '" + effectiveDate.InnerText + "'",
name, null);
result = false;
}
return (result);
}
示例10: Rule17
//---------------------------------------------------------------------
private static bool Rule17(string name, NodeIndex nodeIndex, ValidationErrorHandler errorHandler)
{
bool result = true;
foreach (XmlElement context in XPath.Paths (nodeIndex.GetElementsByName ("tradeSide"), "*", "account")) {
string href = context.GetAttribute ("href");
XmlElement target = nodeIndex.GetElementById (href);
if (target.LocalName.Equals ("account")) continue;
errorHandler ("305", context,
"The value of the href attribute does not refer to an account structure",
name, href);
result = false;
}
return (result);
}
示例11: Rule15
//---------------------------------------------------------------------
private static bool Rule15(string name, NodeIndex nodeIndex, ValidationErrorHandler errorHandler)
{
return (
Rule15 (name, nodeIndex.GetElementsByName ("gracePeriod"), errorHandler)
& Rule15 (name, nodeIndex.GetElementsByName ("paymentDaysOffset"), errorHandler)
& Rule15 (name, nodeIndex.GetElementsByName ("rateCutOffDaysOffset"), errorHandler)
& Rule15 (name, nodeIndex.GetElementsByName ("relativeDate"), errorHandler)
& Rule15 (name, nodeIndex.GetElementsByName ("fixingDateOffset"), errorHandler)
& Rule15 (name, nodeIndex.GetElementsByName ("initialFixingDate"), errorHandler)
& Rule15 (name, nodeIndex.GetElementsByName ("fixingDates"), errorHandler)
& Rule15 (name, nodeIndex.GetElementsByName ("cashSettlementValuationDate"), errorHandler)
& Rule15 (name, nodeIndex.GetElementsByName ("varyingNotionalInterimExchangePaymentDates"), errorHandler)
& Rule15 (name, nodeIndex.GetElementsByName ("varyingNotionalFixingDates"), errorHandler)
& Rule15 (name, nodeIndex.GetElementsByName ("feePaymentDate"), errorHandler)
& Rule15 (name, nodeIndex.GetElementsByName ("relativeDates"), errorHandler));
}
示例12: Rule14B
//---------------------------------------------------------------------
private static bool Rule14B(string name, NodeIndex nodeIndex, ValidationErrorHandler errorHandler)
{
return (Rule14B (name, nodeIndex.GetElementsByName ("calculationAgentPartyReference"), errorHandler, nodeIndex));
}
示例13: Rule13A
//---------------------------------------------------------------------
private static bool Rule13A(string name, NodeIndex nodeIndex, ValidationErrorHandler errorHandler)
{
return (Rule13A (name, nodeIndex.GetElementsByName ("sellerPartyReference"), errorHandler, nodeIndex));
}
示例14: Rule11
//---------------------------------------------------------------------
private static bool Rule11(string name, NodeIndex nodeIndex, ValidationErrorHandler errorHandler)
{
return (Rule11 (name, nodeIndex.GetElementsByName ("businessDateRange"), errorHandler));
}
示例15: Rule10
//---------------------------------------------------------------------
private static bool Rule10(string name, NodeIndex nodeIndex, ValidationErrorHandler errorHandler)
{
return (Rule10 (name, nodeIndex.GetElementsByName ("calculationAgent"), errorHandler));
}