Code:
/ 4.0 / 4.0 / 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. //------------------------------------------------------------------------------ //// 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
- AdapterUtil.cs
- TrackingAnnotationCollection.cs
- TypeBrowserDialog.cs
- HtmlProps.cs
- SqlFileStream.cs
- OracleBinary.cs
- StateMachine.cs
- TranslateTransform3D.cs
- AppDomainGrammarProxy.cs
- CallContext.cs
- RepeatBehavior.cs
- XmlLinkedNode.cs
- ToolStripSystemRenderer.cs
- NumberSubstitution.cs
- Relationship.cs
- ActivityMarkupSerializationProvider.cs
- SystemInfo.cs
- HMACMD5.cs
- path.cs
- WMICapabilities.cs
- NestedContainer.cs
- WindowVisualStateTracker.cs
- ClickablePoint.cs
- TimelineGroup.cs
- CompilerInfo.cs
- HttpWebRequest.cs
- Facet.cs
- ClientFormsIdentity.cs
- DataGridViewCellValidatingEventArgs.cs
- WebConfigurationHostFileChange.cs
- TouchDevice.cs
- MatrixKeyFrameCollection.cs
- XPathSelfQuery.cs
- MsmqNonTransactedPoisonHandler.cs
- TaskFactory.cs
- XmlHelper.cs
- ClientRolePrincipal.cs
- HybridDictionary.cs
- WeakRefEnumerator.cs
- PositiveTimeSpanValidator.cs
- FlatButtonAppearance.cs
- ActivityExecutorSurrogate.cs
- ExitEventArgs.cs
- Attributes.cs
- ConnectionsZoneDesigner.cs
- ObjectHelper.cs
- DetailsViewCommandEventArgs.cs
- ChtmlCalendarAdapter.cs
- SqlNodeTypeOperators.cs
- ListViewCancelEventArgs.cs
- BitStream.cs
- MobileUserControl.cs
- AssemblyBuilderData.cs
- OperandQuery.cs
- FamilyMapCollection.cs
- TargetParameterCountException.cs
- DeferredSelectedIndexReference.cs
- SafeEventHandle.cs
- BigInt.cs
- RemotingServices.cs
- CssStyleCollection.cs
- OracleCommand.cs
- SynchronizationValidator.cs
- ListDictionaryInternal.cs
- ToolboxBitmapAttribute.cs
- Zone.cs
- PolygonHotSpot.cs
- RequestCachingSection.cs
- DataTableNameHandler.cs
- ColorConvertedBitmap.cs
- ZipIOCentralDirectoryDigitalSignature.cs
- DataTableTypeConverter.cs
- AsymmetricAlgorithm.cs
- ToolStripContentPanel.cs
- HtmlString.cs
- TextStore.cs
- EdmType.cs
- HMACSHA384.cs
- Column.cs
- ValidationRule.cs
- FlowDocumentFormatter.cs
- XmlSchemaSimpleContentExtension.cs
- StaticResourceExtension.cs
- AspNetRouteServiceHttpHandler.cs
- SafeSecurityHandles.cs
- BuiltInPermissionSets.cs
- ButtonRenderer.cs
- TextEditorTyping.cs
- Subtree.cs
- EventsTab.cs
- DataGridItemAutomationPeer.cs
- RepeatButton.cs
- EdmItemCollection.cs
- BufferAllocator.cs
- cookiecollection.cs
- SqlClientPermission.cs
- TextSyndicationContent.cs
- PopOutPanel.cs
- SamlAssertionKeyIdentifierClause.cs
- GregorianCalendar.cs