Code:
/ 4.0 / 4.0 / untmp / DEVDIV_TFS / Dev10 / Releases / RTMRel / ndp / fx / src / XmlUtils / System / Xml / Xsl / XsltOld / AttributeSetAction.cs / 1305376 / AttributeSetAction.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 AttributeSetAction : ContainerAction { internal XmlQualifiedName name; internal XmlQualifiedName Name { get { return this.name; } } internal override void Compile(Compiler compiler) { CompileAttributes(compiler); CheckRequiredAttribute(compiler, this.name, "name"); CompileContent(compiler); } internal override bool CompileAttribute(Compiler compiler) { string name = compiler.Input.LocalName; string value = compiler.Input.Value; if (Ref.Equal(name, compiler.Atoms.Name)) { Debug.Assert(this.name == null); this.name = compiler.CreateXPathQName(value); } else if (Ref.Equal(name, compiler.Atoms.UseAttributeSets)) { // create a UseAttributeSetsAction // sets come before xsl:attributes AddAction(compiler.CreateUseAttributeSetsAction()); } else { return false; } return true; } private void CompileContent(Compiler compiler) { NavigatorInput input = compiler.Input; if (compiler.Recurse()) { do { switch(input.NodeType) { case XPathNodeType.Element: compiler.PushNamespaceScope(); string nspace = input.NamespaceURI; string name = input.LocalName; if (Ref.Equal(nspace, input.Atoms.UriXsl) && Ref.Equal(name, input.Atoms.Attribute)) { // found attribute so add it AddAction(compiler.CreateAttributeAction()); } 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, "attribute-set"); } } while(compiler.Advance()); compiler.ToParent(); } } internal void Merge(AttributeSetAction attributeAction) { // add the contents of "attributeAction" to this action // place them at the end Action action; int i = 0; while((action = attributeAction.GetAction(i)) != null) { AddAction(action); i++; } } } } // 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
- TypeHelper.cs
- ObjectQuery_EntitySqlExtensions.cs
- RouteParameter.cs
- SerialReceived.cs
- HtmlInputImage.cs
- NameSpaceExtractor.cs
- TypeSystem.cs
- MethodBuilderInstantiation.cs
- TemplateEditingService.cs
- RewritingPass.cs
- AbstractExpressions.cs
- ControlDesigner.cs
- ActiveXHost.cs
- ExceptionUtil.cs
- ResizeBehavior.cs
- WebPartConnectionsEventArgs.cs
- CollectionChange.cs
- Padding.cs
- SmtpNtlmAuthenticationModule.cs
- DbConnectionStringCommon.cs
- HtmlShimManager.cs
- DateTimeHelper.cs
- _NetworkingPerfCounters.cs
- WebPageTraceListener.cs
- StorageEntitySetMapping.cs
- TextSelection.cs
- PasswordBox.cs
- AVElementHelper.cs
- ProcessHost.cs
- CodeValidator.cs
- CodeTypeMemberCollection.cs
- WindowsRebar.cs
- WebDisplayNameAttribute.cs
- CacheForPrimitiveTypes.cs
- HtmlInputRadioButton.cs
- RuntimeConfigLKG.cs
- ScaleTransform.cs
- WebHttpSecurityModeHelper.cs
- NotifyIcon.cs
- Size3D.cs
- DbProviderManifest.cs
- BinaryObjectInfo.cs
- QuaternionValueSerializer.cs
- PolicyException.cs
- DiagnosticTrace.cs
- TrailingSpaceComparer.cs
- TagPrefixInfo.cs
- SrgsItemList.cs
- TableLayoutPanelDesigner.cs
- counter.cs
- InvalidTimeZoneException.cs
- ValidationRule.cs
- OrthographicCamera.cs
- BoolExpr.cs
- ServiceManager.cs
- FloaterBaseParaClient.cs
- NumericUpDownAccelerationCollection.cs
- SQLInt64.cs
- TemplateParser.cs
- BrowserCapabilitiesCompiler.cs
- ApplicationServicesHostFactory.cs
- MILUtilities.cs
- InvalidAsynchronousStateException.cs
- CompoundFileIOPermission.cs
- SafeFileMappingHandle.cs
- InvalidPropValue.cs
- TextTabProperties.cs
- HostedImpersonationContext.cs
- TextTreeTextElementNode.cs
- versioninfo.cs
- Scripts.cs
- DesignerGeometryHelper.cs
- DataView.cs
- MemberDomainMap.cs
- ExpressionBuilderContext.cs
- Rights.cs
- TargetControlTypeAttribute.cs
- PointIndependentAnimationStorage.cs
- CodeArrayIndexerExpression.cs
- DesignerView.xaml.cs
- TreeViewItemAutomationPeer.cs
- PhysicalFontFamily.cs
- CodeValidator.cs
- PackageRelationshipCollection.cs
- StreamSecurityUpgradeAcceptorAsyncResult.cs
- SecureUICommand.cs
- DiscreteKeyFrames.cs
- ExpressionLink.cs
- MeasureItemEvent.cs
- GeneralTransform3DGroup.cs
- ObjectConverter.cs
- ComponentDispatcherThread.cs
- DocumentsTrace.cs
- DataService.cs
- TitleStyle.cs
- SettingsPropertyIsReadOnlyException.cs
- MessageAction.cs
- XPathDescendantIterator.cs
- ResourceAttributes.cs
- PropertyKey.cs