Code:
/ Dotnetfx_Win7_3.5.1 / Dotnetfx_Win7_3.5.1 / 3.5.1 / DEVDIV / depot / DevDiv / releases / whidbey / NetFXspW7 / 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
- PathGeometry.cs
- DependencyPropertyAttribute.cs
- FunctionNode.cs
- ClientSideProviderDescription.cs
- __FastResourceComparer.cs
- DataGridCell.cs
- CultureMapper.cs
- MILUtilities.cs
- DataGridBoolColumn.cs
- DataGridViewComboBoxCell.cs
- ObjectReaderCompiler.cs
- SqlNotificationEventArgs.cs
- KoreanCalendar.cs
- Form.cs
- RadialGradientBrush.cs
- DrawTreeNodeEventArgs.cs
- LabelLiteral.cs
- UnsafeNativeMethods.cs
- TextOnlyOutput.cs
- CompilationRelaxations.cs
- CellLabel.cs
- ResourceIDHelper.cs
- BooleanAnimationBase.cs
- NativeMethods.cs
- OrderedDictionary.cs
- DataReaderContainer.cs
- InterleavedZipPartStream.cs
- IgnorePropertiesAttribute.cs
- WindowsIdentity.cs
- SafeFindHandle.cs
- PeerTransportListenAddressValidator.cs
- DataGridCommandEventArgs.cs
- DataGridViewRowHeightInfoPushedEventArgs.cs
- PanelDesigner.cs
- NumericUpDown.cs
- TemplatedMailWebEventProvider.cs
- ClientSettingsStore.cs
- SplitterDesigner.cs
- RSAPKCS1KeyExchangeFormatter.cs
- AutoScrollExpandMessageFilter.cs
- XpsFixedPageReaderWriter.cs
- ComponentChangedEvent.cs
- AudioFileOut.cs
- XmlValidatingReaderImpl.cs
- EventManager.cs
- EventManager.cs
- ScaleTransform.cs
- BaseProcessor.cs
- CodeParameterDeclarationExpressionCollection.cs
- SizeLimitedCache.cs
- XmlUtil.cs
- CultureInfo.cs
- ProxyGenerationError.cs
- PlatformCulture.cs
- ConfigUtil.cs
- StorageBasedPackageProperties.cs
- ProfileManager.cs
- Point.cs
- Package.cs
- XmlAtomicValue.cs
- IDReferencePropertyAttribute.cs
- TypeNameConverter.cs
- BrowserCapabilitiesCompiler.cs
- NGCSerializationManagerAsync.cs
- SqlDuplicator.cs
- SpotLight.cs
- MatrixAnimationBase.cs
- DbConnectionInternal.cs
- DrawTreeNodeEventArgs.cs
- PageVisual.cs
- TableChangeProcessor.cs
- XmlSortKey.cs
- QilPatternFactory.cs
- SapiRecognizer.cs
- Lookup.cs
- ClientRolePrincipal.cs
- WebPartCancelEventArgs.cs
- Html32TextWriter.cs
- DbDeleteCommandTree.cs
- Formatter.cs
- AdornerDecorator.cs
- JsonWriter.cs
- Pipe.cs
- XmlLanguageConverter.cs
- SchemaNotation.cs
- Transactions.cs
- EventWaitHandleSecurity.cs
- TextHidden.cs
- HttpContextServiceHost.cs
- XsdValidatingReader.cs
- SimpleRecyclingCache.cs
- DynamicFilter.cs
- NameValueConfigurationCollection.cs
- WindowsGraphics.cs
- SafePipeHandle.cs
- EncryptedPackageFilter.cs
- ManualResetEvent.cs
- DEREncoding.cs
- Unit.cs
- WmlImageAdapter.cs