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
- XmlSchemaAttribute.cs
- CodeSnippetTypeMember.cs
- MultiPageTextView.cs
- ConvertEvent.cs
- FontFamily.cs
- Sql8ExpressionRewriter.cs
- ChildrenQuery.cs
- MarshalByValueComponent.cs
- PhysicalOps.cs
- ObjectDataProvider.cs
- CompilerState.cs
- ListParaClient.cs
- CollectionBase.cs
- QilValidationVisitor.cs
- AsyncWaitHandle.cs
- EntityConnectionStringBuilder.cs
- StrongTypingException.cs
- RectAnimation.cs
- EmbossBitmapEffect.cs
- DoubleIndependentAnimationStorage.cs
- TextProviderWrapper.cs
- SafeNativeMethodsMilCoreApi.cs
- Ports.cs
- _StreamFramer.cs
- ClientTargetSection.cs
- SQLByte.cs
- XmlTextReaderImplHelpers.cs
- Matrix.cs
- ExpressionVisitor.cs
- SqlPersonalizationProvider.cs
- WebPartConnectionCollection.cs
- HostUtils.cs
- ScriptControlManager.cs
- EntityDataSourceColumn.cs
- CommonDialog.cs
- SQLBytes.cs
- PropertyIDSet.cs
- ADMembershipProvider.cs
- DBCommand.cs
- StaticTextPointer.cs
- CodeExpressionCollection.cs
- DocumentApplicationDocumentViewer.cs
- OleDbSchemaGuid.cs
- DefaultBindingPropertyAttribute.cs
- DynamicActivity.cs
- SortedList.cs
- PageClientProxyGenerator.cs
- XPathChildIterator.cs
- ELinqQueryState.cs
- GetWinFXPath.cs
- EventLog.cs
- EventHandlerList.cs
- CapabilitiesAssignment.cs
- BinaryWriter.cs
- GlyphInfoList.cs
- DescendantOverDescendantQuery.cs
- TraceRecord.cs
- ProxyAttribute.cs
- OutputCacheProfile.cs
- DashStyle.cs
- TextSelection.cs
- XmlCompatibilityReader.cs
- NativeRecognizer.cs
- TakeQueryOptionExpression.cs
- HwndAppCommandInputProvider.cs
- ColorTransformHelper.cs
- ExtensionDataReader.cs
- WebHttpElement.cs
- EFDataModelProvider.cs
- CodeArrayCreateExpression.cs
- InputReferenceExpression.cs
- SecUtil.cs
- EDesignUtil.cs
- XpsSerializationManagerAsync.cs
- Int16AnimationUsingKeyFrames.cs
- GlobalizationAssembly.cs
- ExpressionEditorAttribute.cs
- OracleSqlParser.cs
- InstanceCollisionException.cs
- XmlCDATASection.cs
- CodeDirectiveCollection.cs
- DependencyPropertyKind.cs
- ImageAutomationPeer.cs
- InputLanguageProfileNotifySink.cs
- NominalTypeEliminator.cs
- InputLanguageCollection.cs
- XmlSchemaProviderAttribute.cs
- KeySplineConverter.cs
- ApplicationManager.cs
- CommandEventArgs.cs
- PanningMessageFilter.cs
- RectangleHotSpot.cs
- DynamicRendererThreadManager.cs
- DayRenderEvent.cs
- FileUtil.cs
- CombinedGeometry.cs
- SerializationSectionGroup.cs
- BaseComponentEditor.cs
- StylusPointCollection.cs
- validation.cs