Code:
/ Dotnetfx_Win7_3.5.1 / Dotnetfx_Win7_3.5.1 / 3.5.1 / DEVDIV / depot / DevDiv / releases / whidbey / NetFXspW7 / 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
- RequestCacheManager.cs
- UIElementAutomationPeer.cs
- MethodToken.cs
- ScriptHandlerFactory.cs
- UrlMappingCollection.cs
- SqlSupersetValidator.cs
- FormatPage.cs
- OperationContractGenerationContext.cs
- FreezableOperations.cs
- DesignerHost.cs
- sitestring.cs
- wgx_commands.cs
- AncestorChangedEventArgs.cs
- CheckBoxAutomationPeer.cs
- HostingEnvironment.cs
- Soap.cs
- NumberSubstitution.cs
- MapPathBasedVirtualPathProvider.cs
- ColumnMapProcessor.cs
- future.cs
- GeneralTransform2DTo3DTo2D.cs
- ObjectItemAssemblyLoader.cs
- XmlArrayAttribute.cs
- CodeAttributeDeclarationCollection.cs
- Helpers.cs
- AspNetCacheProfileAttribute.cs
- TransformPattern.cs
- InitiatorSessionSymmetricTransportSecurityProtocol.cs
- ProfessionalColorTable.cs
- FontSourceCollection.cs
- loginstatus.cs
- MessageSmuggler.cs
- DynamicMethod.cs
- ConfigurationStrings.cs
- SmtpReplyReaderFactory.cs
- CqlParser.cs
- TraceContext.cs
- ListSourceHelper.cs
- ListControlBuilder.cs
- ButtonFieldBase.cs
- SessionStateContainer.cs
- COM2ICategorizePropertiesHandler.cs
- CodeTypeReferenceExpression.cs
- Profiler.cs
- RelOps.cs
- SHA384Cng.cs
- DebugHandleTracker.cs
- CrossContextChannel.cs
- ControlParameter.cs
- DbTransaction.cs
- HttpResponseWrapper.cs
- ProtectedConfigurationSection.cs
- MD5Cng.cs
- ScrollViewerAutomationPeer.cs
- XmlSchemaValidator.cs
- BatchServiceHost.cs
- CornerRadius.cs
- HttpListenerException.cs
- MsmqDecodeHelper.cs
- SkewTransform.cs
- XmlAttribute.cs
- IsolatedStorageFile.cs
- ActivitiesCollection.cs
- SortDescriptionCollection.cs
- MeshGeometry3D.cs
- AbandonedMutexException.cs
- DeclarativeCatalogPart.cs
- TimerEventSubscriptionCollection.cs
- ProvidePropertyAttribute.cs
- EmbeddedObject.cs
- RemoteWebConfigurationHostStream.cs
- GetPageNumberCompletedEventArgs.cs
- TypeUsageBuilder.cs
- MSAAEventDispatcher.cs
- SeverityFilter.cs
- ListChangedEventArgs.cs
- ActivityWithResultWrapper.cs
- GPPOINT.cs
- WebBrowserNavigatingEventHandler.cs
- InvariantComparer.cs
- TextFormatterHost.cs
- XmlSchemaSearchPattern.cs
- WebPartConnection.cs
- ProxyHelper.cs
- ScriptingJsonSerializationSection.cs
- CryptoApi.cs
- ToolStripProgressBar.cs
- NextPreviousPagerField.cs
- TypeLibConverter.cs
- RootCodeDomSerializer.cs
- DefaultTextStoreTextComposition.cs
- SequenceFullException.cs
- UnsafeNativeMethods.cs
- ImageFormat.cs
- ErrorActivity.cs
- ToolStripMenuItem.cs
- NullableConverter.cs
- InvokeGenerator.cs
- TriggerCollection.cs
- BulletedListDesigner.cs