Example #1
0
 internal IdRefNode(IdRefNode next, string id, int lineNo, int linePos)
 {
     this.Id = id;
     this.LineNo = lineNo;
     this.LinePos = linePos;
     this.Next = next;
 }
Example #2
0
        private void CheckForwardRefs()
        {
            IdRefNode next = _idRefListHead;

            while (next != null)
            {
                if (FindId(next.Id) == null)
                {
                    SendValidationEvent(new XmlSchemaException(SR.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;
        }
Example #3
0
        void ProcessTokenizedType(
            XmlTokenizedType ttype,
            string name
            )
        {
            switch (ttype)
            {
            case XmlTokenizedType.ID:
                if (processIdentityConstraints)
                {
                    if (FindId(name) != null)
                    {
                        SendValidationEvent(Res.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;
            }
        }
        private void ProcessTokenizedType(XmlTokenizedType ttype, string name)
        {
            switch (ttype)
            {
            case XmlTokenizedType.ID:
                if (!this.processIdentityConstraints)
                {
                    break;
                }
                if (this.FindId(name) == null)
                {
                    this.AddID(name, base.context.LocalName);
                    return;
                }
                base.SendValidationEvent("Sch_DupId", name);
                return;

            case XmlTokenizedType.IDREF:
                if (!this.processIdentityConstraints || (this.FindId(name) != null))
                {
                    break;
                }
                this.idRefListHead = new IdRefNode(this.idRefListHead, name, base.PositionInfo.LineNumber, base.PositionInfo.LinePosition);
                return;

            case XmlTokenizedType.IDREFS:
                break;

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

            default:
                return;
            }
        }
 private void CheckForwardRefs()
 {
     IdRefNode next;
     for (IdRefNode node = this.idRefListHead; node != null; node = next)
     {
         if (this.FindId(node.Id) == null)
         {
             this.SendValidationEvent(new XmlSchemaValidationException("Sch_UndeclaredId", node.Id, this.sourceUriString, node.LineNo, node.LinePos), XmlSeverityType.Error);
         }
         next = node.Next;
         node.Next = null;
     }
     this.idRefListHead = null;
 }
        private void ProcessTokenizedType(XmlTokenizedType ttype, string name, bool attrValue)
        {
            switch (ttype)
            {
                case XmlTokenizedType.ID:
                    if (!this.ProcessIdentityConstraints)
                    {
                        break;
                    }
                    if (this.FindId(name) == null)
                    {
                        if (this.IDs == null)
                        {
                            this.IDs = new Hashtable();
                        }
                        this.IDs.Add(name, this.context.LocalName);
                        return;
                    }
                    if (attrValue)
                    {
                        this.attrValid = false;
                    }
                    this.SendValidationEvent("Sch_DupId", name);
                    return;

                case XmlTokenizedType.IDREF:
                    if (!this.ProcessIdentityConstraints || (this.FindId(name) != null))
                    {
                        break;
                    }
                    this.idRefListHead = new IdRefNode(this.idRefListHead, name, this.positionInfo.LineNumber, this.positionInfo.LinePosition);
                    return;

                case XmlTokenizedType.IDREFS:
                    break;

                case XmlTokenizedType.ENTITY:
                    this.ProcessEntity(name);
                    break;

                default:
                    return;
            }
        }
 private void CheckForwardRefs() {
     IdRefNode next = idRefListHead;
     while (next != null) {
         if(FindId(next.Id) == null) {
             SendValidationEvent(new XmlSchemaException(Res.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;
 }
 void ProcessTokenizedType(
     XmlTokenizedType    ttype,
     string              name
 ) {
     switch(ttype) {
     case XmlTokenizedType.ID:
         if (FindId(name) != null) {
             SendValidationEvent(Res.Sch_DupId, name);
         }
         else {
             AddID(name, context.LocalName);
         }
         break;
     case XmlTokenizedType.IDREF:
         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;
     }
 }
 private void CheckForwardRefs() {
     IdRefNode next = idRefListHead;
     while (next != null) {
         if(FindId(next.Id) == null) {
             SendValidationEvent(new XmlSchemaValidationException(Res.Sch_UndeclaredId, next.Id, this.sourceUriString, next.LineNo, next.LinePos), XmlSeverityType.Error);
         }
         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;
 }
 private void ProcessTokenizedType(XmlTokenizedType ttype, string name, bool attrValue) {
     switch(ttype) {
         case XmlTokenizedType.ID:
             if (ProcessIdentityConstraints) {
                 if (FindId(name) != null) {
                     if (attrValue) {
                         attrValid = false;
                     }
                     SendValidationEvent(Res.Sch_DupId, name);
                 }
                 else {
                     if (IDs == null) { //ADD ID
                         IDs = new Hashtable();
                     }
                     IDs.Add(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, positionInfo.LineNumber, positionInfo.LinePosition);
                 }
             }
             break;
         case XmlTokenizedType.ENTITY:
             ProcessEntity(name);
             break;
         default:
             break;
     }
 }
 private void CheckForwardRefs()
 {
     IdRefNode next;
     for (IdRefNode node = this.idRefListHead; node != null; node = next)
     {
         if (this.FindId(node.Id) == null)
         {
             base.SendValidationEvent(new XmlSchemaException("Sch_UndeclaredId", node.Id, base.reader.BaseURI, node.LineNo, node.LinePos));
         }
         next = node.Next;
         node.Next = null;
     }
     this.idRefListHead = null;
 }
        private void ProcessTokenizedType(XmlTokenizedType ttype, string name)
        {
            switch (ttype)
            {
                case XmlTokenizedType.ID:
                    if (!this.processIdentityConstraints)
                    {
                        break;
                    }
                    if (this.FindId(name) == null)
                    {
                        this.AddID(name, base.context.LocalName);
                        return;
                    }
                    base.SendValidationEvent("Sch_DupId", name);
                    return;

                case XmlTokenizedType.IDREF:
                    if (!this.processIdentityConstraints || (this.FindId(name) != null))
                    {
                        break;
                    }
                    this.idRefListHead = new IdRefNode(this.idRefListHead, name, base.PositionInfo.LineNumber, base.PositionInfo.LinePosition);
                    return;

                case XmlTokenizedType.IDREFS:
                    break;

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

                default:
                    return;
            }
        }