예제 #1
0
        /// <summary> Reads the information about this container in the container list from the EAD XML Reader</summary>
        /// <param name="reader"> EAD XML Text Reader </param>
        public void Read(XmlTextReader reader)
        {
            String tagname = reader.Name;

            for (int i = 0; i < reader.AttributeCount; i++)
            {
                reader.MoveToAttribute(i);
                if (reader.Name.Equals("type"))
                {
                    type = reader.Value;
                }
            }
            while (reader.Read())
            {
                if (reader.NodeType == XmlNodeType.Element)
                {
                    if (reader.Name == "head")
                    {
                        reader.Read();
                        head = reader.Value;
                    }
                    else if (reader.Name == "did")
                    {
                        did = new Descriptive_Identification();
                        did.Read(reader);
                    }
                    else if (reader.Name == "c01")
                    {
                        Container_Info c_tag = new Container_Info();
                        c_tag.Read(reader);
                        containers.Add(c_tag);
                    }
                }
                else if (reader.NodeType == XmlNodeType.EndElement)
                {
                    if (reader.Name.Equals(tagname))
                    {
                        break;
                    }
                }
            }
        }
 /// <summary> Reads the information about this container in the container list from the EAD XML Reader</summary>
 /// <param name="reader"> EAD XML Text Reader </param>
 public void Read(XmlTextReader reader)
 {
     String tagname = reader.Name;
     for (int i = 0; i < reader.AttributeCount; i++)
     {
         reader.MoveToAttribute(i);
         if (reader.Name.Equals("type"))
             type = reader.Value;
     }
     while (reader.Read())
     {
         if (reader.NodeType == XmlNodeType.Element)
         {
             if (reader.Name == "head")
             {
                 reader.Read();
                 head = reader.Value;
             }
             else if (reader.Name == "did")
             {
                 did = new Descriptive_Identification();
                 did.Read(reader);
             }
             else if (reader.Name == "c01")
             {
                 Container_Info c_tag = new Container_Info();
                 c_tag.Read(reader);
                 containers.Add(c_tag);
             }
         }
         else if (reader.NodeType == XmlNodeType.EndElement)
         {
             if (reader.Name.Equals(tagname))
                 break;
         }
     }
 }
예제 #3
0
 /// <summary> Constructor for a new instance of the C_Info class </summary>
 public Container_Info()
 {
     did = new Descriptive_Identification();
 }
예제 #4
0
        /// <summary> Reads the information about this container in the container list from the EAD XML Reader</summary>
        /// <param name="reader"> EAD XML Text Reader </param>
        public void Read(XmlTextReader reader)
        {
            Regex rgx1 = new Regex("xmlns=\"[^\"]*\"");
            Regex rgx2 = new Regex("[ ]*>");
            Regex rgx3 = new Regex("[ ]*/>");

            string tagname     = reader.Name;
            Regex  ctagPattern = new Regex("c[0-9][0-9]");

            if (reader.MoveToAttribute("level"))
            {
                level = reader.Value;
            }

            // Read all the information under this component
            while (reader.Read())
            {
                if (reader.NodeType == XmlNodeType.Element)
                {
                    if (ctagPattern.IsMatch(reader.Name))
                    {
                        // Read this child component
                        Container_Info c_tag = new Container_Info();
                        c_tag.Read(reader);
                        if (c_tags == null)
                        {
                            c_tags = new List <Container_Info>();
                        }
                        c_tags.Add(c_tag);

                        // Set this flag to determine if this has a complex child
                        if (c_tag.is_Complex_Or_Has_Complex_Children)
                        {
                            has_complex_child = true;
                        }
                    }
                    else
                    {
                        switch (reader.Name)
                        {
                        case "did":
                            did = new Descriptive_Identification();
                            did.Read(reader);
                            break;

                        case "bioghist":
                            string InnerXml_bioghist  = reader.ReadInnerXml();
                            string InnerXml_bioghist2 = rgx1.Replace(InnerXml_bioghist, "");
                            string InnerXml_bioghist3 = rgx2.Replace(InnerXml_bioghist2, ">");
                            biogHist = rgx3.Replace(InnerXml_bioghist3, "/>");
                            break;

                        case "scopecontent":
                            string InnerXml_scopecontent  = reader.ReadInnerXml();
                            string InnerXml_scopecontent2 = rgx1.Replace(InnerXml_scopecontent, "");
                            string InnerXml_scopecontent3 = rgx2.Replace(InnerXml_scopecontent2, ">");
                            scope = rgx3.Replace(InnerXml_scopecontent3, "/>");
                            break;
                        }
                    }
                }
                else if (reader.NodeType == XmlNodeType.EndElement && reader.Name.Equals(tagname))
                {
                    break;
                }
            }
        }
예제 #5
0
 /// <summary> Constructor for a new instance of the Description_of_Subordinate_Components class </summary>
 public Description_of_Subordinate_Components()
 {
     containers = new List <Container_Info>();
     did        = new Descriptive_Identification();
 }
 /// <summary> Constructor for a new instance of the C_Info class </summary>
 public Container_Info()
 {
     did = new Descriptive_Identification();
 }
        /// <summary> Reads the information about this container in the container list from the EAD XML Reader</summary>
        /// <param name="reader"> EAD XML Text Reader </param>
        public void Read(XmlTextReader reader)
        {
            Regex rgx1 = new Regex("xmlns=\"[^\"]*\"");
            Regex rgx2 = new Regex("[ ]*>");
            Regex rgx3 = new Regex("[ ]*/>");

            string tagname = reader.Name;
            Regex ctagPattern = new Regex("c[0-9][0-9]");
            if (reader.MoveToAttribute("level"))
                level = reader.Value;

            // Read all the information under this component
            while (reader.Read())
            {
                if (reader.NodeType == XmlNodeType.Element)
                {
                    if (ctagPattern.IsMatch(reader.Name))
                    {
                        // Read this child component
                        Container_Info c_tag = new Container_Info();
                        c_tag.Read(reader);
                        if (c_tags == null)
                            c_tags = new List<Container_Info>();
                        c_tags.Add(c_tag);

                        // Set this flag to determine if this has a complex child
                        if (c_tag.is_Complex_Or_Has_Complex_Children)
                            has_complex_child = true;
                    }
                    else
                    {
                        switch (reader.Name)
                        {
                            case "did":
                                did = new Descriptive_Identification();
                                did.Read(reader);
                                break;

                            case "bioghist":
                                string InnerXml_bioghist = reader.ReadInnerXml();
                                string InnerXml_bioghist2 = rgx1.Replace(InnerXml_bioghist, "");
                                string InnerXml_bioghist3 = rgx2.Replace(InnerXml_bioghist2, ">");
                                biogHist = rgx3.Replace(InnerXml_bioghist3, "/>");
                                break;

                            case "scopecontent":
                                string InnerXml_scopecontent = reader.ReadInnerXml();
                                string InnerXml_scopecontent2 = rgx1.Replace(InnerXml_scopecontent, "");
                                string InnerXml_scopecontent3 = rgx2.Replace(InnerXml_scopecontent2, ">");
                                scope = rgx3.Replace(InnerXml_scopecontent3, "/>");
                                break;
                        }
                    }
                }
                else if (reader.NodeType == XmlNodeType.EndElement && reader.Name.Equals(tagname))
                    break;
            }
        }
 /// <summary> Constructor for a new instance of the Description_of_Subordinate_Components class </summary>
 public Description_of_Subordinate_Components()
 {
     containers = new List<Container_Info>();
     did = new Descriptive_Identification();
 }
        private EAD_Transfer_Descriptive_Identification ead_copy_did_to_transfer(Descriptive_Identification Source)
        {
            // If null, just return null
            if (Source == null)
                return null;

            // Create the main object, and copy over the simple string values
            EAD_Transfer_Descriptive_Identification returnObj = new EAD_Transfer_Descriptive_Identification
            {
                DAO = Source.DAO,
                DAO_Link = Source.DAO_Link,
                DAO_Title = Source.DAO_Title,
                Extent = Source.Extent,
                Unit_Date = Source.Unit_Date,
                Unit_Title = Source.Unit_Title
            };

            // Copy any information about parent containers
            if (Source.Container_Count > 0)
            {
                foreach (Parent_Container_Info parentInfo in Source.Containers)
                {
                    returnObj.Add_Container(parentInfo.Container_Type, parentInfo.Container_Title);
                }
            }

            return returnObj;
        }