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
- WorkflowElementDialogWindow.xaml.cs
- ImageIndexConverter.cs
- Win32Exception.cs
- ComplexPropertyEntry.cs
- EntitySetBaseCollection.cs
- PointValueSerializer.cs
- ComponentCollection.cs
- SqlDataSourceFilteringEventArgs.cs
- StringConverter.cs
- NetSectionGroup.cs
- StylusPointCollection.cs
- ListViewSortEventArgs.cs
- RadioButton.cs
- DataViewSettingCollection.cs
- ExceptionUtil.cs
- ConfigXmlSignificantWhitespace.cs
- FixedFlowMap.cs
- _Rfc2616CacheValidators.cs
- XmlElementList.cs
- OutOfProcStateClientManager.cs
- ToolZone.cs
- ResourceType.cs
- TypeConverterHelper.cs
- WMIGenerator.cs
- CacheDependency.cs
- WebPartVerb.cs
- SemanticResultKey.cs
- _ConnectStream.cs
- StrongNameUtility.cs
- SoapElementAttribute.cs
- DataControlImageButton.cs
- Transform3D.cs
- NegotiateStream.cs
- TransportContext.cs
- _StreamFramer.cs
- mansign.cs
- AdRotator.cs
- Executor.cs
- TableLayoutPanelCodeDomSerializer.cs
- BooleanAnimationBase.cs
- SecurityPermission.cs
- ViewKeyConstraint.cs
- ResourcePropertyMemberCodeDomSerializer.cs
- XmlWrappingReader.cs
- NameTable.cs
- DbDataSourceEnumerator.cs
- PropertyGeneratedEventArgs.cs
- PrePostDescendentsWalker.cs
- Deserializer.cs
- FixUp.cs
- CharEnumerator.cs
- SafeNativeMethodsCLR.cs
- StoryFragments.cs
- Int32RectValueSerializer.cs
- DataMember.cs
- DataSourceSelectArguments.cs
- BaseValidator.cs
- CqlIdentifiers.cs
- DesignerRegionCollection.cs
- TextBoxBase.cs
- SqlTriggerAttribute.cs
- PointAnimationUsingKeyFrames.cs
- TypeElement.cs
- DataGridViewColumnConverter.cs
- XmlSchemaException.cs
- WindowsScroll.cs
- PathSegmentCollection.cs
- TextTreeFixupNode.cs
- BlockUIContainer.cs
- DataGridViewEditingControlShowingEventArgs.cs
- SoapElementAttribute.cs
- BuildProvidersCompiler.cs
- TrackingStringDictionary.cs
- EdmSchemaAttribute.cs
- RenamedEventArgs.cs
- CollectionConverter.cs
- DeviceContexts.cs
- ModelServiceImpl.cs
- ModulesEntry.cs
- Route.cs
- MailWebEventProvider.cs
- XmlDataDocument.cs
- PropertyGridView.cs
- BitmapDecoder.cs
- ExceptionValidationRule.cs
- PointAnimationUsingKeyFrames.cs
- Matrix3DConverter.cs
- GraphicsPath.cs
- MappingSource.cs
- XmlChoiceIdentifierAttribute.cs
- Process.cs
- storagemappingitemcollection.viewdictionary.cs
- AssociationSetEnd.cs
- BuildProvider.cs
- Attributes.cs
- QuaternionRotation3D.cs
- AlignmentXValidation.cs
- QilBinary.cs
- ImageSource.cs
- Convert.cs