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
- HttpCookie.cs
- DeviceContext2.cs
- ImpersonationContext.cs
- MULTI_QI.cs
- DependencyPropertyConverter.cs
- ContractReference.cs
- ServerValidateEventArgs.cs
- SchemaTableColumn.cs
- NavigatorInput.cs
- returneventsaver.cs
- InputMethod.cs
- Merger.cs
- SortDescriptionCollection.cs
- AsyncCompletedEventArgs.cs
- UnsignedPublishLicense.cs
- CollectionViewProxy.cs
- TrailingSpaceComparer.cs
- TextWriter.cs
- EntityRecordInfo.cs
- CodeDirectionExpression.cs
- SecurityState.cs
- ObjectPropertyMapping.cs
- StartUpEventArgs.cs
- QuotedPairReader.cs
- ALinqExpressionVisitor.cs
- ProfilePropertySettingsCollection.cs
- AggregateNode.cs
- NavigationHelper.cs
- RelationshipEnd.cs
- EndpointAddressAugust2004.cs
- BaseProcessor.cs
- VirtualizingStackPanel.cs
- UpDownBase.cs
- FullTrustAssembly.cs
- Stylesheet.cs
- FixUp.cs
- DataBoundControlActionList.cs
- ServiceContractDetailViewControl.cs
- Tablet.cs
- PenThreadPool.cs
- BinaryObjectWriter.cs
- FrameSecurityDescriptor.cs
- ToolBar.cs
- _OverlappedAsyncResult.cs
- MimeWriter.cs
- SelectedGridItemChangedEvent.cs
- ProjectionPruner.cs
- RawMouseInputReport.cs
- SequentialOutput.cs
- AliasGenerator.cs
- ViewService.cs
- ListBox.cs
- XamlFigureLengthSerializer.cs
- GenerateTemporaryTargetAssembly.cs
- ListView.cs
- UnmanagedMemoryStreamWrapper.cs
- WebPartDisplayModeEventArgs.cs
- ShimAsPublicXamlType.cs
- HtmlEmptyTagControlBuilder.cs
- FolderBrowserDialog.cs
- XmlWrappingReader.cs
- ConfigXmlAttribute.cs
- ListViewTableRow.cs
- SqlConnection.cs
- CommandBindingCollection.cs
- QilLiteral.cs
- NavigationProperty.cs
- ObjectDataSource.cs
- ToolZoneDesigner.cs
- Tokenizer.cs
- Stack.cs
- _SafeNetHandles.cs
- DataRowCollection.cs
- ContentPresenter.cs
- MenuTracker.cs
- PopupRoot.cs
- ObjectPropertyMapping.cs
- LogicalExpr.cs
- Hex.cs
- ValidationPropertyAttribute.cs
- SystemIcons.cs
- TransactionsSectionGroup.cs
- StickyNoteHelper.cs
- QuadraticBezierSegment.cs
- SerializationSectionGroup.cs
- FileEnumerator.cs
- ListMarkerSourceInfo.cs
- DisposableCollectionWrapper.cs
- MsmqHostedTransportManager.cs
- ActivityInterfaces.cs
- BaseCollection.cs
- FragmentNavigationEventArgs.cs
- WizardSideBarListControlItemEventArgs.cs
- WindowsSlider.cs
- NavigationFailedEventArgs.cs
- DesignerUtility.cs
- CodeEntryPointMethod.cs
- DragAssistanceManager.cs
- EncoderParameters.cs
- StyleReferenceConverter.cs