UtilXmlXmlBeautifier(String, 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(
string xmlText,
string indentChars = "",
bool indentOnAttributes = false,
Encoding enc = null
)
Public Shared Function XmlBeautifier (
xmlText As String,
Optional indentChars As String = "",
Optional indentOnAttributes As Boolean = false,
Optional enc As Encoding = Nothing
) As String
Dim xmlText As String
Dim indentChars As String
Dim indentOnAttributes As Boolean
Dim enc As Encoding
Dim returnValue As String
returnValue = UtilXml.XmlBeautifier(xmlText,
indentChars, indentOnAttributes,
enc)
public:
static String^ XmlBeautifier(
String^ xmlText,
String^ indentChars = L"",
bool indentOnAttributes = false,
Encoding^ enc = nullptr
)
static member XmlBeautifier :
xmlText : string *
?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.
- xmlText String
-
The Xml text content.
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 unformattedXmlDocument As String =
File.ReadAllText("C:\Unformatted Document.xml", enc)
Dim formattedXmlDocument As String =
XmlBeautifier(xmlText:=unformattedXmlDocument,
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
|