Ejemplo n.º 1
0
        private void CheckForwardRefs()
        {
            IdRefNode next = _idRefListHead;

            while (next != null)
            {
                if (FindId(next.Id) == null)
                {
                    SendValidationEvent(new XmlSchemaException(ResXml.Sch_UndeclaredId, next.Id, reader.BaseURI, next.LineNo, next.LinePos));
                }
                IdRefNode ptr = next.Next;
                next.Next = null; // unhook each object so it is cleaned up by Garbage Collector
                next      = ptr;
            }
            // not needed any more.
            _idRefListHead = null;
        }
Ejemplo n.º 2
0
        private void ProcessTokenizedType(
            XmlTokenizedType ttype,
            string name
            )
        {
            switch (ttype)
            {
            case XmlTokenizedType.ID:
                if (_processIdentityConstraints)
                {
                    if (FindId(name) != null)
                    {
                        SendValidationEvent(ResXml.Sch_DupId, name);
                    }
                    else
                    {
                        AddID(name, context.LocalName);
                    }
                }
                break;

            case XmlTokenizedType.IDREF:
                if (_processIdentityConstraints)
                {
                    object p = FindId(name);
                    if (p == null)
                    {     // add it to linked list to check it later
                        _idRefListHead = new IdRefNode(_idRefListHead, name, this.PositionInfo.LineNumber, this.PositionInfo.LinePosition);
                    }
                }

                break;

            case XmlTokenizedType.ENTITY:
                ProcessEntity(schemaInfo, name, this, EventHandler, Reader.BaseURI, PositionInfo.LineNumber, PositionInfo.LinePosition);
                break;

            default:
                break;
            }
        }