導航:首頁 > 電腦文件 > 電腦文件文本怎麼改成xml

電腦文件文本怎麼改成xml

發布時間:2022-07-12 21:43:26

㈠ 用電腦怎麼改文件格式

想要用電腦改文件格式,我只是比較通用的格式,可以在屬性裡面改。如果比較復雜的就需要用相應的軟體進行更改

㈡ 請問怎麼把txt文檔轉變成xml格式

打開TXT文檔,滑鼠點擊「文件」-「另存為」-在文件名那輸入「你想保存的名稱.xml」
就ok了

如何將word轉化為XML格式的文件

在WPS軟體中打開word文檔,然後另存為XML文件即可。具體操作請參照以下步驟。

1、在電腦上用wps軟體打開目標word文件,進入主編輯界面。

㈣ 怎樣新建xml格式的文件

如何新建xml格式的文件,可以使用Excel文件轉換為XML格式,操作方法如下:

1、首先在電腦中點擊新建一個Excel文檔,如下圖所示。

㈤ 怎麼把txt文件轉換成xml文件

這是一個把資料庫里的數據生成XML格式,你稍微改一下就可以用在文本文件了。
<%@
Import
Namespace="System.Data"
%>
<%@
Import
Namespace="System.Data.SqlClient"
%>
<html>
<head>
<script
language="C#"
runat="server">
public
DataView
Source;
public
DataSet
ds;
public
bool
getSchema,
getData;
public
void
Submit_Click(Object
sender,
EventArgs
evt)
{
if
(IsPostBack)
{
SqlConnection
myConnection
=
new
SqlConnection(ConnectString.Value);
SqlDataAdapter
myCommand
=
new
SqlDataAdapter(myText.Value,
myConnection);
ds
=
new
DataSet();
myCommand.Fill(ds,
"表");
Source
=
new
DataView(ds.Tables[0]);
getSchema
=
GetSchema.Checked;
getData
=
GetData.Checked;
MyDataGrid.DataSource=Source;
MyDataGrid.DataBind();
}
}
</script>
</head>
<body
bgcolor="ffffcc">
<h3><font
face="宋體">SQL

XML
生成器</font></h3>
<form
runat="server">
<table
border=0
cellpadding=5
style="font:10.5pt
宋體">
<tr>
<td
colspan="2">
<b>連接字元串:</b><br>
<input
id="ConnectString"
type="text"
value="server=(local);database=pubs;uid=sa;pwd=1234"
size="85"
runat="server">
</td>
</tr>
<tr>
<td
colspan="2">
<b>查詢:</b><br>
<input
id="myText"
type="text"
value="SELECT
*
FROM
Authors"
size="85"
runat="server">
</td>
</tr>
<tr>
<td>
<input
type="radio"
id="GetSchema"
name="Mode"
runat="server"/>獲取
XML
架構<br>
<input
type="radio"
id="GetData"
name="Mode"
runat="server"/>獲取
XML
數據<br>
<input
type="radio"
id="GetBoth"
name="Mode"
checked
runat="server"/>兩者都獲取
</td>
<td
valign="top">
<input
type="submit"
runat="server"
OnServerClick="Submit_Click">
</td>
</tr>
<tr>
<td
colspan="2">
<%
if
(Page.IsPostBack)
{
%>
<b>結果:</b><br>
<textarea
cols=80
rows=25>
<%
if
(getSchema)
ds.WriteXmlSchema(Response.Output);
else
if
(getData)
ds.WriteXml(Response.Output,
XmlWriteMode.IgnoreSchema);
else
ds.WriteXml(Response.Output,
XmlWriteMode.WriteSchema);
%>
</textarea>
<%
}
%>
</td>
</tr>
<tr>
<td
colspan="2">
<%
if
(Page.IsPostBack)
{
%>
<b>數據:</b><br>
<%
}
%>
<ASP:DataGrid
id="MyDataGrid"
BackColor="#EDBE7B"
BorderColor="black"
ShowFooter="false"
CellPadding=3
CellSpacing="0"
Font-Name="宋體"
Font-Size="8pt"
HeaderStyle-BackColor="#DC6035"
EnableViewState="false"
runat="server"
/>
</td>
<tr>
</table>
</form>
</body>
</html>
用C#來做。要用XmlTextWriter向TXT文件中寫內容。
using
System.Xml;
using
System.Text;
XmlTextReader
xmlReader
=
null;
xmlReader
=
new
XmlTextReader(mDocument);
//mDocument參數為xml文檔名字
while(xmlReader.Read())
{
if(xmlReader.NodeType
==
XmlNodeType.Element)
{
while(xmlReader.MoveToNextAttribute())
{
//用XmlTextWriter類將xmlReader.Name和xmlReader.Value寫入HTML做
//相應的處理
}
if(xmlReader.IsEmptyElement)
{
}
else
{
}
}
else
if(xmlReader.NodeType
==
XmlNodeType.EndElement)
{
//做自己的處理
}
else
if(xmlReader.NodeType
==
XmlNodeType.Text)
{
if
(xmlReader.Value.Length
!=
0)
{
//將xmlReader.Value
寫入TXT中的處理
}
}
}
//end
of
~while(xmlReader.Read())
展開

㈥ 誰會把TXT文件轉換成XML文件

這是一個把資料庫里的數據生成XML格式,你稍微改一下就可以用在文本文件了。
<%@ Import Namespace="System.Data" %>
<%@ Import Namespace="System.Data.SqlClient" %>

<html>
<head>

<script language="C#" runat="server">

public DataView Source;
public DataSet ds;
public bool getSchema, getData;

public void Submit_Click(Object sender, EventArgs evt) {
if (IsPostBack) {
SqlConnection myConnection = new SqlConnection(ConnectString.Value);
SqlDataAdapter myCommand = new SqlDataAdapter(myText.Value, myConnection);

ds = new DataSet();
myCommand.Fill(ds, "表");

Source = new DataView(ds.Tables[0]);

getSchema = GetSchema.Checked;
getData = GetData.Checked;

MyDataGrid.DataSource=Source;
MyDataGrid.DataBind();
}
}

</script>

</head>
<body bgcolor="ffffcc">

<h3><font face="宋體">SQL 到 XML 生成器</font></h3>

<form runat="server">

<table border=0 cellpadding=5 style="font:10.5pt 宋體">
<tr>
<td colspan="2">
<b>連接字元串:</b><br>
<input id="ConnectString" type="text" value="server=(local);database=pubs;uid=sa;pwd=1234" size="85" runat="server">
</td>
</tr>
<tr>
<td colspan="2">
<b>查詢:</b><br>
<input id="myText" type="text" value="SELECT * FROM Authors" size="85" runat="server">
</td>
</tr>
<tr>
<td>
<input type="radio" id="GetSchema" name="Mode" runat="server"/>獲取 XML 架構<br>
<input type="radio" id="GetData" name="Mode" runat="server"/>獲取 XML 數據<br>
<input type="radio" id="GetBoth" name="Mode" checked runat="server"/>兩者都獲取
</td>
<td valign="top">
<input type="submit" runat="server" OnServerClick="Submit_Click">
</td>
</tr>
<tr>
<td colspan="2">

<% if (Page.IsPostBack) { %>
<b>結果:</b><br>
<textarea cols=80 rows=25>
<%
if (getSchema)
ds.WriteXmlSchema(Response.Output);
else if (getData)
ds.WriteXml(Response.Output, XmlWriteMode.IgnoreSchema);
else
ds.WriteXml(Response.Output, XmlWriteMode.WriteSchema);
%>
</textarea>
<% } %>

</td>
</tr>
<tr>
<td colspan="2">

<% if (Page.IsPostBack) { %>
<b>數據:</b><br>
<% } %>

<ASP:DataGrid id="MyDataGrid"
BackColor="#EDBE7B"
BorderColor="black"
ShowFooter="false"
CellPadding=3
CellSpacing="0"
Font-Name="宋體"
Font-Size="8pt"
HeaderStyle-BackColor="#DC6035"
EnableViewState="false"
runat="server"
/>

</td>
<tr>
</table>

</form>

</body>
</html>

用C#來做。要用XmlTextWriter向TXT文件中寫內容。

using System.Xml;
using System.Text;

XmlTextReader xmlReader = null;
xmlReader = new XmlTextReader(mDocument); //mDocument參數為xml文檔名字

while(xmlReader.Read())
{
if(xmlReader.NodeType == XmlNodeType.Element)
{
while(xmlReader.MoveToNextAttribute())
{
//用XmlTextWriter類將xmlReader.Name和xmlReader.Value寫入HTML做
//相應的處理
}
if(xmlReader.IsEmptyElement)
{
}
else
{
}
}
else if(xmlReader.NodeType == XmlNodeType.EndElement)
{
//做自己的處理
}
else if(xmlReader.NodeType == XmlNodeType.Text)
{
if (xmlReader.Value.Length != 0)
{
//將xmlReader.Value 寫入TXT中的處理
}
}
} //end of ~while(xmlReader.Read())

㈦ txt格式是否可以轉換成xml

電腦上的所有文件,只要改它的後綴名,就可以改變格式。

就是慢速點擊兩下文件,就可以修改文件的名稱,把.txt改正.xml,就可以改變了。

不過要先保證電腦有可以打開xml的功能。(這我就不知道了。)

㈧ 計算機保存文本類型如何把lndex格式保存為xml格式的

可以另存為和修改文件後綴名 或者直接用該類型編寫文本

閱讀全文

與電腦文件文本怎麼改成xml相關的資料

熱點內容
電腦橫機漏針怎麼修 瀏覽:547
小米筆記本電腦2019版 瀏覽:210
二千的筆記本電腦能幹啥 瀏覽:672
電腦要重新開機才能聯網 瀏覽:892
電腦上網路2怎麼設置為網路4 瀏覽:502
電腦怎麼下載解壓軟體 瀏覽:637
平板電腦屏幕模糊不清 瀏覽:365
新電腦怎麼設置網路連接 瀏覽:420
電腦初始軟體安裝教程 瀏覽:533
400元平板電腦 瀏覽:413
筆記本電腦win在哪 瀏覽:434
筆記本電腦硬碟燈閃爍看不到 瀏覽:592
電腦下載輸入法怎麼下 瀏覽:424
角頭電腦版什麼軟體能看 瀏覽:876
怎麼解除蘋果手機和平板電腦同步 瀏覽:305
聯想老電腦進不了系統怎麼辦 瀏覽:88
電腦硬碟光碟扇區怎麼看 瀏覽:697
聯想哪個電腦可以帶動ps 瀏覽:447
沒網電腦連wifi 瀏覽:29
華碩電腦怎麼關閉自動安裝軟體 瀏覽:757