public override Task WriteNameAsync(string name) { if (_checkNames) { XmlConvert.VerifyQName(name, ExceptionType.XmlException); } return(writer.WriteNameAsync(name)); }
public override void WriteName(string name) { if (_checkNames) { XmlConvert.VerifyQName(name, ExceptionType.XmlException); } writer.WriteName(name); }
public override void WriteName(string name) { if (checkNames) { XmlConvert.VerifyQName(name); } writer.WriteName(name); }
public virtual Task WriteNameAsync(string name) { return(WriteStringAsync(XmlConvert.VerifyQName(name, ExceptionType.ArgumentException))); }
// Writes out the specified name, ensuring it is a valid Name according to the XML specification // (http://www.w3.org/TR/1998/REC-xml-19980210#NT-Name). public virtual void WriteName(string name) { WriteString(XmlConvert.VerifyQName(name, ExceptionType.ArgumentException)); }
public override async Task WriteDocTypeAsync(string name, string pubid, string sysid, string subset) { try { if (name == null || name.Length == 0) { throw new ArgumentException(SR.Xml_EmptyName); } XmlConvert.VerifyQName(name, ExceptionType.XmlException); if (_conformanceLevel == ConformanceLevel.Fragment) { throw new InvalidOperationException(SR.Xml_DtdNotAllowedInFragment); } await AdvanceStateAsync(Token.Dtd).ConfigureAwait(false); if (_dtdWritten) { _currentState = State.Error; throw new InvalidOperationException(SR.Xml_DtdAlreadyWritten); } if (_conformanceLevel == ConformanceLevel.Auto) { _conformanceLevel = ConformanceLevel.Document; _stateTable = s_stateTableDocument; } int i; // check characters if (_checkCharacters) { if (pubid != null) { if ((i = _xmlCharType.IsPublicId(pubid)) >= 0) { throw new ArgumentException(SR.Format(SR.Xml_InvalidCharacter, XmlException.BuildCharExceptionArgs(pubid, i)), "pubid"); } } if (sysid != null) { if ((i = _xmlCharType.IsOnlyCharData(sysid)) >= 0) { throw new ArgumentException(SR.Format(SR.Xml_InvalidCharacter, XmlException.BuildCharExceptionArgs(sysid, i)), "sysid"); } } if (subset != null) { if ((i = _xmlCharType.IsOnlyCharData(subset)) >= 0) { throw new ArgumentException(SR.Format(SR.Xml_InvalidCharacter, XmlException.BuildCharExceptionArgs(subset, i)), "subset"); } } } // write doctype await _writer.WriteDocTypeAsync(name, pubid, sysid, subset).ConfigureAwait(false); _dtdWritten = true; } catch { _currentState = State.Error; throw; } }