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
- SecurityManager.cs
- UInt16Storage.cs
- PointIndependentAnimationStorage.cs
- CursorInteropHelper.cs
- RightsDocument.cs
- CacheSection.cs
- XmlLangPropertyAttribute.cs
- LogManagementAsyncResult.cs
- TransactionWaitAsyncResult.cs
- MetadataFile.cs
- IPipelineRuntime.cs
- SupportedAddressingMode.cs
- HtmlInputCheckBox.cs
- XmlObjectSerializerReadContextComplex.cs
- SchemaNames.cs
- ClientData.cs
- TemplateColumn.cs
- DbConnectionPoolOptions.cs
- MemoryFailPoint.cs
- NativeMethods.cs
- GlyphsSerializer.cs
- ObjectStateFormatter.cs
- CompositeControl.cs
- DateBoldEvent.cs
- PropertyKey.cs
- SqlLiftWhereClauses.cs
- ListControl.cs
- SqlRetyper.cs
- Vector3DConverter.cs
- AxisAngleRotation3D.cs
- CommandManager.cs
- AnonymousIdentificationModule.cs
- ToggleProviderWrapper.cs
- login.cs
- CrossSiteScriptingValidation.cs
- ManipulationLogic.cs
- FormViewRow.cs
- XsltLoader.cs
- SiteMembershipCondition.cs
- DbConnectionPool.cs
- Message.cs
- RuntimeHelpers.cs
- XmlSiteMapProvider.cs
- OracleTimeSpan.cs
- DeflateStream.cs
- CompoundFileStreamReference.cs
- IApplicationTrustManager.cs
- WindowsClaimSet.cs
- PathStreamGeometryContext.cs
- SiteMap.cs
- SmiSettersStream.cs
- AdditionalEntityFunctions.cs
- X509CertificateRecipientClientCredential.cs
- GridViewColumnHeader.cs
- MemberDomainMap.cs
- HostProtectionPermission.cs
- AutomationProperty.cs
- Symbol.cs
- SafeCoTaskMem.cs
- AttributeTableBuilder.cs
- ReferenceAssemblyAttribute.cs
- CopyNodeSetAction.cs
- ObjectFullSpanRewriter.cs
- StatusBarItem.cs
- DrawingGroupDrawingContext.cs
- WebPartEditVerb.cs
- HostProtectionException.cs
- MatrixStack.cs
- IdnMapping.cs
- PropertyGeneratedEventArgs.cs
- COM2ColorConverter.cs
- Assembly.cs
- TransactionChannel.cs
- Utils.cs
- XmlWriterTraceListener.cs
- SqlDataSourceQueryConverter.cs
- EntityWithKeyStrategy.cs
- RadioButton.cs
- WaitHandleCannotBeOpenedException.cs
- Parallel.cs
- TabRenderer.cs
- DataGridViewColumnStateChangedEventArgs.cs
- TitleStyle.cs
- KeyConverter.cs
- XmlSchemaSet.cs
- ColumnResizeAdorner.cs
- NativeBuffer.cs
- FrameworkContextData.cs
- WhitespaceSignificantCollectionAttribute.cs
- HtmlForm.cs
- ConstructorBuilder.cs
- SplitterPanelDesigner.cs
- ProcessModelInfo.cs
- CharAnimationBase.cs
- KeyGesture.cs
- CultureInfo.cs
- GZipStream.cs
- CommonGetThemePartSize.cs
- ProjectionCamera.cs
- COM2ExtendedUITypeEditor.cs