Code:
/ 4.0 / 4.0 / untmp / DEVDIV_TFS / Dev10 / Releases / RTMRel / ndp / fx / src / XmlUtils / System / Xml / Xsl / XsltOld / ChooseAction.cs / 1305376 / 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 (Ref.Equal(nspace, input.Atoms.UriXsl)) { IfAction action = null; if (Ref.Equal(name, input.Atoms.When)) { if (otherwise) { throw XsltException.Create(Res.Xslt_WhenAfterOtherwise); } action = compiler.CreateIfAction(IfAction.ConditionType.ConditionWhen); when = true; } else if (Ref.Equal(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, "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
- SslStream.cs
- MeshGeometry3D.cs
- AuthenticateEventArgs.cs
- precedingquery.cs
- CompositeScriptReference.cs
- ValidationSummary.cs
- TableLayoutSettings.cs
- ImageKeyConverter.cs
- HtmlInputText.cs
- AsyncOperationManager.cs
- Crc32Helper.cs
- StringBuilder.cs
- Compiler.cs
- SQLSingle.cs
- codemethodreferenceexpression.cs
- UncommonField.cs
- WindowsStatusBar.cs
- XmlSchemaNotation.cs
- ScalarRestriction.cs
- ImageListStreamer.cs
- PerspectiveCamera.cs
- ArraySet.cs
- GiveFeedbackEvent.cs
- SnapLine.cs
- NameValueSectionHandler.cs
- PerformanceCounterCategory.cs
- Form.cs
- BeginStoryboard.cs
- ListBoxDesigner.cs
- ValueOfAction.cs
- DefaultPerformanceCounters.cs
- RetrieveVirtualItemEventArgs.cs
- LifetimeServices.cs
- OneOfConst.cs
- mda.cs
- UnitControl.cs
- TraceHandler.cs
- XsdValidatingReader.cs
- ViewManager.cs
- ObjectTag.cs
- RoleService.cs
- ProxyFragment.cs
- WebSysDescriptionAttribute.cs
- CharacterBuffer.cs
- ObjectDataProvider.cs
- LayoutTableCell.cs
- NetworkAddressChange.cs
- SystemColors.cs
- MetadataItemSerializer.cs
- ObjectHandle.cs
- XmlNamespaceMappingCollection.cs
- TableLayoutCellPaintEventArgs.cs
- PropertyPathWorker.cs
- SystemIPv6InterfaceProperties.cs
- DBBindings.cs
- TableAdapterManagerGenerator.cs
- DelegateTypeInfo.cs
- PerspectiveCamera.cs
- SingleResultAttribute.cs
- FormatterServicesNoSerializableCheck.cs
- TdsEnums.cs
- CodeTypeReferenceSerializer.cs
- PointHitTestParameters.cs
- RoleManagerEventArgs.cs
- XamlWriter.cs
- XmlSchemaGroupRef.cs
- UIElementParaClient.cs
- Assert.cs
- TripleDESCryptoServiceProvider.cs
- ColorContext.cs
- MexBindingBindingCollectionElement.cs
- Cursor.cs
- Int32Converter.cs
- IsolatedStoragePermission.cs
- Base64WriteStateInfo.cs
- DbMetaDataFactory.cs
- Decimal.cs
- SqlTrackingService.cs
- DataSourceSelectArguments.cs
- CommandHelper.cs
- TextDecorationCollection.cs
- ObjectDataSourceMethodEditor.cs
- ProcessMessagesAsyncResult.cs
- BlurBitmapEffect.cs
- CodeMethodInvokeExpression.cs
- RuleSetCollection.cs
- CounterSet.cs
- ImageButton.cs
- ActivityCodeGenerator.cs
- WebPartManager.cs
- InkCanvasInnerCanvas.cs
- UnsafeNativeMethods.cs
- ExpressionList.cs
- IxmlLineInfo.cs
- EdgeProfileValidation.cs
- EnumerableValidator.cs
- QueryIntervalOp.cs
- IsolationInterop.cs
- WorkerRequest.cs
- UnauthorizedAccessException.cs