Code:
/ Dotnetfx_Win7_3.5.1 / Dotnetfx_Win7_3.5.1 / 3.5.1 / DEVDIV / depot / DevDiv / releases / whidbey / NetFXspW7 / ndp / fx / src / Xml / System / Xml / Dom / XmlDocumentType.cs / 1 / XmlDocumentType.cs
//------------------------------------------------------------------------------ //// Copyright (c) Microsoft Corporation. All rights reserved. // //[....] //----------------------------------------------------------------------------- namespace System.Xml { using System.Xml.Schema; using System.Diagnostics; // Contains information associated with the document type declaration. public class XmlDocumentType : XmlLinkedNode { string name; string publicId; string systemId; string internalSubset; bool namespaces; XmlNamedNodeMap entities; XmlNamedNodeMap notations; // parsed DTD SchemaInfo schemaInfo; protected internal XmlDocumentType( string name, string publicId, string systemId, string internalSubset, XmlDocument doc ) : base( doc ) { this.name = name; this.publicId = publicId; this.systemId = systemId; this.namespaces = true; this.internalSubset = internalSubset; Debug.Assert( doc != null ); if ( !doc.IsLoading ) { doc.IsLoading = true; XmlLoader loader = new XmlLoader(); loader.ParseDocumentType( this ); //will edit notation nodes, etc. doc.IsLoading = false; } } // Gets the name of the node. public override string Name { get { return name;} } // Gets the name of the current node without the namespace prefix. public override string LocalName { get { return name;} } // Gets the type of the current node. public override XmlNodeType NodeType { get { return XmlNodeType.DocumentType;} } // Creates a duplicate of this node. public override XmlNode CloneNode(bool deep) { Debug.Assert( OwnerDocument != null ); return OwnerDocument.CreateDocumentType( name, publicId, systemId, internalSubset ); } // // Microsoft extensions // // Gets a value indicating whether the node is read-only. public override bool IsReadOnly { get { return true; // Make entities and notations readonly } } // Gets the collection of XmlEntity nodes declared in the document type declaration. public XmlNamedNodeMap Entities { get { if (entities == null) entities = new XmlNamedNodeMap( this ); return entities; } } // Gets the collection of XmlNotation nodes present in the document type declaration. public XmlNamedNodeMap Notations { get { if (notations == null) notations = new XmlNamedNodeMap( this ); return notations; } } // // DOM Level 2 // // Gets the value of the public identifier on the DOCTYPE declaration. public string PublicId { get { return publicId;} } // Gets the value of // the system identifier on the DOCTYPE declaration. public string SystemId { get { return systemId;} } // Gets the entire value of the DTD internal subset // on the DOCTYPE declaration. public string InternalSubset { get { return internalSubset;} } internal bool ParseWithNamespaces { get { return namespaces; } set { namespaces = value; } } // Saves the node to the specified XmlWriter. public override void WriteTo(XmlWriter w) { w.WriteDocType( name, publicId, systemId, internalSubset ); } // Saves all the children of the node to the specified XmlWriter. public override void WriteContentTo(XmlWriter w) { // Intentionally do nothing } internal SchemaInfo DtdSchemaInfo { get { return schemaInfo; } set { schemaInfo = value; } } } } // File provided for Reference Use Only by Microsoft Corporation (c) 2007. //------------------------------------------------------------------------------ //// Copyright (c) Microsoft Corporation. All rights reserved. // //[....] //----------------------------------------------------------------------------- namespace System.Xml { using System.Xml.Schema; using System.Diagnostics; // Contains information associated with the document type declaration. public class XmlDocumentType : XmlLinkedNode { string name; string publicId; string systemId; string internalSubset; bool namespaces; XmlNamedNodeMap entities; XmlNamedNodeMap notations; // parsed DTD SchemaInfo schemaInfo; protected internal XmlDocumentType( string name, string publicId, string systemId, string internalSubset, XmlDocument doc ) : base( doc ) { this.name = name; this.publicId = publicId; this.systemId = systemId; this.namespaces = true; this.internalSubset = internalSubset; Debug.Assert( doc != null ); if ( !doc.IsLoading ) { doc.IsLoading = true; XmlLoader loader = new XmlLoader(); loader.ParseDocumentType( this ); //will edit notation nodes, etc. doc.IsLoading = false; } } // Gets the name of the node. public override string Name { get { return name;} } // Gets the name of the current node without the namespace prefix. public override string LocalName { get { return name;} } // Gets the type of the current node. public override XmlNodeType NodeType { get { return XmlNodeType.DocumentType;} } // Creates a duplicate of this node. public override XmlNode CloneNode(bool deep) { Debug.Assert( OwnerDocument != null ); return OwnerDocument.CreateDocumentType( name, publicId, systemId, internalSubset ); } // // Microsoft extensions // // Gets a value indicating whether the node is read-only. public override bool IsReadOnly { get { return true; // Make entities and notations readonly } } // Gets the collection of XmlEntity nodes declared in the document type declaration. public XmlNamedNodeMap Entities { get { if (entities == null) entities = new XmlNamedNodeMap( this ); return entities; } } // Gets the collection of XmlNotation nodes present in the document type declaration. public XmlNamedNodeMap Notations { get { if (notations == null) notations = new XmlNamedNodeMap( this ); return notations; } } // // DOM Level 2 // // Gets the value of the public identifier on the DOCTYPE declaration. public string PublicId { get { return publicId;} } // Gets the value of // the system identifier on the DOCTYPE declaration. public string SystemId { get { return systemId;} } // Gets the entire value of the DTD internal subset // on the DOCTYPE declaration. public string InternalSubset { get { return internalSubset;} } internal bool ParseWithNamespaces { get { return namespaces; } set { namespaces = value; } } // Saves the node to the specified XmlWriter. public override void WriteTo(XmlWriter w) { w.WriteDocType( name, publicId, systemId, internalSubset ); } // Saves all the children of the node to the specified XmlWriter. public override void WriteContentTo(XmlWriter w) { // Intentionally do nothing } internal SchemaInfo DtdSchemaInfo { get { return schemaInfo; } set { schemaInfo = value; } } } } // File provided for Reference Use Only by Microsoft Corporation (c) 2007.
Link Menu
This book is available now!
Buy at Amazon US or
Buy at Amazon UK
- Site.cs
- TranslateTransform.cs
- TextPatternIdentifiers.cs
- ResourcePropertyMemberCodeDomSerializer.cs
- SessionIDManager.cs
- TreeNodeEventArgs.cs
- List.cs
- DesignColumn.cs
- DataGridRowsPresenter.cs
- TextFormatter.cs
- NumberEdit.cs
- TextBreakpoint.cs
- MenuItemCollectionEditorDialog.cs
- DataSvcMapFileSerializer.cs
- HtmlHead.cs
- TokenBasedSetEnumerator.cs
- Executor.cs
- Vector3D.cs
- ProcessModelInfo.cs
- Odbc32.cs
- SoapAttributes.cs
- invalidudtexception.cs
- TextRunCache.cs
- IPAddress.cs
- AutomationFocusChangedEventArgs.cs
- CreateUserWizardStep.cs
- TextLineBreak.cs
- CodeDirectiveCollection.cs
- MetadataWorkspace.cs
- CompilerResults.cs
- FixedSOMContainer.cs
- Control.cs
- PeerNeighborManager.cs
- D3DImage.cs
- Signature.cs
- COM2ExtendedTypeConverter.cs
- SoapServerMethod.cs
- VisualTreeHelper.cs
- GroupItem.cs
- StringComparer.cs
- ConsoleKeyInfo.cs
- MetafileHeader.cs
- _LoggingObject.cs
- DocumentSchemaValidator.cs
- SqlCachedBuffer.cs
- XamlToRtfParser.cs
- CommonRemoteMemoryBlock.cs
- DynamicResourceExtensionConverter.cs
- GridItemCollection.cs
- HtmlInputButton.cs
- HealthMonitoringSectionHelper.cs
- WindowsToolbarItemAsMenuItem.cs
- KernelTypeValidation.cs
- ToolTip.cs
- UInt64.cs
- CounterCreationDataCollection.cs
- Stream.cs
- MinimizableAttributeTypeConverter.cs
- CollectionViewGroupInternal.cs
- EmbeddedMailObject.cs
- RuntimeTransactionHandle.cs
- UntypedNullExpression.cs
- XmlIlTypeHelper.cs
- DataGridViewCellErrorTextNeededEventArgs.cs
- DataFormat.cs
- AdCreatedEventArgs.cs
- NameScope.cs
- LayoutUtils.cs
- SqlDeflator.cs
- TabletCollection.cs
- XpsS0ValidatingLoader.cs
- XmlQueryCardinality.cs
- Operand.cs
- OdbcConnectionFactory.cs
- InputMethodStateTypeInfo.cs
- SqlParameter.cs
- TextSelectionHighlightLayer.cs
- coordinator.cs
- ProcessProtocolHandler.cs
- ReturnEventArgs.cs
- Events.cs
- UIElement3D.cs
- InputScope.cs
- DesignerDataRelationship.cs
- TabControlToolboxItem.cs
- XmlSerializationGeneratedCode.cs
- CompressEmulationStream.cs
- CanonicalFormWriter.cs
- OleDbRowUpdatedEvent.cs
- LoginView.cs
- TypeNameParser.cs
- PackagingUtilities.cs
- Inflater.cs
- ParallelSeparator.xaml.cs
- XmlSchemaSequence.cs
- TableRowGroup.cs
- NullableFloatMinMaxAggregationOperator.cs
- Parameter.cs
- ToolStrip.cs
- LogSwitch.cs