Code:
/ 4.0 / 4.0 / untmp / DEVDIV_TFS / Dev10 / Releases / RTMRel / ndp / fx / src / XmlUtils / System / Xml / Xsl / XsltOld / PrefixQName.cs / 1305376 / PrefixQName.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; internal sealed class PrefixQName { public string Prefix; public string Name; public string Namespace; internal void ClearPrefix() { Prefix = string.Empty; } internal void SetQName(string qname) { PrefixQName.ParseQualifiedName(qname, out Prefix, out Name); } // // Parsing qualified names // public static void ParseQualifiedName(string qname, out string prefix, out string local) { Debug.Assert(qname != null); prefix = string.Empty; local = string.Empty; // parse first NCName (prefix or local name) int position = ValidateNames.ParseNCName(qname); if (position == 0) { throw XsltException.Create(Res.Xslt_InvalidQName, qname); } local = qname.Substring(0, position); // not at the end -> parse ':' and the second NCName (local name) if (position < qname.Length) { if (qname[position] == ':') { int startLocalNamePos = ++position; prefix = local; int len = ValidateNames.ParseNCName(qname, position); position += len; if (len == 0) { throw XsltException.Create(Res.Xslt_InvalidQName, qname); } local = qname.Substring(startLocalNamePos, len); } // still not at the end -> error if (position < qname.Length) { throw XsltException.Create(Res.Xslt_InvalidQName, qname); } } } public static bool ValidatePrefix(string prefix) { if (prefix.Length == 0) { return false; } int endPos = ValidateNames.ParseNCName(prefix, 0); return endPos == prefix.Length; } } } // 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
- JsonReader.cs
- TemplateBindingExtension.cs
- PerformanceCounter.cs
- X509CertificateTrustedIssuerElement.cs
- JsonClassDataContract.cs
- RenderDataDrawingContext.cs
- HashHelper.cs
- KeysConverter.cs
- SqlDataRecord.cs
- GlobalEventManager.cs
- TemplateColumn.cs
- Evaluator.cs
- ImageFormatConverter.cs
- NameScope.cs
- DataGridViewTextBoxEditingControl.cs
- XsdBuilder.cs
- BrushMappingModeValidation.cs
- EncoderFallback.cs
- VoiceInfo.cs
- CmsInterop.cs
- HtmlTitle.cs
- XmlExpressionDumper.cs
- ValidationSummary.cs
- Viewport3DVisual.cs
- XmlUtf8RawTextWriter.cs
- NativeMethods.cs
- Filter.cs
- VisualTreeUtils.cs
- BuildManagerHost.cs
- HttpResponseBase.cs
- AttachedPropertyBrowsableForTypeAttribute.cs
- EventManager.cs
- MorphHelper.cs
- ConfigurationErrorsException.cs
- WeakReferenceList.cs
- UserControlBuildProvider.cs
- EditCommandColumn.cs
- SymbolMethod.cs
- ChangeConflicts.cs
- DataGridPagerStyle.cs
- TableAutomationPeer.cs
- CompiledQueryCacheEntry.cs
- AstTree.cs
- HwndHost.cs
- HelpProvider.cs
- SelectionItemPattern.cs
- Rules.cs
- NominalTypeEliminator.cs
- UndoManager.cs
- HashHelper.cs
- WinFormsSpinner.cs
- OdbcConnectionOpen.cs
- RouteItem.cs
- ActivityMarkupSerializer.cs
- QilPatternFactory.cs
- Control.cs
- OrderToken.cs
- WorkflowInstanceProvider.cs
- WebZoneDesigner.cs
- BitmapSizeOptions.cs
- SoapParser.cs
- _Events.cs
- HebrewCalendar.cs
- ListenerElementsCollection.cs
- FixedSOMPage.cs
- ManagementInstaller.cs
- EnumUnknown.cs
- MenuAdapter.cs
- MultiViewDesigner.cs
- ApplicationSecurityInfo.cs
- NodeCounter.cs
- FormsAuthenticationEventArgs.cs
- WriteableBitmap.cs
- SingleResultAttribute.cs
- StandardBindingImporter.cs
- ICspAsymmetricAlgorithm.cs
- smtppermission.cs
- ContentType.cs
- SmtpDigestAuthenticationModule.cs
- ListDictionary.cs
- ProxyWebPartConnectionCollection.cs
- ObjectItemConventionAssemblyLoader.cs
- EpmTargetPathSegment.cs
- XmlCustomFormatter.cs
- FileCodeGroup.cs
- LongValidator.cs
- CachedTypeface.cs
- ResourceManagerWrapper.cs
- ObjectSet.cs
- Activator.cs
- PermissionAttributes.cs
- EncryptedReference.cs
- FormsAuthenticationUser.cs
- RawTextInputReport.cs
- MessageQueuePermission.cs
- ProfileSection.cs
- JoinSymbol.cs
- Int32CAMarshaler.cs
- ServiceOperationParameter.cs
- FilterEventArgs.cs