UtilXmlXmlBeautifier(XmlDocument, String, Boolean, Encoding) Method
Beautifies the contents of an Xml document.
Namespace: DevCase.Core.DataProcessing.XmlAssembly: DevCase.net48 (in DevCase.net48.dll) Version: 6.0.0.0 (6.0)
XMLNS for XAML: Not mapped to an xmlns.
public static string XmlBeautifier(
XmlDocument xmlDoc,
string indentChars = "",
bool indentOnAttributes = false,
Encoding enc = null
)
Public Shared Function XmlBeautifier (
xmlDoc As XmlDocument,
Optional indentChars As String = "",
Optional indentOnAttributes As Boolean = false,
Optional enc As Encoding = Nothing
) As String
Dim xmlDoc As XmlDocument
Dim indentChars As String
Dim indentOnAttributes As Boolean
Dim enc As Encoding
Dim returnValue As String
returnValue = UtilXml.XmlBeautifier(xmlDoc,
indentChars, indentOnAttributes,
enc)
public:
static String^ XmlBeautifier(
XmlDocument^ xmlDoc,
String^ indentChars = L"",
bool indentOnAttributes = false,
Encoding^ enc = nullptr
)
static member XmlBeautifier :
xmlDoc : XmlDocument *
?indentChars : string *
?indentOnAttributes : bool *
?enc : Encoding
(* Defaults:
let _indentChars = defaultArg indentChars ""
let _indentOnAttributes = defaultArg indentOnAttributes false
let _enc = defaultArg enc null
*)
-> string
No code example is currently available or this language may not be supported.
- xmlDoc XmlDocument
-
The Xml document.
It can be an entire document or a fragment.
- indentChars String (Optional)
-
The string that is used to indent the Xml.
Default value is Tab
- indentOnAttributes Boolean (Optional)
-
If set to , attributes will be separated by newlines.
- enc Encoding (Optional)
-
The Xml text encoding to use.
Default value is Default.
String
The beautified Xml text.
This is a code example.
No code example is currently available or this language may not be supported.
Dim enc As Encoding = Encoding.Default
Dim xmlDoc As New XmlDocument
xmlDoc.LoadXml("xmlText")
Dim formattedXmlDocument As String =
XmlBeautifier(xmlDoc:=xmlDoc,
indentChars:=New String(" "c, 2),
indentOnAttributes:=True,
enc:=enc)
File.WriteAllText("C:\Formatted Document.xml", formattedXmlDocument, enc)
No code example is currently available or this language may not be supported.
No code example is currently available or this language may not be supported.
No code example is currently available or this language may not be supported.
No code example is currently available or this language may not be supported.
ArgumentNullException
|
xmlText
|