/// <summary>
        /// Constructor.
        /// </summary>
        /// <param name="atomInputContext">The ATOM input context to read from.</param>
        internal ODataAtomEntryAndFeedDeserializer(ODataAtomInputContext atomInputContext)
            : base(atomInputContext)
        {
            XmlNameTable nameTable = this.XmlReader.NameTable;
            this.AtomNamespace = nameTable.Add(AtomConstants.AtomNamespace);
            this.AtomEntryElementName = nameTable.Add(AtomConstants.AtomEntryElementName);
            this.AtomCategoryElementName = nameTable.Add(AtomConstants.AtomCategoryElementName);
            this.AtomCategoryTermAttributeName = nameTable.Add(AtomConstants.AtomCategoryTermAttributeName);
            this.AtomCategorySchemeAttributeName = nameTable.Add(AtomConstants.AtomCategorySchemeAttributeName);
            this.AtomContentElementName = nameTable.Add(AtomConstants.AtomContentElementName);
            this.AtomLinkElementName = nameTable.Add(AtomConstants.AtomLinkElementName);
            this.AtomPropertiesElementName = nameTable.Add(AtomConstants.AtomPropertiesElementName);
            this.AtomFeedElementName = nameTable.Add(AtomConstants.AtomFeedElementName);
            this.AtomIdElementName = nameTable.Add(AtomConstants.AtomIdElementName);
            this.AtomLinkRelationAttributeName = nameTable.Add(AtomConstants.AtomLinkRelationAttributeName);
            this.AtomLinkHrefAttributeName = nameTable.Add(AtomConstants.AtomLinkHrefAttributeName);
            this.MediaLinkEntryContentSourceAttributeName = nameTable.Add(AtomConstants.MediaLinkEntryContentSourceAttributeName);
            this.ODataETagAttributeName = nameTable.Add(AtomConstants.ODataETagAttributeName);
            this.ODataCountElementName = nameTable.Add(AtomConstants.ODataCountElementName);
            this.ODataInlineElementName = nameTable.Add(AtomConstants.ODataInlineElementName);
            this.ODataActionElementName = nameTable.Add(AtomConstants.ODataActionElementName);
            this.ODataFunctionElementName = nameTable.Add(AtomConstants.ODataFunctionElementName);
            this.ODataOperationMetadataAttribute = nameTable.Add(AtomConstants.ODataOperationMetadataAttribute);
            this.ODataOperationTitleAttribute = nameTable.Add(AtomConstants.ODataOperationTitleAttribute);
            this.ODataOperationTargetAttribute = nameTable.Add(AtomConstants.ODataOperationTargetAttribute);

            this.atomAnnotationReader = new ODataAtomAnnotationReader(this.AtomInputContext, this);
        }
        private ODataAtomAnnotationReader CreateODataAtomAnnotationReader(string annotationElementText)
        {
            // Create a dummy root node wrapping the annotation element in order to define the namespace prefix mappings.
            string xmlText = "<dummy xmlns:m=\"" + AtomConstants.ODataMetadataNamespace + "\" xmlns:d=\"" + AtomConstants.ODataNamespace + "\" xmlns=\"" + AtomConstants.AtomNamespace + "\">" + annotationElementText + "</dummy>";

            var inputContext = new ODataAtomInputContext(
                ODataFormat.Atom,
                new MemoryStream(Encoding.UTF8.GetBytes(xmlText)),
                Encoding.UTF8,
                new ODataMessageReaderSettings { ShouldIncludeAnnotation = this.shouldIncludeAnnotation },
                true,
                true,
                this.model,
                null);
            this.xmlReader = inputContext.XmlReader;

            var parser = new ODataAtomAnnotationReader(inputContext, new ODataAtomPropertyAndValueDeserializer(inputContext));

            // Position the xml reader on the dummy element.
            this.xmlReader.Read();

            // Read over the start element of the dummy element (and position the reader on the m:annotation start tag).
            this.xmlReader.Read();
            return parser;
        }