Code:
/ DotNET / DotNET / 8.0 / untmp / whidbey / REDBITS / ndp / fx / src / Xml / System / Xml / schema / SchemaNamespaceManager.cs / 1 / SchemaNamespaceManager.cs
//------------------------------------------------------------------------------ //// Copyright (c) Microsoft Corporation. All rights reserved. // //[....] //----------------------------------------------------------------------------- namespace System.Xml.Schema { using System; using System.Diagnostics; using System.Collections; internal class SchemaNamespaceManager : XmlNamespaceManager { XmlSchemaObject node; public SchemaNamespaceManager(XmlSchemaObject node) { this.node = node; } public override string LookupNamespace(string prefix) { if (prefix == "xml") { //Special case for the XML namespace return XmlReservedNs.NsXml; } Hashtable namespaces; for (XmlSchemaObject current = node; current != null; current = current.Parent) { namespaces = current.Namespaces.Namespaces; if (namespaces != null && namespaces.Count > 0) { object uri = namespaces[prefix]; if (uri != null) return (string)uri; } } return prefix.Length == 0 ? string.Empty : null; } public override string LookupPrefix(string ns) { if (ns == XmlReservedNs.NsXml) { //Special case for the XML namespace return "xml"; } Hashtable namespaces; for (XmlSchemaObject current = node; current != null; current = current.Parent) { namespaces = current.Namespaces.Namespaces; if (namespaces != null && namespaces.Count > 0) { foreach(DictionaryEntry entry in namespaces) { if (entry.Value.Equals(ns)) { return (string)entry.Key; } } } } return null; } }; //SchemaNamespaceManager } // File provided for Reference Use Only by Microsoft Corporation (c) 2007. // Copyright (c) Microsoft Corporation. All rights reserved.
Link Menu
This book is available now!
Buy at Amazon US or
Buy at Amazon UK
- XmlQueryOutput.cs
- ContentValidator.cs
- ManagementScope.cs
- DriveInfo.cs
- CustomCredentialPolicy.cs
- AssertFilter.cs
- SqlDataSourceEnumerator.cs
- StaticExtensionConverter.cs
- Hex.cs
- ProxyGenerationError.cs
- SqlDataReader.cs
- DBConcurrencyException.cs
- BitmapFrame.cs
- SystemIcmpV4Statistics.cs
- IsolatedStorageFile.cs
- TimeSpanConverter.cs
- EventLogEntry.cs
- ReadWriteObjectLock.cs
- ChildDocumentBlock.cs
- XmlStringTable.cs
- IncrementalHitTester.cs
- CacheMemory.cs
- Model3D.cs
- TableRowGroupCollection.cs
- Propagator.ExtentPlaceholderCreator.cs
- _ConnectionGroup.cs
- StructuredTypeEmitter.cs
- BindingExpressionUncommonField.cs
- MembershipSection.cs
- ConfigXmlComment.cs
- ToolStripDropDown.cs
- DocumentOutline.cs
- XmlMtomReader.cs
- DataKeyCollection.cs
- itemelement.cs
- SqlInfoMessageEvent.cs
- ChildDocumentBlock.cs
- ConsumerConnectionPointCollection.cs
- ControlHelper.cs
- TreeViewImageIndexConverter.cs
- _ConnectionGroup.cs
- Int64AnimationBase.cs
- StatusBar.cs
- ConfigXmlText.cs
- NavigateEvent.cs
- NetDataContractSerializer.cs
- DataProtection.cs
- HtmlControl.cs
- CodeArgumentReferenceExpression.cs
- DbInsertCommandTree.cs
- SynchronizationLockException.cs
- HttpCookie.cs
- ComPlusContractBehavior.cs
- EpmContentDeSerializer.cs
- ValidateNames.cs
- VisualStyleRenderer.cs
- OleDbPermission.cs
- SignatureHelper.cs
- Transform3DGroup.cs
- TextElementAutomationPeer.cs
- KeyPressEvent.cs
- SecurityTokenRequirement.cs
- HtmlContainerControl.cs
- SHA256Managed.cs
- ISFClipboardData.cs
- TextSpan.cs
- FrameworkTextComposition.cs
- BufferedGraphics.cs
- TextParagraphProperties.cs
- XmlWhitespace.cs
- XmlUtilWriter.cs
- figurelength.cs
- WindowsStartMenu.cs
- EnumConverter.cs
- AutoResizedEvent.cs
- PixelFormats.cs
- PreProcessor.cs
- ImageListImage.cs
- CancelEventArgs.cs
- AutoGeneratedField.cs
- EntityWithChangeTrackerStrategy.cs
- SecureEnvironment.cs
- WindowsGraphics2.cs
- HttpModulesSection.cs
- DoubleAnimationClockResource.cs
- Transactions.cs
- IdentifierElement.cs
- DataGridViewMethods.cs
- FullTextLine.cs
- XPathAncestorQuery.cs
- TCEAdapterGenerator.cs
- Int64Converter.cs
- SqlNotificationRequest.cs
- MembershipUser.cs
- StructuredProperty.cs
- WorkflowOperationAsyncResult.cs
- QuarticEase.cs
- VerbConverter.cs
- AccessDataSource.cs
- OutputCacheSection.cs