Code:
/ Net / Net / 3.5.50727.3053 / DEVDIV / depot / DevDiv / releases / whidbey / netfxsp / ndp / fx / src / XmlUtils / System / Xml / Xsl / XsltOld / NameSpaceEvent.cs / 1 / NameSpaceEvent.cs
//------------------------------------------------------------------------------
//
// Copyright (c) Microsoft Corporation. All rights reserved.
//
// [....]
//-----------------------------------------------------------------------------
namespace System.Xml.Xsl.XsltOld {
using Res = System.Xml.Utils.Res;
using System;
using System.Diagnostics;
using System.Xml;
using System.Xml.XPath;
internal class NamespaceEvent : Event {
private string namespaceUri;
private string name;
public NamespaceEvent(NavigatorInput input) {
Debug.Assert(input != null);
Debug.Assert(input.NodeType == XPathNodeType.Namespace);
this.namespaceUri = input.Value;
this.name = input.LocalName;
}
public override void ReplaceNamespaceAlias(Compiler compiler){
if (this.namespaceUri.Length != 0) { // Do we need to check this for namespace?
NamespaceInfo ResultURIInfo = compiler.FindNamespaceAlias(this.namespaceUri);
if (ResultURIInfo != null) {
this.namespaceUri = ResultURIInfo.nameSpace;
if (ResultURIInfo.prefix != null) {
this.name = ResultURIInfo.prefix;
}
}
}
}
public override bool Output(Processor processor, ActionFrame frame) {
bool res;
res = processor.BeginEvent(XPathNodeType.Namespace, /*prefix:*/null, this.name, this.namespaceUri, /*empty:*/false);
Debug.Assert(res); // Namespace node as any other attribute can't fail because it doesn't signal record change
res = processor.EndEvent(XPathNodeType.Namespace);
Debug.Assert(res);
return true;
}
}
}
// File provided for Reference Use Only by Microsoft Corporation (c) 2007.
//------------------------------------------------------------------------------
//
// Copyright (c) Microsoft Corporation. All rights reserved.
//
// [....]
//-----------------------------------------------------------------------------
namespace System.Xml.Xsl.XsltOld {
using Res = System.Xml.Utils.Res;
using System;
using System.Diagnostics;
using System.Xml;
using System.Xml.XPath;
internal class NamespaceEvent : Event {
private string namespaceUri;
private string name;
public NamespaceEvent(NavigatorInput input) {
Debug.Assert(input != null);
Debug.Assert(input.NodeType == XPathNodeType.Namespace);
this.namespaceUri = input.Value;
this.name = input.LocalName;
}
public override void ReplaceNamespaceAlias(Compiler compiler){
if (this.namespaceUri.Length != 0) { // Do we need to check this for namespace?
NamespaceInfo ResultURIInfo = compiler.FindNamespaceAlias(this.namespaceUri);
if (ResultURIInfo != null) {
this.namespaceUri = ResultURIInfo.nameSpace;
if (ResultURIInfo.prefix != null) {
this.name = ResultURIInfo.prefix;
}
}
}
}
public override bool Output(Processor processor, ActionFrame frame) {
bool res;
res = processor.BeginEvent(XPathNodeType.Namespace, /*prefix:*/null, this.name, this.namespaceUri, /*empty:*/false);
Debug.Assert(res); // Namespace node as any other attribute can't fail because it doesn't signal record change
res = processor.EndEvent(XPathNodeType.Namespace);
Debug.Assert(res);
return true;
}
}
}
// 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
- ColorContextHelper.cs
- WebPartDescriptionCollection.cs
- ConfigurationFileMap.cs
- HijriCalendar.cs
- WmpBitmapEncoder.cs
- FixedHyperLink.cs
- DataMisalignedException.cs
- RichTextBoxAutomationPeer.cs
- BindingCompleteEventArgs.cs
- ZipIOLocalFileBlock.cs
- ReadOnlyHierarchicalDataSourceView.cs
- BinarySerializer.cs
- X509AudioLogo.cs
- LateBoundBitmapDecoder.cs
- ProtocolsConfiguration.cs
- WebPartRestoreVerb.cs
- PageCache.cs
- HighlightComponent.cs
- XhtmlConformanceSection.cs
- DocumentViewer.cs
- DocumentGrid.cs
- PartDesigner.cs
- CompiledXpathExpr.cs
- Command.cs
- CollectionChange.cs
- DbBuffer.cs
- RemoveStoryboard.cs
- CheckBoxList.cs
- InstanceDataCollection.cs
- EnvironmentPermission.cs
- HandoffBehavior.cs
- InkCanvas.cs
- ComContractElement.cs
- ScrollEvent.cs
- RightsController.cs
- MetadataArtifactLoaderResource.cs
- CodeNamespaceImport.cs
- XmlQueryOutput.cs
- WSSecurityOneDotZeroReceiveSecurityHeader.cs
- HtmlElementErrorEventArgs.cs
- ButtonColumn.cs
- PreviewPrintController.cs
- XhtmlBasicLiteralTextAdapter.cs
- RectAnimation.cs
- SqlInfoMessageEvent.cs
- IndicCharClassifier.cs
- BaseComponentEditor.cs
- AmbientProperties.cs
- KeySpline.cs
- EvidenceBase.cs
- WebConvert.cs
- RenderData.cs
- RegisteredArrayDeclaration.cs
- HttpCacheVary.cs
- WebControl.cs
- DefinitionBase.cs
- XmlBindingWorker.cs
- SafeBitVector32.cs
- TextRunCacheImp.cs
- XmlWriterTraceListener.cs
- pingexception.cs
- DataContractSerializerSection.cs
- nulltextcontainer.cs
- SuppressIldasmAttribute.cs
- XmlSchemaSimpleContentExtension.cs
- EventLogReader.cs
- FillErrorEventArgs.cs
- NativeMethods.cs
- ToolStripDropDownClosingEventArgs.cs
- SqlCacheDependency.cs
- InputScope.cs
- TaskFileService.cs
- DetailsView.cs
- Types.cs
- TreeNodeMouseHoverEvent.cs
- Stack.cs
- WinCategoryAttribute.cs
- TargetControlTypeAttribute.cs
- PolyBezierSegment.cs
- RelationshipNavigation.cs
- ParameterElement.cs
- MenuCommand.cs
- cookiecollection.cs
- XmlBindingWorker.cs
- SchemaAttDef.cs
- ExpressionBindingCollection.cs
- WinFormsComponentEditor.cs
- TableAutomationPeer.cs
- UnsafeNativeMethods.cs
- SecurityBindingElement.cs
- HtmlTable.cs
- HttpProfileBase.cs
- DataGridViewAddColumnDialog.cs
- InvokeMemberBinder.cs
- CapabilitiesSection.cs
- HistoryEventArgs.cs
- BookmarkManager.cs
- RuleAction.cs
- Size3DConverter.cs
- Pair.cs