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
- ExportOptions.cs
- ProviderConnectionPoint.cs
- MetadataItem.cs
- Point3DKeyFrameCollection.cs
- PathBox.cs
- RegistryConfigurationProvider.cs
- COM2ICategorizePropertiesHandler.cs
- CompilationUtil.cs
- ColumnCollectionEditor.cs
- DataSvcMapFile.cs
- ExpandCollapsePattern.cs
- NetCodeGroup.cs
- Stroke2.cs
- __ComObject.cs
- EUCJPEncoding.cs
- UnsafeNativeMethods.cs
- PropertyPath.cs
- HtmlPhoneCallAdapter.cs
- Signature.cs
- SQLDoubleStorage.cs
- DrawingImage.cs
- translator.cs
- CodeNamespaceImport.cs
- BindingCompleteEventArgs.cs
- EntityDesignerBuildProvider.cs
- UnescapedXmlDiagnosticData.cs
- EventRecordWrittenEventArgs.cs
- SimpleTypeResolver.cs
- WebPartConnectionCollection.cs
- GlobalItem.cs
- ArgumentValidation.cs
- WorkflowMarkupSerializationManager.cs
- BindUriHelper.cs
- DbLambda.cs
- OpenTypeLayoutCache.cs
- LookupNode.cs
- SelectionEditingBehavior.cs
- Descriptor.cs
- AuthenticationException.cs
- LiteralSubsegment.cs
- EventLogLink.cs
- SectionUpdates.cs
- TextMarkerSource.cs
- CharacterBufferReference.cs
- TextPointerBase.cs
- Vector3DValueSerializer.cs
- TypeUtil.cs
- DrawTreeNodeEventArgs.cs
- Material.cs
- MarginsConverter.cs
- DataGridViewMethods.cs
- PageThemeParser.cs
- LoginNameDesigner.cs
- Message.cs
- ScopedKnownTypes.cs
- Transform3DGroup.cs
- ResourceKey.cs
- TrackingStringDictionary.cs
- X509PeerCertificateAuthenticationElement.cs
- TableCellCollection.cs
- LoginAutoFormat.cs
- PresentationTraceSources.cs
- GridViewUpdateEventArgs.cs
- DLinqDataModelProvider.cs
- ThicknessAnimationBase.cs
- ThemeableAttribute.cs
- DuplexClientBase.cs
- BitmapScalingModeValidation.cs
- ResourceReader.cs
- ProfileEventArgs.cs
- NullRuntimeConfig.cs
- BaseParagraph.cs
- Brush.cs
- RegexRunner.cs
- AccessibilityHelperForVista.cs
- ErrorInfoXmlDocument.cs
- SchemaImporterExtensionElement.cs
- SqlErrorCollection.cs
- StartUpEventArgs.cs
- InstanceCompleteException.cs
- ThemeInfoAttribute.cs
- Link.cs
- CompileXomlTask.cs
- NotSupportedException.cs
- MissingFieldException.cs
- ModuleBuilder.cs
- UrlAuthorizationModule.cs
- DbProviderSpecificTypePropertyAttribute.cs
- FirewallWrapper.cs
- SqlCacheDependencyDatabase.cs
- Size3D.cs
- EntityConnection.cs
- IndexedString.cs
- FragmentQueryProcessor.cs
- TextClipboardData.cs
- SqlBuilder.cs
- NameValuePair.cs
- DecimalConstantAttribute.cs
- XmlWrappingWriter.cs
- ColorContextHelper.cs