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 / CompiledAction.cs / 1 / CompiledAction.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 abstract class CompiledAction : Action { internal abstract void Compile(Compiler compiler); internal virtual bool CompileAttribute(Compiler compiler) { return false; } public void CompileAttributes(Compiler compiler) { NavigatorInput input = compiler.Input; string element = input.LocalName; if (input.MoveToFirstAttribute()) { do { if (! Keywords.Equals(input.NamespaceURI, input.Atoms.Empty)) continue; try { if (CompileAttribute(compiler) == false) { throw XsltException.Create(Res.Xslt_InvalidAttribute, input.LocalName, element); } }catch { if (! compiler.ForwardCompatibility) { throw; } else { // In ForwardCompatibility mode we ignoreing all unknown or incorrect attributes // If it's mandatory attribute we'l notice it absents later. } } } while (input.MoveToNextAttribute()); input.ToParent(); } } // For perf reason we precalculating AVTs at compile time. // If we can do this we set original AVT to null internal static string PrecalculateAvt(ref Avt avt) { string result = null; if(avt != null && avt.IsConstant) { result = avt.Evaluate(null, null); avt = null; } return result; } public void CheckEmpty(Compiler compiler) { // Really EMPTY means no content at all, but the sake of compatibility with MSXML we allow whitespaces string elementName = compiler.Input.Name; if (compiler.Recurse()) { do { // Note: will be reported as XPathNodeType.Text XPathNodeType nodeType = compiler.Input.NodeType; if ( nodeType != XPathNodeType.Whitespace && nodeType != XPathNodeType.Comment && nodeType != XPathNodeType.ProcessingInstruction ) { throw XsltException.Create(Res.Xslt_NotEmptyContents, elementName); } } while (compiler.Advance()); compiler.ToParent(); } } public void CheckRequiredAttribute(Compiler compiler, object attrValue, string attrName) { CheckRequiredAttribute(compiler, attrValue != null, attrName); } public void CheckRequiredAttribute(Compiler compiler, bool attr, string attrName) { if (! attr) { throw XsltException.Create(Res.Xslt_MissingAttribute, attrName); } } } } // 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 abstract class CompiledAction : Action { internal abstract void Compile(Compiler compiler); internal virtual bool CompileAttribute(Compiler compiler) { return false; } public void CompileAttributes(Compiler compiler) { NavigatorInput input = compiler.Input; string element = input.LocalName; if (input.MoveToFirstAttribute()) { do { if (! Keywords.Equals(input.NamespaceURI, input.Atoms.Empty)) continue; try { if (CompileAttribute(compiler) == false) { throw XsltException.Create(Res.Xslt_InvalidAttribute, input.LocalName, element); } }catch { if (! compiler.ForwardCompatibility) { throw; } else { // In ForwardCompatibility mode we ignoreing all unknown or incorrect attributes // If it's mandatory attribute we'l notice it absents later. } } } while (input.MoveToNextAttribute()); input.ToParent(); } } // For perf reason we precalculating AVTs at compile time. // If we can do this we set original AVT to null internal static string PrecalculateAvt(ref Avt avt) { string result = null; if(avt != null && avt.IsConstant) { result = avt.Evaluate(null, null); avt = null; } return result; } public void CheckEmpty(Compiler compiler) { // Really EMPTY means no content at all, but the sake of compatibility with MSXML we allow whitespaces string elementName = compiler.Input.Name; if (compiler.Recurse()) { do { // Note: will be reported as XPathNodeType.Text XPathNodeType nodeType = compiler.Input.NodeType; if ( nodeType != XPathNodeType.Whitespace && nodeType != XPathNodeType.Comment && nodeType != XPathNodeType.ProcessingInstruction ) { throw XsltException.Create(Res.Xslt_NotEmptyContents, elementName); } } while (compiler.Advance()); compiler.ToParent(); } } public void CheckRequiredAttribute(Compiler compiler, object attrValue, string attrName) { CheckRequiredAttribute(compiler, attrValue != null, attrName); } public void CheckRequiredAttribute(Compiler compiler, bool attr, string attrName) { if (! attr) { throw XsltException.Create(Res.Xslt_MissingAttribute, attrName); } } } } // 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
- VirtualDirectoryMappingCollection.cs
- ToolboxItemAttribute.cs
- StringInfo.cs
- DispatcherEventArgs.cs
- HttpsChannelFactory.cs
- cache.cs
- TextDecorationUnitValidation.cs
- PackageDigitalSignature.cs
- securitycriticaldata.cs
- Peer.cs
- SafeFileMappingHandle.cs
- RoleGroupCollection.cs
- DataGridAddNewRow.cs
- XamlContextStack.cs
- ValidationHelpers.cs
- RectIndependentAnimationStorage.cs
- IEnumerable.cs
- TextDecoration.cs
- List.cs
- SqlUtil.cs
- StringAnimationUsingKeyFrames.cs
- TextCollapsingProperties.cs
- XmlBinaryWriter.cs
- VisualStates.cs
- NativeMethods.cs
- ComponentResourceKeyConverter.cs
- EntityModelBuildProvider.cs
- Int32Animation.cs
- DataGridViewColumnStateChangedEventArgs.cs
- ValuePattern.cs
- NameHandler.cs
- BufferedGraphicsContext.cs
- WmlValidatorAdapter.cs
- CodeSubDirectoriesCollection.cs
- ActiveDocumentEvent.cs
- DesignerTextViewAdapter.cs
- SiteMap.cs
- PermissionSetTriple.cs
- DbMetaDataFactory.cs
- DependencyPropertyValueSerializer.cs
- SQLRoleProvider.cs
- WebPartConnectionsCancelVerb.cs
- Win32PrintDialog.cs
- FunctionDescription.cs
- TypedTableBase.cs
- DuplicateWaitObjectException.cs
- SaveFileDialogDesigner.cs
- CompositeDesignerAccessibleObject.cs
- httpstaticobjectscollection.cs
- TargetPerspective.cs
- WizardStepBase.cs
- ReadOnlyPermissionSet.cs
- TableLayoutStyleCollection.cs
- HiddenFieldPageStatePersister.cs
- TypeGeneratedEventArgs.cs
- HttpResponseBase.cs
- DrawingServices.cs
- BaseTemplateParser.cs
- ActivityCollectionMarkupSerializer.cs
- PageRequestManager.cs
- FlowDocumentScrollViewer.cs
- NegotiationTokenAuthenticatorStateCache.cs
- Utilities.cs
- TableCell.cs
- DesignerAdRotatorAdapter.cs
- TrustLevel.cs
- DetailsViewModeEventArgs.cs
- PagesSection.cs
- ParserContext.cs
- RemotingConfigParser.cs
- XmlLanguageConverter.cs
- BindingValueChangedEventArgs.cs
- ContractTypeNameElement.cs
- DefaultWorkflowLoaderService.cs
- RuntimeVariablesExpression.cs
- BevelBitmapEffect.cs
- DataKeyArray.cs
- TraceSwitch.cs
- ItemDragEvent.cs
- TransformedBitmap.cs
- PropertyInformation.cs
- TypeProvider.cs
- DataGridViewCellPaintingEventArgs.cs
- FlowNode.cs
- ReadOnlyCollection.cs
- PathFigureCollection.cs
- XNameConverter.cs
- FrameAutomationPeer.cs
- UnsupportedPolicyOptionsException.cs
- ExtensionSimplifierMarkupObject.cs
- Pair.cs
- TraceListeners.cs
- WebServiceErrorEvent.cs
- WebBrowsableAttribute.cs
- XPathDocumentIterator.cs
- DataGridViewCellLinkedList.cs
- SharedPerformanceCounter.cs
- SignatureHelper.cs
- TimelineGroup.cs
- SqlCacheDependency.cs