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
- RemotingConfigParser.cs
- RequestBringIntoViewEventArgs.cs
- DataServiceHost.cs
- Rule.cs
- SqlCacheDependencyDatabaseCollection.cs
- HttpPostedFile.cs
- ThreadStateException.cs
- TemplatingOptionsDialog.cs
- ImmutableObjectAttribute.cs
- FilteredDataSetHelper.cs
- Nullable.cs
- BlockingCollection.cs
- QueryCacheEntry.cs
- ValidationEventArgs.cs
- Nullable.cs
- XmlWriterSettings.cs
- Page.cs
- Matrix.cs
- MetadataPropertyCollection.cs
- SqlXmlStorage.cs
- TreeViewImageKeyConverter.cs
- WindowsPrincipal.cs
- MessageSecurityOverHttpElement.cs
- HealthMonitoringSection.cs
- WebUtility.cs
- SQLByte.cs
- TraceLevelHelper.cs
- mda.cs
- IdentifierService.cs
- XmlDataImplementation.cs
- ProfileServiceManager.cs
- AdjustableArrowCap.cs
- ItemPager.cs
- rsa.cs
- WmpBitmapDecoder.cs
- CodeCompiler.cs
- DiagnosticsConfigurationHandler.cs
- AsyncCodeActivityContext.cs
- XmlDictionaryReaderQuotasElement.cs
- XmlRootAttribute.cs
- TreeBuilderXamlTranslator.cs
- SiteOfOriginPart.cs
- DataRowChangeEvent.cs
- XmlQualifiedName.cs
- Int64AnimationBase.cs
- WebPartZoneCollection.cs
- ProxyGenerationError.cs
- QuaternionAnimationBase.cs
- LinearKeyFrames.cs
- SharedStatics.cs
- XmlAttribute.cs
- MsmqAppDomainProtocolHandler.cs
- CodeConstructor.cs
- Help.cs
- ISAPIRuntime.cs
- OverflowException.cs
- InteropBitmapSource.cs
- ObjectDisposedException.cs
- WebUtil.cs
- nulltextcontainer.cs
- BaseCodeDomTreeGenerator.cs
- User.cs
- securitycriticaldataformultiplegetandset.cs
- PropertyPathConverter.cs
- IdnMapping.cs
- TextComposition.cs
- ProcessHostServerConfig.cs
- SchemaLookupTable.cs
- DBNull.cs
- TableRowGroup.cs
- CalloutQueueItem.cs
- SpecularMaterial.cs
- BuildProvider.cs
- NegatedConstant.cs
- WSSecureConversationFeb2005.cs
- PerfCounters.cs
- ListViewCommandEventArgs.cs
- TypeReference.cs
- ActiveXHost.cs
- UriScheme.cs
- XPathDescendantIterator.cs
- PagedDataSource.cs
- SafeHandles.cs
- DerivedKeyCachingSecurityTokenSerializer.cs
- EnumerableCollectionView.cs
- Matrix3DValueSerializer.cs
- TreeBuilderBamlTranslator.cs
- AdornerDecorator.cs
- Mutex.cs
- TimeoutTimer.cs
- BitmapVisualManager.cs
- RuntimeCompatibilityAttribute.cs
- ObjectHandle.cs
- StylusPointPropertyUnit.cs
- Image.cs
- recordstate.cs
- SoapObjectWriter.cs
- SecurityContextTokenValidationException.cs
- PageSettings.cs
- IDQuery.cs