예제 #1
0
파일: Item.cs 프로젝트: Mihailorama/gepsio
 //------------------------------------------------------------------------------------
 //------------------------------------------------------------------------------------
 private void GetSchemaElementFromSchema()
 {
     foreach (XbrlSchema CurrentSchema in thisParentFragment.Schemas)
     {
         if (CurrentSchema.TargetNamespace == this.Namespace)
         {
             thisSchema = CurrentSchema;
         }
     }
     if (thisSchema == null)
     {
         if (thisParentFragment.Schemas.Count == 0)
         {
             string        MessageFormat        = AssemblyResources.GetName("NoSchemasForFragment");
             StringBuilder MessageFormatBuilder = new StringBuilder();
             MessageFormatBuilder.AppendFormat(MessageFormat);
             thisParentFragment.AddValidationError(new ItemValidationError(this, MessageFormatBuilder.ToString()));
         }
         thisSchema = thisParentFragment.Schemas[0];
     }
     this.SchemaElement = thisSchema.GetElement(this.Name);
     if (this.SchemaElement == null)
     {
         string        MessageFormat        = AssemblyResources.GetName("CannotFindFactElementInSchema");
         StringBuilder MessageFormatBuilder = new StringBuilder();
         MessageFormatBuilder.AppendFormat(MessageFormat, this.Name, thisSchema.Path);
         thisParentFragment.AddValidationError(new ItemValidationError(this, MessageFormatBuilder.ToString()));
     }
 }
예제 #2
0
 private void ValidateScenarioNode(INode ScenarioNode)
 {
     if (ScenarioNode.NamespaceURI.Equals(XbrlDocument.XbrlNamespaceUri) == true)
     {
         string        MessageFormat  = AssemblyResources.GetName("ScenarioNodeUsingXBRLNamespace");
         StringBuilder MessageBuilder = new StringBuilder();
         MessageBuilder.AppendFormat(MessageFormat, this.Id, ScenarioNode.Name);
         this.Fragment.AddValidationError(new ContextValidationError(this, MessageBuilder.ToString()));
     }
     if (ScenarioNode.Prefix.Length > 0)
     {
         XbrlSchema NodeSchema = this.Fragment.GetXbrlSchemaForPrefix(ScenarioNode.Prefix);
         if (NodeSchema != null)
         {
             Element NodeElement = NodeSchema.GetElement(ScenarioNode.LocalName);
             if (NodeElement != null)
             {
                 if (NodeElement.SubstitutionGroup != Element.ElementSubstitutionGroup.Unknown)
                 {
                     string        MessageFormat  = AssemblyResources.GetName("ScenarioNodeUsingSubGroupInXBRLNamespace");
                     StringBuilder MessageBuilder = new StringBuilder();
                     MessageBuilder.AppendFormat(MessageFormat, this.Id, ScenarioNode.Name, NodeSchema.Path);
                     this.Fragment.AddValidationError(new ContextValidationError(this, MessageBuilder.ToString()));
                 }
             }
         }
     }
     foreach (INode CurrentChild in ScenarioNode.ChildNodes)
     {
         ValidateScenarioNode(CurrentChild);
     }
 }
예제 #3
0
 private void ValidateSegmentNodePrefix(INode SegmentNode)
 {
     if (SegmentNode.Prefix.Length > 0)
     {
         XbrlSchema NodeSchema = this.Fragment.GetXbrlSchemaForPrefix(SegmentNode.Prefix);
         if (NodeSchema != null)
         {
             Element NodeElement = NodeSchema.GetElement(SegmentNode.LocalName);
             if (NodeElement != null)
             {
                 if (NodeElement.SubstitutionGroup != Element.ElementSubstitutionGroup.Unknown)
                 {
                     string        MessageFormat  = AssemblyResources.GetName("SegmentNodeUsingSubGroupInXBRLNamespace");
                     StringBuilder MessageBuilder = new StringBuilder();
                     MessageBuilder.AppendFormat(MessageFormat, this.Id, SegmentNode.Name, NodeSchema.Path);
                     this.Fragment.AddValidationError(new ContextValidationError(this, MessageBuilder.ToString()));
                 }
             }
         }
     }
 }