Code:
/ Net / Net / 3.5.50727.3053 / DEVDIV / depot / DevDiv / releases / whidbey / netfxsp / ndp / fx / src / XmlUtils / System / Xml / Xsl / XsltOld / AttributeSetAction.cs / 1 / 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, Keywords.s_Name); CompileContent(compiler); } internal override bool CompileAttribute(Compiler compiler) { string name = compiler.Input.LocalName; string value = compiler.Input.Value; if (Keywords.Equals(name, compiler.Atoms.Name)) { Debug.Assert(this.name == null); this.name = compiler.CreateXPathQName(value); } else if (Keywords.Equals(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 (Keywords.Equals(nspace, input.Atoms.XsltNamespace) && Keywords.Equals(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, Keywords.s_AttributeSet); } } 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. //------------------------------------------------------------------------------ //// 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, Keywords.s_Name); CompileContent(compiler); } internal override bool CompileAttribute(Compiler compiler) { string name = compiler.Input.LocalName; string value = compiler.Input.Value; if (Keywords.Equals(name, compiler.Atoms.Name)) { Debug.Assert(this.name == null); this.name = compiler.CreateXPathQName(value); } else if (Keywords.Equals(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 (Keywords.Equals(nspace, input.Atoms.XsltNamespace) && Keywords.Equals(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, Keywords.s_AttributeSet); } } 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
- LinqDataSourceContextEventArgs.cs
- Matrix3D.cs
- FunctionDescription.cs
- SmiGettersStream.cs
- ServicePoint.cs
- CodeTypeParameter.cs
- Compilation.cs
- Vector3dCollection.cs
- SystemMulticastIPAddressInformation.cs
- CharacterBufferReference.cs
- HtmlContainerControl.cs
- WebScriptMetadataFormatter.cs
- LicenseException.cs
- CqlGenerator.cs
- TreeNodeMouseHoverEvent.cs
- PhonemeConverter.cs
- DocumentOrderQuery.cs
- TreeView.cs
- RecordConverter.cs
- SqlSelectClauseBuilder.cs
- SrgsOneOf.cs
- ImageSource.cs
- CustomAttributeFormatException.cs
- DispatcherEventArgs.cs
- Component.cs
- Point4D.cs
- CodeEntryPointMethod.cs
- shaperfactoryquerycachekey.cs
- CompilerLocalReference.cs
- WorkflowMarkupElementEventArgs.cs
- ClientSection.cs
- PersistStreamTypeWrapper.cs
- ParseElement.cs
- EntityTransaction.cs
- RenderData.cs
- CustomAttributeSerializer.cs
- Function.cs
- CompiledQueryCacheEntry.cs
- InfoCardTraceRecord.cs
- SQLInt16.cs
- RelationshipConstraintValidator.cs
- ConnectionPoolManager.cs
- PrintPreviewGraphics.cs
- CharacterMetricsDictionary.cs
- Accessible.cs
- EntityCommandExecutionException.cs
- SiteIdentityPermission.cs
- XPathAxisIterator.cs
- ComponentChangedEvent.cs
- DebugInfoExpression.cs
- Color.cs
- MetadataCache.cs
- SafeArrayRankMismatchException.cs
- LiteralLink.cs
- FixedMaxHeap.cs
- Process.cs
- DataGridAddNewRow.cs
- RolePrincipal.cs
- figurelength.cs
- AppDomainEvidenceFactory.cs
- SrgsGrammar.cs
- TypeBuilderInstantiation.cs
- Odbc32.cs
- PrivilegeNotHeldException.cs
- AttachedPropertyMethodSelector.cs
- ToolStripDropDown.cs
- SerializerProvider.cs
- WebPartTracker.cs
- ObjectViewFactory.cs
- InternalEnumValidatorAttribute.cs
- Solver.cs
- EntityDataSourceViewSchema.cs
- MessageQueueInstaller.cs
- UserInitiatedNavigationPermission.cs
- InfoCardBinaryReader.cs
- TextAnchor.cs
- EventMemberCodeDomSerializer.cs
- DesignOnlyAttribute.cs
- OdbcDataReader.cs
- ListBindableAttribute.cs
- SqlBuilder.cs
- XmlQuerySequence.cs
- Int32CollectionValueSerializer.cs
- HostingEnvironment.cs
- UpdateExpressionVisitor.cs
- XmlAttributeCache.cs
- FolderLevelBuildProviderAppliesToAttribute.cs
- ScriptIgnoreAttribute.cs
- DataChangedEventManager.cs
- URLIdentityPermission.cs
- CheckoutException.cs
- Resources.Designer.cs
- SetIndexBinder.cs
- XsdDuration.cs
- APCustomTypeDescriptor.cs
- Cursors.cs
- NullReferenceException.cs
- SingleConverter.cs
- TextTreeNode.cs
- OdbcReferenceCollection.cs