本文整理汇总了C#中IXmlDocument.CreateSignificantWhitespace方法的典型用法代码示例。如果您正苦于以下问题:C# IXmlDocument.CreateSignificantWhitespace方法的具体用法?C# IXmlDocument.CreateSignificantWhitespace怎么用?C# IXmlDocument.CreateSignificantWhitespace使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类IXmlDocument
的用法示例。
在下文中一共展示了IXmlDocument.CreateSignificantWhitespace方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: DeserializeValue
// Token: 0x060006E3 RID: 1763
// RVA: 0x000381B4 File Offset: 0x000363B4
private void DeserializeValue(JsonReader reader, IXmlDocument document, XmlNamespaceManager manager, string propertyName, IXmlNode currentNode)
{
if (propertyName != null)
{
if (propertyName == "#text")
{
currentNode.AppendChild(document.CreateTextNode(reader.Value.ToString()));
return;
}
if (propertyName == "#cdata-section")
{
currentNode.AppendChild(document.CreateCDataSection(reader.Value.ToString()));
return;
}
if (propertyName == "#whitespace")
{
currentNode.AppendChild(document.CreateWhitespace(reader.Value.ToString()));
return;
}
if (propertyName == "#significant-whitespace")
{
currentNode.AppendChild(document.CreateSignificantWhitespace(reader.Value.ToString()));
return;
}
}
if (!string.IsNullOrEmpty(propertyName) && propertyName[0] == '?')
{
this.CreateInstruction(reader, document, currentNode, propertyName);
return;
}
if (string.Equals(propertyName, "!DOCTYPE", StringComparison.OrdinalIgnoreCase))
{
this.CreateDocumentType(reader, document, currentNode);
return;
}
if (reader.TokenType == JsonToken.StartArray)
{
this.ReadArrayElements(reader, document, propertyName, currentNode, manager);
return;
}
this.ReadElement(reader, document, currentNode, propertyName, manager);
}
示例2: DeserializeValue
private void DeserializeValue(JsonReader reader, IXmlDocument document, XmlNamespaceManager manager, string propertyName, IXmlNode currentNode)
{
switch (propertyName)
{
case TextName:
currentNode.AppendChild(document.CreateTextNode(reader.Value.ToString()));
break;
case CDataName:
currentNode.AppendChild(document.CreateCDataSection(reader.Value.ToString()));
break;
case WhitespaceName:
currentNode.AppendChild(document.CreateWhitespace(reader.Value.ToString()));
break;
case SignificantWhitespaceName:
currentNode.AppendChild(document.CreateSignificantWhitespace(reader.Value.ToString()));
break;
default:
// processing instructions and the xml declaration start with ?
if (!string.IsNullOrEmpty(propertyName) && propertyName[0] == '?')
{
CreateInstruction(reader, document, currentNode, propertyName);
}
else
{
if (reader.TokenType == JsonToken.StartArray)
{
// handle nested arrays
ReadArrayElements(reader, document, propertyName, currentNode, manager);
return;
}
// have to wait until attributes have been parsed before creating element
// attributes may contain namespace info used by the element
ReadElement(reader, document, currentNode, propertyName, manager);
}
break;
}
}
示例3: DeserializeValue
private void DeserializeValue(JsonReader reader, IXmlDocument document, XmlNamespaceManager manager, string propertyName, IXmlNode currentNode)
{
switch (propertyName)
{
case "#text":
currentNode.AppendChild(document.CreateTextNode(reader.Value.ToString()));
break;
case "#cdata-section":
currentNode.AppendChild(document.CreateCDataSection(reader.Value.ToString()));
break;
case "#whitespace":
currentNode.AppendChild(document.CreateWhitespace(reader.Value.ToString()));
break;
case "#significant-whitespace":
currentNode.AppendChild(document.CreateSignificantWhitespace(reader.Value.ToString()));
break;
default:
if (!string.IsNullOrEmpty(propertyName) && (int) propertyName[0] == 63)
{
this.CreateInstruction(reader, document, currentNode, propertyName);
break;
}
else if (reader.TokenType == JsonToken.StartArray)
{
this.ReadArrayElements(reader, document, propertyName, currentNode, manager);
break;
}
else
{
this.ReadElement(reader, document, currentNode, propertyName, manager);
break;
}
}
}