Code:
/ Dotnetfx_Win7_3.5.1 / Dotnetfx_Win7_3.5.1 / 3.5.1 / DEVDIV / depot / DevDiv / releases / whidbey / NetFXspW7 / 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
- RadioButtonPopupAdapter.cs
- VisualTreeHelper.cs
- ConstraintEnumerator.cs
- HttpWebRequestElement.cs
- ColorMap.cs
- ValidationErrorCollection.cs
- MarkedHighlightComponent.cs
- OrthographicCamera.cs
- UserControlBuildProvider.cs
- MsmqHostedTransportConfiguration.cs
- ProfilePropertyNameValidator.cs
- SamlAudienceRestrictionCondition.cs
- DictionaryItemsCollection.cs
- UdpChannelFactory.cs
- ToggleButtonAutomationPeer.cs
- LogPolicy.cs
- __Error.cs
- NodeFunctions.cs
- AssignDesigner.xaml.cs
- ResourceProviderFactory.cs
- BuildProvidersCompiler.cs
- InteropAutomationProvider.cs
- WmlTextBoxAdapter.cs
- TrustManagerPromptUI.cs
- AutoCompleteStringCollection.cs
- EncryptedKeyIdentifierClause.cs
- MimeMultiPart.cs
- SwitchAttribute.cs
- WebRequestModulesSection.cs
- SingleSelectRootGridEntry.cs
- ListViewItem.cs
- ColorTranslator.cs
- TitleStyle.cs
- MetafileHeader.cs
- DataGrid.cs
- FrugalList.cs
- OutputChannel.cs
- WebSysDisplayNameAttribute.cs
- XsdCachingReader.cs
- HtmlWindow.cs
- Operators.cs
- LinkLabelLinkClickedEvent.cs
- Material.cs
- AsyncResult.cs
- XmlTextReaderImpl.cs
- Repeater.cs
- OrderedDictionaryStateHelper.cs
- SoapIncludeAttribute.cs
- CaseCqlBlock.cs
- CorrelationRequestContext.cs
- PictureBoxDesigner.cs
- Literal.cs
- SR.cs
- GradientSpreadMethodValidation.cs
- OracleString.cs
- NegatedCellConstant.cs
- TableCellCollection.cs
- XPathDocumentNavigator.cs
- XamlReader.cs
- SingleKeyFrameCollection.cs
- CodeTypeDeclarationCollection.cs
- BitmapEffectOutputConnector.cs
- MemberRelationshipService.cs
- ScriptManagerProxy.cs
- Calendar.cs
- BamlRecordReader.cs
- MetadataStore.cs
- MenuRenderer.cs
- DXD.cs
- SynchronizedInputProviderWrapper.cs
- DetailsViewRow.cs
- DisplayInformation.cs
- X509ThumbprintKeyIdentifierClause.cs
- BmpBitmapEncoder.cs
- FunctionGenerator.cs
- ThicknessAnimationBase.cs
- AlphabetConverter.cs
- MarkupObject.cs
- SByteConverter.cs
- ListViewGroupConverter.cs
- SqlBinder.cs
- DataGridLinkButton.cs
- TriggerAction.cs
- WebPartConnectionsConnectVerb.cs
- SqlParameterizer.cs
- RankException.cs
- PassportIdentity.cs
- ListViewItemEventArgs.cs
- ClientBuildManagerCallback.cs
- TextDecorationUnitValidation.cs
- EventHandlerList.cs
- DesignSurface.cs
- DocobjHost.cs
- CaseStatement.cs
- BitmapEffectRenderDataResource.cs
- InstanceDataCollection.cs
- XmlSchemaAttributeGroup.cs
- WSHttpBindingBaseElement.cs
- ConstrainedDataObject.cs
- MatrixTransform.cs