Code:
/ Dotnetfx_Vista_SP2 / Dotnetfx_Vista_SP2 / 8.0.50727.4016 / DEVDIV / depot / DevDiv / releases / whidbey / NetFxQFE / ndp / fx / src / XmlUtils / System / Xml / Xsl / XsltOld / ChooseAction.cs / 1 / ChooseAction.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 ChooseAction : ContainerAction { internal override void Compile(Compiler compiler) { CompileAttributes(compiler); if (compiler.Recurse()) { CompileConditions(compiler); compiler.ToParent(); } } private void CompileConditions(Compiler compiler) { NavigatorInput input = compiler.Input; bool when = false; bool otherwise = false; do { switch (input.NodeType) { case XPathNodeType.Element: compiler.PushNamespaceScope(); string nspace = input.NamespaceURI; string name = input.LocalName; if (Keywords.Equals(nspace, input.Atoms.XsltNamespace)) { IfAction action = null; if (Keywords.Equals(name, input.Atoms.When)) { if (otherwise) { throw XsltException.Create(Res.Xslt_WhenAfterOtherwise); } action = compiler.CreateIfAction(IfAction.ConditionType.ConditionWhen); when = true; } else if (Keywords.Equals(name, input.Atoms.Otherwise)) { if (otherwise) { throw XsltException.Create(Res.Xslt_DupOtherwise); } action = compiler.CreateIfAction(IfAction.ConditionType.ConditionOtherwise); otherwise = true; } else { throw compiler.UnexpectedKeyword(); } AddAction(action); } else { throw compiler.UnexpectedKeyword(); } compiler.PopScope(); break; case XPathNodeType.Comment: case XPathNodeType.ProcessingInstruction: case XPathNodeType.Whitespace: case XPathNodeType.SignificantWhitespace: break; default: throw XsltException.Create(Res.Xslt_InvalidContents, Keywords.s_Choose); } } while (compiler.Advance()); if (! when) { throw XsltException.Create(Res.Xslt_NoWhen); } } } } // 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 ChooseAction : ContainerAction { internal override void Compile(Compiler compiler) { CompileAttributes(compiler); if (compiler.Recurse()) { CompileConditions(compiler); compiler.ToParent(); } } private void CompileConditions(Compiler compiler) { NavigatorInput input = compiler.Input; bool when = false; bool otherwise = false; do { switch (input.NodeType) { case XPathNodeType.Element: compiler.PushNamespaceScope(); string nspace = input.NamespaceURI; string name = input.LocalName; if (Keywords.Equals(nspace, input.Atoms.XsltNamespace)) { IfAction action = null; if (Keywords.Equals(name, input.Atoms.When)) { if (otherwise) { throw XsltException.Create(Res.Xslt_WhenAfterOtherwise); } action = compiler.CreateIfAction(IfAction.ConditionType.ConditionWhen); when = true; } else if (Keywords.Equals(name, input.Atoms.Otherwise)) { if (otherwise) { throw XsltException.Create(Res.Xslt_DupOtherwise); } action = compiler.CreateIfAction(IfAction.ConditionType.ConditionOtherwise); otherwise = true; } else { throw compiler.UnexpectedKeyword(); } AddAction(action); } else { throw compiler.UnexpectedKeyword(); } compiler.PopScope(); break; case XPathNodeType.Comment: case XPathNodeType.ProcessingInstruction: case XPathNodeType.Whitespace: case XPathNodeType.SignificantWhitespace: break; default: throw XsltException.Create(Res.Xslt_InvalidContents, Keywords.s_Choose); } } while (compiler.Advance()); if (! when) { throw XsltException.Create(Res.Xslt_NoWhen); } } } } // 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
- ManagementOptions.cs
- GridEntryCollection.cs
- LostFocusEventManager.cs
- WmlPageAdapter.cs
- PersonalizableAttribute.cs
- ActivitySurrogateSelector.cs
- StoryFragments.cs
- UIElement3D.cs
- MethodBuilder.cs
- TreeViewImageIndexConverter.cs
- InkCollectionBehavior.cs
- EventBindingService.cs
- WorkflowEventArgs.cs
- TransmissionStrategy.cs
- HandlerBase.cs
- XmlSerializerAssemblyAttribute.cs
- XmlRawWriterWrapper.cs
- BaseUriHelper.cs
- RadialGradientBrush.cs
- GlobalizationAssembly.cs
- ImageConverter.cs
- HostingEnvironmentException.cs
- WorkItem.cs
- UpDownBase.cs
- WindowsSysHeader.cs
- DbBuffer.cs
- IsolatedStorageFileStream.cs
- ListItemParagraph.cs
- XmlException.cs
- OutOfProcStateClientManager.cs
- SelectingProviderEventArgs.cs
- TextFindEngine.cs
- MaterialGroup.cs
- LocalServiceSecuritySettings.cs
- RuntimeResourceSet.cs
- WorkflowInspectionServices.cs
- SmtpNtlmAuthenticationModule.cs
- CommandValueSerializer.cs
- XpsFontSubsetter.cs
- Int32RectConverter.cs
- MultiBinding.cs
- ListBase.cs
- MenuItem.cs
- BitmapEffect.cs
- ConversionContext.cs
- UserControlDocumentDesigner.cs
- ScopeCompiler.cs
- dtdvalidator.cs
- ScrollEvent.cs
- TempFiles.cs
- CardSpaceException.cs
- DataGridViewCellStyleChangedEventArgs.cs
- CopyNamespacesAction.cs
- MsmqIntegrationProcessProtocolHandler.cs
- ProviderUtil.cs
- OleDbError.cs
- SqlBinder.cs
- DesignerSerializerAttribute.cs
- XmlParserContext.cs
- FormsAuthenticationModule.cs
- DetailsViewRow.cs
- SafeThreadHandle.cs
- SourceFileBuildProvider.cs
- Visual3D.cs
- ZeroOpNode.cs
- ContextMenu.cs
- Identity.cs
- SecurityTokenProvider.cs
- TraceSection.cs
- ResourceWriter.cs
- ItemList.cs
- SecurityRuntime.cs
- ProfileProvider.cs
- SubqueryRules.cs
- BasicCellRelation.cs
- OrderPreservingPipeliningSpoolingTask.cs
- XmlQualifiedName.cs
- OrderingExpression.cs
- ColorAnimationBase.cs
- CodeTypeMember.cs
- JobStaple.cs
- StackSpiller.Generated.cs
- FileDataSourceCache.cs
- ToolZone.cs
- IgnoreDeviceFilterElement.cs
- RepeaterItemCollection.cs
- AutomationAttributeInfo.cs
- XPathNodeHelper.cs
- Int16Animation.cs
- TextStore.cs
- GAC.cs
- BlurBitmapEffect.cs
- SortDescriptionCollection.cs
- UITypeEditors.cs
- KeyGestureConverter.cs
- BufferBuilder.cs
- SafeBitVector32.cs
- X509ImageLogo.cs
- AbstractExpressions.cs
- ResourceExpressionEditor.cs