Beispiel #1
0
        public DomDocumentFragment WithSchema(DomSchema schema)
        {
            var result = OwnerDocument.WithSchema(schema).CreateDocumentFragment();

            CopyContentsTo(result);
            return(result);
        }
        public DomDocument WithSchema(DomSchema schema)
        {
            var result = this; // TODO Should clone the instance

            result.Schema = schema;
            return(result);
        }
Beispiel #3
0
        public static DomSchema ReadOnly(DomSchema schema)
        {
            if (schema == null)
            {
                throw new ArgumentNullException(nameof(schema));
            }
            var result = schema.Clone();

            result.MakeReadOnly();
            return(result);
        }
Beispiel #4
0
        protected override DomNodeDefinition CloneCore()
        {
            var schema = new DomSchema(Name)
            {
                NodeTypeProvider = NodeTypeProvider,
            };

            foreach (var ed in ElementDefinitions)
            {
                schema.ElementDefinitions.Add(ed.Clone());
            }
            foreach (var ad in AttributeDefinitions)
            {
                schema.AttributeDefinitions.Add(ad.Clone());
            }
            foreach (var pd in ProcessingInstructionDefinitions)
            {
                schema.ProcessingInstructionDefinitions.Add(pd.Clone());
            }
            return(schema);
        }