Code:
/ 4.0 / 4.0 / DEVDIV_TFS / Dev10 / Releases / RTMRel / ndp / fx / src / XmlUtils / System / Xml / Xsl / XsltOld / UseAttributeSetsAction.cs / 1305376 / UseAttributeSetsAction.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; using System.Collections; internal class UseAttributeSetsAction : CompiledAction { private XmlQualifiedName[] useAttributeSets; private string useString; private const int ProcessingSets = 2; internal XmlQualifiedName[] UsedSets { get { return this.useAttributeSets; } } internal override void Compile(Compiler compiler) { Debug.Assert(Ref.Equal(compiler.Input.LocalName, compiler.Atoms.UseAttributeSets)); this.useString = compiler.Input.Value; Debug.Assert(this.useAttributeSets == null); if (this.useString.Length == 0) { // Split creates empty node is spliting empty string this.useAttributeSets = new XmlQualifiedName[0]; return; } string[] qnames = XmlConvert.SplitString(this.useString); try { this.useAttributeSets = new XmlQualifiedName[qnames.Length]; { for (int i = 0; i < qnames.Length; i++) { this.useAttributeSets[i] = compiler.CreateXPathQName(qnames[i]); } } } catch (XsltException) { if (!compiler.ForwardCompatibility) { // Rethrow the exception if we're not in forwards-compatible mode throw; } // Ignore the whole list in forwards-compatible mode this.useAttributeSets = new XmlQualifiedName[0]; } } internal override void Execute(Processor processor, ActionFrame frame) { switch(frame.State) { case Initialized: frame.Counter = 0; frame.State = ProcessingSets; goto case ProcessingSets; case ProcessingSets: if (frame.Counter < this.useAttributeSets.Length) { AttributeSetAction action = processor.RootAction.GetAttributeSet(this.useAttributeSets[frame.Counter]); frame.IncrementCounter(); processor.PushActionFrame(action, frame.NodeSet); } else { frame.Finished(); } break; default: Debug.Fail("Invalid Container action execution state"); break; } } } } // 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; using System.Collections; internal class UseAttributeSetsAction : CompiledAction { private XmlQualifiedName[] useAttributeSets; private string useString; private const int ProcessingSets = 2; internal XmlQualifiedName[] UsedSets { get { return this.useAttributeSets; } } internal override void Compile(Compiler compiler) { Debug.Assert(Ref.Equal(compiler.Input.LocalName, compiler.Atoms.UseAttributeSets)); this.useString = compiler.Input.Value; Debug.Assert(this.useAttributeSets == null); if (this.useString.Length == 0) { // Split creates empty node is spliting empty string this.useAttributeSets = new XmlQualifiedName[0]; return; } string[] qnames = XmlConvert.SplitString(this.useString); try { this.useAttributeSets = new XmlQualifiedName[qnames.Length]; { for (int i = 0; i < qnames.Length; i++) { this.useAttributeSets[i] = compiler.CreateXPathQName(qnames[i]); } } } catch (XsltException) { if (!compiler.ForwardCompatibility) { // Rethrow the exception if we're not in forwards-compatible mode throw; } // Ignore the whole list in forwards-compatible mode this.useAttributeSets = new XmlQualifiedName[0]; } } internal override void Execute(Processor processor, ActionFrame frame) { switch(frame.State) { case Initialized: frame.Counter = 0; frame.State = ProcessingSets; goto case ProcessingSets; case ProcessingSets: if (frame.Counter < this.useAttributeSets.Length) { AttributeSetAction action = processor.RootAction.GetAttributeSet(this.useAttributeSets[frame.Counter]); frame.IncrementCounter(); processor.PushActionFrame(action, frame.NodeSet); } else { frame.Finished(); } break; default: Debug.Fail("Invalid Container action execution state"); break; } } } } // 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
- XmlConvert.cs
- SqlLiftIndependentRowExpressions.cs
- ImportContext.cs
- DataProviderNameConverter.cs
- ComponentEvent.cs
- DllHostInitializer.cs
- XmlSchemas.cs
- XmlReflectionMember.cs
- ComplexType.cs
- SqlCacheDependencyDatabase.cs
- SurrogateEncoder.cs
- ConsoleKeyInfo.cs
- ScrollChrome.cs
- KeyValuePairs.cs
- ExpressionDumper.cs
- SqlError.cs
- WindowsListViewSubItem.cs
- ResolvedKeyFrameEntry.cs
- ScaleTransform3D.cs
- DesignerForm.cs
- TransactionManager.cs
- UrlPath.cs
- SqlCommandSet.cs
- OleDbPropertySetGuid.cs
- XmlUtf8RawTextWriter.cs
- DataGridTable.cs
- SqlUserDefinedTypeAttribute.cs
- TimerElapsedEvenArgs.cs
- TableRowCollection.cs
- StrongNameIdentityPermission.cs
- SafeRegistryKey.cs
- DataGridItemCollection.cs
- FixedPage.cs
- Activity.cs
- Timer.cs
- LocatorManager.cs
- Point4DConverter.cs
- HyperLink.cs
- XmlIlGenerator.cs
- RequestChannel.cs
- EntityDataSourceDesigner.cs
- PassportAuthenticationEventArgs.cs
- Mutex.cs
- SettingsPropertyIsReadOnlyException.cs
- Adorner.cs
- ResumeStoryboard.cs
- AttachedPropertyMethodSelector.cs
- ObjectNotFoundException.cs
- SizeChangedEventArgs.cs
- BinaryOperationBinder.cs
- BamlVersionHeader.cs
- InteropDesigner.xaml.cs
- FixedNode.cs
- TableLayoutStyle.cs
- VersionedStream.cs
- PeerResolver.cs
- EntityContainerAssociationSetEnd.cs
- IxmlLineInfo.cs
- XmlSchemaInclude.cs
- ResourceDescriptionAttribute.cs
- Accessible.cs
- ObjectListCommandCollection.cs
- QueryTaskGroupState.cs
- NegotiateStream.cs
- WindowExtensionMethods.cs
- FontDriver.cs
- ServiceInstanceProvider.cs
- TableLayoutStyleCollection.cs
- SerialReceived.cs
- RijndaelManagedTransform.cs
- XmlAggregates.cs
- SHA1Managed.cs
- DataListItemEventArgs.cs
- ResourcesGenerator.cs
- DictionaryKeyPropertyAttribute.cs
- Panel.cs
- CharacterString.cs
- SignatureHelper.cs
- TextEditorParagraphs.cs
- Keywords.cs
- SectionXmlInfo.cs
- StringFunctions.cs
- RsaElement.cs
- HttpCapabilitiesSectionHandler.cs
- StylusPointCollection.cs
- BindingElementCollection.cs
- JournalEntry.cs
- CheckoutException.cs
- OneToOneMappingSerializer.cs
- PKCS1MaskGenerationMethod.cs
- DataGridViewCellStyleContentChangedEventArgs.cs
- CatalogPart.cs
- UpdatePanel.cs
- SupportingTokenDuplexChannel.cs
- Merger.cs
- MatrixKeyFrameCollection.cs
- Point3D.cs
- SoapAttributeAttribute.cs
- RecognizedPhrase.cs
- XsltArgumentList.cs