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
- StandardTransformFactory.cs
- AlignmentYValidation.cs
- SignatureHelper.cs
- MetadataCache.cs
- ButtonBaseAdapter.cs
- XmlEncodedRawTextWriter.cs
- ListChangedEventArgs.cs
- RelationshipEntry.cs
- ByteArrayHelperWithString.cs
- ToolStripDropDownClosedEventArgs.cs
- RegistrationServices.cs
- QuerySetOp.cs
- InstanceOwnerQueryResult.cs
- StructureChangedEventArgs.cs
- Size.cs
- TemplatePagerField.cs
- InvalidOleVariantTypeException.cs
- FixedSOMContainer.cs
- StrokeNodeData.cs
- LinearQuaternionKeyFrame.cs
- WindowsHyperlink.cs
- XPathScanner.cs
- StylusDownEventArgs.cs
- Stack.cs
- XmlUnspecifiedAttribute.cs
- Accessible.cs
- ListItemCollection.cs
- SpecularMaterial.cs
- XmlAttributeOverrides.cs
- MobileControlBuilder.cs
- DrawingContextWalker.cs
- GenericsNotImplementedException.cs
- OrderedDictionary.cs
- ComponentCache.cs
- FormClosedEvent.cs
- EastAsianLunisolarCalendar.cs
- MouseGestureConverter.cs
- ImageClickEventArgs.cs
- ClientSponsor.cs
- ReadOnlyDataSourceView.cs
- FunctionNode.cs
- DetailsViewRowCollection.cs
- DBConnectionString.cs
- XmlNodeList.cs
- ListViewInsertedEventArgs.cs
- MasterPageBuildProvider.cs
- ExtensionWindow.cs
- IBuiltInEvidence.cs
- StringFreezingAttribute.cs
- DecimalConstantAttribute.cs
- CommonGetThemePartSize.cs
- X509CertificateValidator.cs
- XmlIlGenerator.cs
- EmptyEnumerator.cs
- CheckBoxList.cs
- ParamArrayAttribute.cs
- TypeDependencyAttribute.cs
- NameValuePermission.cs
- ListControlStringCollectionEditor.cs
- TypeViewSchema.cs
- ApplicationFileCodeDomTreeGenerator.cs
- _SslStream.cs
- xmlfixedPageInfo.cs
- RenamedEventArgs.cs
- HttpFileCollection.cs
- ContainerCodeDomSerializer.cs
- ResourceDictionary.cs
- SoapElementAttribute.cs
- StdValidatorsAndConverters.cs
- DataObjectPastingEventArgs.cs
- XmlSchemaChoice.cs
- HitTestWithGeometryDrawingContextWalker.cs
- DateRangeEvent.cs
- DbDeleteCommandTree.cs
- TimeoutException.cs
- FontCacheLogic.cs
- RegexCode.cs
- PageMediaType.cs
- BamlMapTable.cs
- ComponentEvent.cs
- MarkupCompilePass2.cs
- LocalBuilder.cs
- log.cs
- TextElement.cs
- CompilerLocalReference.cs
- TextServicesCompartmentContext.cs
- AutomationTextAttribute.cs
- BamlResourceSerializer.cs
- GrammarBuilderWildcard.cs
- DataIdProcessor.cs
- CompensationExtension.cs
- PolicyManager.cs
- HwndHostAutomationPeer.cs
- Parser.cs
- Models.cs
- GCHandleCookieTable.cs
- CaseExpr.cs
- RequestQueue.cs
- TableProviderWrapper.cs
- RemoteWebConfigurationHostStream.cs