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
- AudioLevelUpdatedEventArgs.cs
- TransformerConfigurationWizardBase.cs
- HwndMouseInputProvider.cs
- TextRunProperties.cs
- SmtpFailedRecipientException.cs
- MimeFormReflector.cs
- StoragePropertyMapping.cs
- DesignSurface.cs
- SizeAnimation.cs
- TableRowCollection.cs
- PassportPrincipal.cs
- MergablePropertyAttribute.cs
- TrustSection.cs
- DataControlFieldHeaderCell.cs
- ETagAttribute.cs
- BindingsCollection.cs
- WindowsStartMenu.cs
- fixedPageContentExtractor.cs
- WaitHandle.cs
- ToolBarButtonClickEvent.cs
- DesignerView.Commands.cs
- HttpGetProtocolImporter.cs
- ObjectSecurityT.cs
- DbSetClause.cs
- ResourceManager.cs
- SByteConverter.cs
- SEHException.cs
- ItemCollectionEditor.cs
- BlobPersonalizationState.cs
- FontSource.cs
- ByteRangeDownloader.cs
- SqlBinder.cs
- XmlDictionaryReaderQuotas.cs
- mongolianshape.cs
- ToolStripSplitStackLayout.cs
- NavigationPropertyEmitter.cs
- NavigationService.cs
- CodeChecksumPragma.cs
- HtmlProps.cs
- MetadataArtifactLoaderCompositeFile.cs
- RestClientProxyHandler.cs
- MultiPartWriter.cs
- TableRowCollection.cs
- datacache.cs
- TraceUtils.cs
- Label.cs
- Simplifier.cs
- AnchoredBlock.cs
- CallbackValidatorAttribute.cs
- Keyboard.cs
- MapPathBasedVirtualPathProvider.cs
- ResXDataNode.cs
- TextEmbeddedObject.cs
- PageThemeBuildProvider.cs
- SliderAutomationPeer.cs
- relpropertyhelper.cs
- ArraySortHelper.cs
- DirectoryObjectSecurity.cs
- CounterCreationData.cs
- RegisteredHiddenField.cs
- DynamicILGenerator.cs
- GlobalizationSection.cs
- OdbcReferenceCollection.cs
- SimpleBitVector32.cs
- CategoryGridEntry.cs
- LogLogRecordHeader.cs
- SolidColorBrush.cs
- SchemaComplexType.cs
- LassoHelper.cs
- ScriptRegistrationManager.cs
- grammarelement.cs
- Int64Converter.cs
- MatrixTransform3D.cs
- Win32Interop.cs
- pingexception.cs
- SqlDataSourceStatusEventArgs.cs
- AdapterUtil.cs
- BitmapSizeOptions.cs
- ThreadAbortException.cs
- FixedSOMPageElement.cs
- CodeTypeDeclaration.cs
- CTreeGenerator.cs
- ServiceModelInstallComponent.cs
- WebUtility.cs
- JpegBitmapEncoder.cs
- SafeHandles.cs
- DataServiceEntityAttribute.cs
- DocumentViewerBase.cs
- ProcessThreadCollection.cs
- ExtensionSimplifierMarkupObject.cs
- StorageModelBuildProvider.cs
- ContainerUtilities.cs
- InvokeWebService.cs
- MouseWheelEventArgs.cs
- HashMembershipCondition.cs
- GraphicsState.cs
- HttpProfileBase.cs
- AnonymousIdentificationModule.cs
- XmlILModule.cs
- Activation.cs