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
- WindowsRichEdit.cs
- IncrementalReadDecoders.cs
- DataGridCellsPresenter.cs
- DataGridParentRows.cs
- XslAst.cs
- LineMetrics.cs
- SqlEnums.cs
- ElementUtil.cs
- InvalidEnumArgumentException.cs
- EntitySqlQueryCacheKey.cs
- XmlNullResolver.cs
- ApplicationSettingsBase.cs
- ManagementException.cs
- RectangleHotSpot.cs
- XmlSecureResolver.cs
- PixelFormat.cs
- IdentityNotMappedException.cs
- PageSetupDialog.cs
- ServiceHostFactory.cs
- PerformanceCounterNameAttribute.cs
- XmlSchemaAnnotated.cs
- ExpressionConverter.cs
- EncodingInfo.cs
- Rect3D.cs
- _SslSessionsCache.cs
- CurrentChangedEventManager.cs
- CommunicationException.cs
- OSFeature.cs
- Encoding.cs
- ConfigurationValidatorAttribute.cs
- ProcessModule.cs
- ColumnResult.cs
- WebPartConnectionCollection.cs
- Options.cs
- Char.cs
- ITextView.cs
- NameValueConfigurationCollection.cs
- InkPresenter.cs
- X509Certificate2.cs
- RedirectionProxy.cs
- ReadOnlyDictionary.cs
- DockProviderWrapper.cs
- StaticResourceExtension.cs
- HostingPreferredMapPath.cs
- HandlerBase.cs
- HttpServerUtilityWrapper.cs
- DEREncoding.cs
- ValidationRule.cs
- XsdDateTime.cs
- RuleAction.cs
- DesignerSerializerAttribute.cs
- MsmqHostedTransportConfiguration.cs
- CodeMemberEvent.cs
- UIElement3D.cs
- ExpressionPrefixAttribute.cs
- BuildProvider.cs
- ValueUnavailableException.cs
- BindingBase.cs
- ValueConversionAttribute.cs
- ContentType.cs
- PerspectiveCamera.cs
- MouseBinding.cs
- Module.cs
- URLString.cs
- ImportDesigner.xaml.cs
- PropertyInformationCollection.cs
- Enlistment.cs
- MatrixAnimationUsingKeyFrames.cs
- SafeArrayRankMismatchException.cs
- DataGridView.cs
- StrokeNodeOperations.cs
- BindingExpressionUncommonField.cs
- GroupItem.cs
- TransformCollection.cs
- DesignerToolboxInfo.cs
- DataServiceProcessingPipelineEventArgs.cs
- TdsParserSafeHandles.cs
- AsyncPostBackErrorEventArgs.cs
- AdditionalEntityFunctions.cs
- SecurityToken.cs
- PostBackTrigger.cs
- SingleStorage.cs
- ConfigXmlDocument.cs
- JpegBitmapEncoder.cs
- CharEnumerator.cs
- StringStorage.cs
- NetworkInformationException.cs
- PhysicalOps.cs
- SafeFileMapViewHandle.cs
- TypedReference.cs
- MediaPlayerState.cs
- EncryptedData.cs
- X509Utils.cs
- SqlConnectionFactory.cs
- OdbcReferenceCollection.cs
- ListViewHitTestInfo.cs
- EncoderFallback.cs
- SoapIncludeAttribute.cs
- UnauthorizedWebPart.cs
- SecondaryIndex.cs