Code:
/ Net / Net / 3.5.50727.3053 / DEVDIV / depot / DevDiv / releases / whidbey / netfxsp / 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
- PagesSection.cs
- PictureBox.cs
- VerificationAttribute.cs
- DesignerForm.cs
- OracleCommand.cs
- TransactedBatchContext.cs
- SkewTransform.cs
- AdornerDecorator.cs
- CollectionChangeEventArgs.cs
- DiscoveryDocumentReference.cs
- XPathSelectionIterator.cs
- WebResourceAttribute.cs
- FocusChangedEventArgs.cs
- AssemblyBuilder.cs
- DecoderFallbackWithFailureFlag.cs
- ListViewDeleteEventArgs.cs
- SessionPageStatePersister.cs
- OutputScopeManager.cs
- IntersectQueryOperator.cs
- SeverityFilter.cs
- FixUp.cs
- CodePrimitiveExpression.cs
- AnimationException.cs
- LabelEditEvent.cs
- _IPv6Address.cs
- CultureSpecificStringDictionary.cs
- ListItemParagraph.cs
- SystemDiagnosticsSection.cs
- ImageAttributes.cs
- ContainerSelectorActiveEvent.cs
- LogSwitch.cs
- Rect3D.cs
- columnmapkeybuilder.cs
- PagesChangedEventArgs.cs
- TabControlCancelEvent.cs
- LogEntryHeaderDeserializer.cs
- DataBindingExpressionBuilder.cs
- SqlClientWrapperSmiStream.cs
- BaseConfigurationRecord.cs
- CodeEntryPointMethod.cs
- CharacterMetrics.cs
- SiteOfOriginContainer.cs
- Rotation3DAnimationBase.cs
- ClientApiGenerator.cs
- VirtualDirectoryMappingCollection.cs
- HttpCacheParams.cs
- PagerSettings.cs
- BinaryObjectWriter.cs
- ReadOnlyDictionary.cs
- EncryptedType.cs
- DateTimeOffsetConverter.cs
- TextRunCacheImp.cs
- HttpPostedFile.cs
- PriorityBinding.cs
- TextPatternIdentifiers.cs
- DataGridViewRowDividerDoubleClickEventArgs.cs
- TypeElement.cs
- RightNameExpirationInfoPair.cs
- documentsequencetextview.cs
- Pair.cs
- ColorConverter.cs
- ConfigurationSectionGroup.cs
- ThreadAbortException.cs
- ViewStateException.cs
- CaseStatementProjectedSlot.cs
- DetailsView.cs
- PermissionSetTriple.cs
- SdlChannelSink.cs
- DbDataRecord.cs
- MarkupCompilePass1.cs
- CatalogZoneAutoFormat.cs
- TreeNodeStyleCollection.cs
- CatalogZone.cs
- StreamResourceInfo.cs
- CompilerHelpers.cs
- EventLogEntry.cs
- CheckBoxDesigner.cs
- ColorTransformHelper.cs
- TextBox.cs
- PassportAuthenticationModule.cs
- TextTabProperties.cs
- ImageDrawing.cs
- ColumnWidthChangingEvent.cs
- UnionCqlBlock.cs
- ScrollProviderWrapper.cs
- precedingquery.cs
- XDeferredAxisSource.cs
- AuthenticatingEventArgs.cs
- DataGridViewCellConverter.cs
- MarkupCompiler.cs
- StandardToolWindows.cs
- XmlByteStreamWriter.cs
- ToolStripActionList.cs
- InteropAutomationProvider.cs
- SafeCertificateStore.cs
- PropertySourceInfo.cs
- RepeatButtonAutomationPeer.cs
- UpdatePanel.cs
- DocumentGridPage.cs
- SerializationObjectManager.cs