Code:
/ Dotnetfx_Win7_3.5.1 / Dotnetfx_Win7_3.5.1 / 3.5.1 / DEVDIV / depot / DevDiv / releases / whidbey / NetFXspW7 / ndp / fx / src / Xml / System / Xml / XPath / XPathExpr.cs / 1 / XPathExpr.cs
//------------------------------------------------------------------------------ //// Copyright (c) Microsoft Corporation. All rights reserved. // //[....] //----------------------------------------------------------------------------- namespace System.Xml.XPath { using System; using System.Xml; using System.Collections; using MS.Internal.Xml.XPath; public enum XmlSortOrder { Ascending = 1, Descending = 2, } public enum XmlCaseOrder { None = 0, UpperFirst = 1, LowerFirst = 2, } public enum XmlDataType { Text = 1, Number = 2, } public enum XPathResultType { Number = 0 , String = 1, Boolean = 2, NodeSet = 3, Navigator = XPathResultType.String, Any = 5, Error }; public abstract class XPathExpression { internal XPathExpression(){} public abstract string Expression { get; } public abstract void AddSort(object expr, IComparer comparer); public abstract void AddSort(object expr, XmlSortOrder order, XmlCaseOrder caseOrder, string lang, XmlDataType dataType); public abstract XPathExpression Clone(); public abstract void SetContext(XmlNamespaceManager nsManager); public abstract void SetContext(IXmlNamespaceResolver nsResolver); public abstract XPathResultType ReturnType { get; } public static XPathExpression Compile(string xpath) { return Compile(xpath, /*nsResolver:*/null); } public static XPathExpression Compile(string xpath, IXmlNamespaceResolver nsResolver) { bool hasPrefix; Query query = new QueryBuilder().Build(xpath, out hasPrefix); CompiledXpathExpr expr = new CompiledXpathExpr(query, xpath, hasPrefix); if (null != nsResolver) { XmlNamespaceManager mngr = XPathNavigator.GetNamespaces(nsResolver); expr.SetContext(mngr); } return expr; } private void PrintQuery(XmlWriter w) { ((CompiledXpathExpr)this).QueryTree.PrintQuery(w); } } } // File provided for Reference Use Only by Microsoft Corporation (c) 2007. //------------------------------------------------------------------------------ //// Copyright (c) Microsoft Corporation. All rights reserved. // //[....] //----------------------------------------------------------------------------- namespace System.Xml.XPath { using System; using System.Xml; using System.Collections; using MS.Internal.Xml.XPath; public enum XmlSortOrder { Ascending = 1, Descending = 2, } public enum XmlCaseOrder { None = 0, UpperFirst = 1, LowerFirst = 2, } public enum XmlDataType { Text = 1, Number = 2, } public enum XPathResultType { Number = 0 , String = 1, Boolean = 2, NodeSet = 3, Navigator = XPathResultType.String, Any = 5, Error }; public abstract class XPathExpression { internal XPathExpression(){} public abstract string Expression { get; } public abstract void AddSort(object expr, IComparer comparer); public abstract void AddSort(object expr, XmlSortOrder order, XmlCaseOrder caseOrder, string lang, XmlDataType dataType); public abstract XPathExpression Clone(); public abstract void SetContext(XmlNamespaceManager nsManager); public abstract void SetContext(IXmlNamespaceResolver nsResolver); public abstract XPathResultType ReturnType { get; } public static XPathExpression Compile(string xpath) { return Compile(xpath, /*nsResolver:*/null); } public static XPathExpression Compile(string xpath, IXmlNamespaceResolver nsResolver) { bool hasPrefix; Query query = new QueryBuilder().Build(xpath, out hasPrefix); CompiledXpathExpr expr = new CompiledXpathExpr(query, xpath, hasPrefix); if (null != nsResolver) { XmlNamespaceManager mngr = XPathNavigator.GetNamespaces(nsResolver); expr.SetContext(mngr); } return expr; } private void PrintQuery(XmlWriter w) { ((CompiledXpathExpr)this).QueryTree.PrintQuery(w); } } } // 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
- Parameter.cs
- ItemType.cs
- DesignerUtils.cs
- DirectoryInfo.cs
- ObjectParameter.cs
- CatalogZoneBase.cs
- BamlLocalizabilityResolver.cs
- HtmlElement.cs
- WeakReference.cs
- GridSplitterAutomationPeer.cs
- InteropAutomationProvider.cs
- FixedPageAutomationPeer.cs
- CompareValidator.cs
- UidPropertyAttribute.cs
- BooleanConverter.cs
- SelfSignedCertificate.cs
- TextEditorDragDrop.cs
- StickyNoteHelper.cs
- SingleResultAttribute.cs
- MemberAccessException.cs
- PeerPresenceInfo.cs
- Trace.cs
- ComponentSerializationService.cs
- HtmlToClrEventProxy.cs
- MimePart.cs
- IdentitySection.cs
- XmlTextReaderImplHelpers.cs
- SettingsPropertyValue.cs
- CollectionContainer.cs
- ServiceThrottlingElement.cs
- WebControlsSection.cs
- DSACryptoServiceProvider.cs
- RelationshipNavigation.cs
- DropShadowEffect.cs
- PngBitmapDecoder.cs
- FixUpCollection.cs
- EntityProviderFactory.cs
- WindowsFormsHost.cs
- ObjectManager.cs
- WindowProviderWrapper.cs
- InputLanguageCollection.cs
- ContainerTracking.cs
- MemoryFailPoint.cs
- FragmentNavigationEventArgs.cs
- CryptoStream.cs
- BooleanToVisibilityConverter.cs
- ActivityMarkupSerializer.cs
- TypeDescriptor.cs
- Identifier.cs
- MessageBodyDescription.cs
- UndirectedGraph.cs
- DataBindingCollection.cs
- Exceptions.cs
- ImageConverter.cs
- TablePattern.cs
- PageFunction.cs
- ImageMap.cs
- ObjectDataSourceEventArgs.cs
- ListBox.cs
- LinqDataSourceContextEventArgs.cs
- ColumnResizeUndoUnit.cs
- TriState.cs
- RelOps.cs
- TextServicesProperty.cs
- ValuePattern.cs
- OrderByBuilder.cs
- OleDbDataReader.cs
- AppDomainUnloadedException.cs
- HttpFileCollection.cs
- HtmlUtf8RawTextWriter.cs
- TemplateManager.cs
- DocumentApplicationJournalEntry.cs
- Viewport3DVisual.cs
- NetworkInterface.cs
- XmlParserContext.cs
- WebPartVerb.cs
- XmlStreamStore.cs
- CustomAttributeBuilder.cs
- PointAnimationUsingPath.cs
- IChannel.cs
- ExceptionHelpers.cs
- CodeIdentifiers.cs
- UIElementHelper.cs
- EventRoute.cs
- Exception.cs
- EntityRecordInfo.cs
- GetWorkflowTree.cs
- ConfigurationPropertyCollection.cs
- RSAOAEPKeyExchangeFormatter.cs
- QilFactory.cs
- DependencyPropertyHelper.cs
- CurrentTimeZone.cs
- MonthCalendar.cs
- PasswordBoxAutomationPeer.cs
- EmptyStringExpandableObjectConverter.cs
- Screen.cs
- Operand.cs
- DurationConverter.cs
- ConstNode.cs
- GridViewDeletedEventArgs.cs