internal FacetProperty(FacetPropertyDefinition Definition, string ValueAsString) { thisDefinition = Definition; try { thisValue = Activator.CreateInstance(Definition.Datatype) as AnyType; thisValue.ValueAsString = ValueAsString; } catch (Exception e) { throw new NotSupportedException("INTERNAL ERROR: CreateInstance error in FacetProperty construction", e); } }
private void CreateRestrictionType(INode CurrentChildNode, INamespaceManager namespaceManager) { string BaseValue = CurrentChildNode.Attributes["base"].Value; var BaseValueAsQualifiedName = Container.Resolve <IQualifiedName>(); BaseValueAsQualifiedName.FullyQualifiedName = BaseValue; //var NamespaceUri = string.Empty; //if (string.IsNullOrEmpty(BaseValueAsQualifiedName.Namespace) == false) // NamespaceUri = namespaceManager.LookupNamespace(BaseValueAsQualifiedName.Namespace); thisRestrictionType = AnyType.CreateType(BaseValueAsQualifiedName.Name, CurrentChildNode); if (thisRestrictionType == null) { string MessageFormat = AssemblyResources.GetName("UnsupportedRestrictionBaseSimpleType"); StringBuilder MessageBuilder = new StringBuilder(); MessageBuilder.AppendFormat(MessageFormat, BaseValue); //throw new XbrlException(MessageBuilder.ToString()); } }
private void CreateRestrictionType(INode restrictionNode, INamespaceManager namespaceManager) { string BaseValue = restrictionNode.Attributes["base"].Value; var BaseValueAsQualifiedName = Container.Resolve <IQualifiedName>(); BaseValueAsQualifiedName.FullyQualifiedName = BaseValue; thisRestrictionType = AnyType.CreateType(BaseValueAsQualifiedName.Name, restrictionNode); if (thisRestrictionType == null) { string MessageFormat = AssemblyResources.GetName("UnsupportedRestrictionBaseSimpleType"); StringBuilder MessageBuilder = new StringBuilder(); MessageBuilder.AppendFormat(MessageFormat, BaseValue); } foreach (INode childNode in restrictionNode.ChildNodes) { if (childNode.LocalName.Equals("attribute") == true) { ProcessRestrictionAttribute(childNode); } } }
/// <summary> /// Creates a XML schema type for use by the internally-implemented XML schema type system. /// </summary> /// <param name="Schema"> /// The schema containing the definition of the type. /// </param> /// <param name="TypeName"> /// The name of the type to be created. Specific types are created according to the following table: /// <list type="table"> /// <listeader> /// <term> /// Type Name /// </term> /// <description> /// Specific Class of Returned Object /// </description> /// </listeader> /// <item> /// <term> /// token /// </term> /// <description> /// <see cref="JeffFerguson.Gepsio.Xsd.Token"/> /// </description> /// </item> /// <item> /// <term> /// string /// </term> /// <description> /// <see cref="JeffFerguson.Gepsio.Xsd.String"/> /// </description> /// </item> /// <item> /// <term> /// xbrli:decimalItemType /// </term> /// <description> /// <see cref="JeffFerguson.Gepsio.Xsd.DecimalItemType"/> /// </description> /// </item> /// <item> /// <term> /// xbrli:monetaryItemType /// </term> /// <description> /// <see cref="JeffFerguson.Gepsio.Xsd.MonetaryItemType"/> /// </description> /// </item> /// <item> /// <term> /// xbrli:pureItemType /// </term> /// <description> /// <see cref="JeffFerguson.Gepsio.Xsd.PureItemType"/> /// </description> /// </item> /// <item> /// <term> /// xbrli:sharesItemType /// </term> /// <description> /// <see cref="JeffFerguson.Gepsio.Xsd.SharesItemType"/> /// </description> /// </item> /// <item> /// <term> /// xbrli:tokenItemType /// </term> /// <description> /// <see cref="JeffFerguson.Gepsio.Xsd.TokenItemType"/> /// </description> /// </item> /// <item> /// <term> /// xbrli:stringItemType /// </term> /// <description> /// <see cref="JeffFerguson.Gepsio.Xsd.StringItemType"/> /// </description> /// </item> /// </list> /// <para> /// If a type name not shown above is supplied, then null will be returned. /// </para> /// </param> /// <returns> /// A type object representing the type referenced by the parameter, or null if the type name is /// not supported. /// </returns> public static AnyType CreateType(string TypeName, XbrlSchema Schema) { return(AnyType.CreateType(TypeName, Schema.SchemaRootNode)); }