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
- MergeLocalizationDirectives.cs
- FontFamily.cs
- DynamicValueConverter.cs
- RelOps.cs
- XmlSerializerFactory.cs
- Material.cs
- MenuItem.cs
- Effect.cs
- ExtenderProvidedPropertyAttribute.cs
- XmlTypeAttribute.cs
- FontSourceCollection.cs
- SqlServices.cs
- _NetRes.cs
- isolationinterop.cs
- DataGridViewBindingCompleteEventArgs.cs
- EntityParameterCollection.cs
- BaseAsyncResult.cs
- EtwProvider.cs
- MetaData.cs
- ServiceRouteHandler.cs
- TcpProcessProtocolHandler.cs
- FloaterParagraph.cs
- XmlSchemaSimpleContentExtension.cs
- FileDialog.cs
- ClaimComparer.cs
- ToolStripOverflow.cs
- StateValidator.cs
- OdbcHandle.cs
- FormViewUpdateEventArgs.cs
- initElementDictionary.cs
- TextFormatterContext.cs
- WebPartsPersonalizationAuthorization.cs
- MembershipUser.cs
- ElementMarkupObject.cs
- ButtonField.cs
- GridViewSelectEventArgs.cs
- Image.cs
- RouteParameter.cs
- ParallelEnumerableWrapper.cs
- Task.cs
- PipeStream.cs
- FixUp.cs
- EntityDesignerDataSourceView.cs
- DefinitionUpdate.cs
- BuildProvider.cs
- BitVector32.cs
- InvalidFilterCriteriaException.cs
- SqlUdtInfo.cs
- RegexTree.cs
- ToolTipService.cs
- ToolStripItemClickedEventArgs.cs
- EmbeddedMailObject.cs
- DataStorage.cs
- ColorConverter.cs
- MasterPageCodeDomTreeGenerator.cs
- LineInfo.cs
- AliasExpr.cs
- DataGridViewCheckBoxColumn.cs
- Delegate.cs
- JoinTreeSlot.cs
- PropertyValueUIItem.cs
- SecurityTokenValidationException.cs
- DataGridBoolColumn.cs
- GeneratedContractType.cs
- HwndHost.cs
- TextTreeUndo.cs
- Debug.cs
- Fx.cs
- Win32MouseDevice.cs
- CacheChildrenQuery.cs
- WebPartDescriptionCollection.cs
- ThrowHelper.cs
- RbTree.cs
- DataControlLinkButton.cs
- SecUtil.cs
- UIPermission.cs
- SystemWebExtensionsSectionGroup.cs
- ShellProvider.cs
- Profiler.cs
- TypeGeneratedEventArgs.cs
- CustomPopupPlacement.cs
- CheckBoxField.cs
- PeerCollaborationPermission.cs
- FloatSumAggregationOperator.cs
- RepeaterItemEventArgs.cs
- SelectionEditor.cs
- WebPartConnection.cs
- StaticFileHandler.cs
- RC2.cs
- RotateTransform3D.cs
- ObjectStateFormatter.cs
- ThemeDirectoryCompiler.cs
- Storyboard.cs
- WindowsListViewItemCheckBox.cs
- RepeaterItemCollection.cs
- UmAlQuraCalendar.cs
- CurrentTimeZone.cs
- CodeGroup.cs
- TripleDES.cs
- TextDpi.cs