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
- WebPartHeaderCloseVerb.cs
- MessageBuilder.cs
- PersistChildrenAttribute.cs
- PointValueSerializer.cs
- Switch.cs
- MetadataItemEmitter.cs
- DataViewSetting.cs
- ExtendedProperty.cs
- ToolStripScrollButton.cs
- ReflectTypeDescriptionProvider.cs
- DoubleCollectionConverter.cs
- MultipartContentParser.cs
- TrackingExtract.cs
- StrokeNodeOperations.cs
- ProcessHostConfigUtils.cs
- CodeSubDirectoriesCollection.cs
- SingleObjectCollection.cs
- RecipientInfo.cs
- TextTreeTextBlock.cs
- WindowsImpersonationContext.cs
- AnnotationAdorner.cs
- ColorTransform.cs
- RuleConditionDialog.cs
- ScrollBar.cs
- RectangleGeometry.cs
- CacheAxisQuery.cs
- SqlDataSourceQueryEditor.cs
- Baml2006ReaderContext.cs
- DateTimeUtil.cs
- ShaderEffect.cs
- SqlInternalConnectionSmi.cs
- DataSourceControl.cs
- BinaryNode.cs
- RepeaterDataBoundAdapter.cs
- propertytag.cs
- HostingEnvironmentException.cs
- RuntimeConfig.cs
- PackagePart.cs
- _ShellExpression.cs
- ResourceManager.cs
- CompletedAsyncResult.cs
- CustomWebEventKey.cs
- XmlSiteMapProvider.cs
- AudioStateChangedEventArgs.cs
- cryptoapiTransform.cs
- ScaleTransform.cs
- XmlFileEditor.cs
- OleDbCommandBuilder.cs
- FormViewModeEventArgs.cs
- DependencyPropertyValueSerializer.cs
- AspProxy.cs
- ComplexTypeEmitter.cs
- PrintDialogDesigner.cs
- UnionExpr.cs
- Wildcard.cs
- WebPartUtil.cs
- TypeTypeConverter.cs
- GenericIdentity.cs
- DataMemberConverter.cs
- HttpResponse.cs
- Symbol.cs
- CurrentTimeZone.cs
- CombinedGeometry.cs
- ISFTagAndGuidCache.cs
- NonVisualControlAttribute.cs
- ImmutableObjectAttribute.cs
- FindCriteria11.cs
- Types.cs
- NetStream.cs
- Substitution.cs
- NavigationHelper.cs
- StreamAsIStream.cs
- CharAnimationBase.cs
- XmlAttributeCollection.cs
- SimpleHandlerFactory.cs
- XmlNodeList.cs
- ContentDesigner.cs
- ItemCollection.cs
- _CacheStreams.cs
- WebPartCloseVerb.cs
- CompilationRelaxations.cs
- HttpCapabilitiesEvaluator.cs
- LocalIdKeyIdentifierClause.cs
- XmlMtomReader.cs
- PeerResolverMode.cs
- DelegatingTypeDescriptionProvider.cs
- DataComponentGenerator.cs
- AnnotationHelper.cs
- SiteMembershipCondition.cs
- DataSourceXmlClassAttribute.cs
- AssociationTypeEmitter.cs
- BuiltInExpr.cs
- CultureSpecificStringDictionary.cs
- AstNode.cs
- ApplicationServiceManager.cs
- coordinatorfactory.cs
- XmlCharCheckingReader.cs
- LogReservationCollection.cs
- MetadataArtifactLoaderXmlReaderWrapper.cs
- CheckBoxField.cs