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
- UnsignedPublishLicense.cs
- Image.cs
- PathFigureCollectionValueSerializer.cs
- WebPartZoneDesigner.cs
- DataBindingCollection.cs
- X509Certificate.cs
- TypeElementCollection.cs
- GeneralTransform3DCollection.cs
- CorrelationInitializer.cs
- ColorEditor.cs
- ExpandCollapsePattern.cs
- QueryStringParameter.cs
- HtmlImage.cs
- StringBuilder.cs
- XPathParser.cs
- D3DImage.cs
- WebConfigManager.cs
- RelatedCurrencyManager.cs
- TextBlockAutomationPeer.cs
- FrameAutomationPeer.cs
- SchemaImporterExtension.cs
- compensatingcollection.cs
- PositiveTimeSpanValidator.cs
- SmtpDateTime.cs
- TokenFactoryFactory.cs
- Unit.cs
- ObjectPersistData.cs
- BaseServiceProvider.cs
- PropertyDescriptorComparer.cs
- HtmlInputSubmit.cs
- ComboBox.cs
- TemplateBindingExtension.cs
- DBNull.cs
- ShaperBuffers.cs
- LayoutManager.cs
- ManagementQuery.cs
- BaseParagraph.cs
- ConfigXmlCDataSection.cs
- LockedBorderGlyph.cs
- ConfigXmlComment.cs
- ChainOfResponsibility.cs
- ISO2022Encoding.cs
- DriveInfo.cs
- DataGridViewColumnTypeEditor.cs
- ValueConversionAttribute.cs
- PlatformNotSupportedException.cs
- XPathSelectionIterator.cs
- EditorResources.cs
- _NegoState.cs
- DataGridBeginningEditEventArgs.cs
- NamedPipeDuplicateContext.cs
- Helpers.cs
- SqlConnectionPoolProviderInfo.cs
- IdentitySection.cs
- DbMetaDataColumnNames.cs
- MexNamedPipeBindingCollectionElement.cs
- LoginView.cs
- MetadataArtifactLoaderXmlReaderWrapper.cs
- SqlCharStream.cs
- TraceSwitch.cs
- nulltextcontainer.cs
- PointCollection.cs
- FontEmbeddingManager.cs
- OpenTypeCommon.cs
- ContractNamespaceAttribute.cs
- DataFormats.cs
- UnsafeNativeMethods.cs
- PassportPrincipal.cs
- DesignColumn.cs
- versioninfo.cs
- DataObjectCopyingEventArgs.cs
- ScriptResourceDefinition.cs
- PackageRelationshipCollection.cs
- WebPartMenu.cs
- InertiaRotationBehavior.cs
- ipaddressinformationcollection.cs
- SiteIdentityPermission.cs
- DrawingContextWalker.cs
- EpmSyndicationContentDeSerializer.cs
- MemberDescriptor.cs
- SoapCodeExporter.cs
- ActivityCodeDomSerializer.cs
- ConditionValidator.cs
- StringResourceManager.cs
- querybuilder.cs
- ObjectStateEntryDbUpdatableDataRecord.cs
- StandardMenuStripVerb.cs
- BuiltInExpr.cs
- FlagsAttribute.cs
- EntityContainerEmitter.cs
- ListControl.cs
- COM2Properties.cs
- unsafenativemethodsother.cs
- DockPattern.cs
- ResolveMatches11.cs
- DXD.cs
- DesignerView.xaml.cs
- UserNameSecurityTokenAuthenticator.cs
- Baml6ConstructorInfo.cs
- Exceptions.cs