.xmlファイルを実行するために必要なものについてアドバイスできますか?メモ帳 で作成し、.xml拡張子で保存してから、Windowsでファイルをダブルクリックするか、実行しますか? 特別なエディタが必要ですか?xml - XMLファイルの作成/実行方法
私はjavaアプリケーションを持っていて、 という.jarファイルのJNLPファイルが必要なJave Web Start techonologyを使用したいと考えています。
おかげ
.xmlファイルを実行するために必要なものについてアドバイスできますか?メモ帳 で作成し、.xml拡張子で保存してから、Windowsでファイルをダブルクリックするか、実行しますか? 特別なエディタが必要ですか?xml - XMLファイルの作成/実行方法
私はjavaアプリケーションを持っていて、 という.jarファイルのJNLPファイルが必要なJave Web Start techonologyを使用したいと考えています。
おかげ
あなたは特別なエディタを必要としないが、それは、編集中に大いに役立つことができます。
xmlファイルを実行することはできません。しかし、xmlファイルを使用するプログラムを実行できます。
「実行」をXMLファイルには、おそらく次の文のようなものが必要です。
java -jar yourFile.jar packageOfMainMethod.ClassWithMainMethod yourXML.xml
をしかし、これはあなたが実行しようとするプログラムに依存します。
XMLファイルからJNLPファイルを作成したいだけですが、ローカルのコードベースを使用することはできますか? JNLPを作成するために私のハードディスク上のdir? – Kurt
これは私のjarが私のc:\ users ..に指定されているにもかかわらず、私が取得したすべてのWebページがキャンセルされたJNLPを作成するためのxmlファイルですdir <?xml version = "1.0" encoding = "utf- "?><! - TableDemoのJNLPファイル - >
もちろん、xmlファイルを実行できます。正確には、xsltコードを持つxmlの特別な種類のxslファイルだけでなく、他のソースコードと同様に純粋なテキストを実行することができます。 xsltスクリプトが実行されるインタプリタはあなたのブラウザです。
2つのファイルが必要です。
a。使用するデータと情報を含むXMLファイル( "test.xml"という名前):
<?xml version="1.0" encoding="utf-8"?>
<?xml-stylesheet type="text/xsl" href="test.xsl"?>
<root>data</root>
b。スクリプト(「test.xsl」という名前を付けます)を含むXSLファイル:
<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:template match="/">
<html>
<head>
<title>Show XML</title>
<head>
<body>
<xsl:value-of select="."/>
</body>
</html>
</xsl:template>
</xsl:stylesheet>
をお使いのOSが、それは、ブラウザの彼に言う、xmlファイルを開くに使用するプログラムを知らない場合。 はい、メモ帳やFirefoxのようなブラウザのようなエディタが必要です。 xmlを知っているものを使う方がより便利ですが、メモ帳とは既にJavaを必要とせずにstandanloneという完全な開発環境になっています。
どうしましたか? XMLファイルは実際にはXSLT変換ですか? –
XMLファイルが実際にXSLT変換されていないのですが、「ダブルクリックで実行」効果を得るために2番目のXMLファイルが必要です。少なくとも、これを実現するための唯一の一般的な方法です。ほとんどすべてのPCで動作します。 – Andreas
それは動作しません、あなたはそれを行う方法を明確にすることはできますか? –
これはC#
最初{ invokeメソッド..............
public void InvokeKey()
{
DSXml.ReadXml(@"c:\users\general\documents\visual studio 2010\Projects\xml_practice\xml_practice\todolist.xml");
DataColumn[] ID = new DataColumn[1];
ID[0] = DSXml.Tables[0].Columns[0];
DSXml.Tables[0].PrimaryKey = ID;
}
データセットDsXml =新しいデータセットを使用してXMLファイルに簡単に挿入され(); DataRow DrXML;
string Date = Convert.ToString(System.DateTime.Now.ToString("d"));
string Time = Convert.ToString(System.DateTime.Now.ToString("hh:mm:ss"));
int ID;
InvokeKey();
DRXML = DSXml.Tables[0].Rows.Find(ID);
DsXml.WriteXml(@"path");
DrXML = DsXml.Tables[0].NewRow();
DrXML[0] = ID;
DrXML[0] = ID;
DrXML[0] = ID;
DrXML[0] = ID;
DrXML[0] = ID;
DrXML[0] = ID;
DsXml.Tables[0].Rows.Add(DrXML);
DsXml.WriteXml(@"path");
dt = REport.LoadSubjects();
Excel.Application xlApp = new Excel.Application(); // open app
xlApp.Visible = true;
Excel.Workbook xlWorkBook = xlApp.Workbooks.Add(1); //open workbook
Excel.Worksheet xlSheet = (Excel.Worksheet)xlWorkBook.Worksheets[1]; //open worksheet
xlSheet.Cells.Rows.Columns.AutoFit();
string strTempVariable = dt.Rows[0][0].ToString(); //temporary variable
xlSheet.Cells[4, 1] = dt.Rows[0][0].ToString();
xlSheet.Cells[1, 1] = "Employees group header";
for (int count = 0; count < dt.Columns.Count;count++)
{
xlSheet.Cells[3, count+1] = dt.Columns[count].ColumnName;// prints column names
}
int group=0;
int total=0;
int intRow = 5;//manages xlsheet
for (int counter = 0; counter < dt.Rows.Count;counter++)
{
if (strTempVariable == dt.Rows[counter]["City"].ToString())
{
xlSheet.Cells[intRow, 2] = dt.Rows[counter][1];
xlSheet.Cells[intRow, 3] = dt.Rows[counter][2];
xlSheet.Cells[intRow, 4] = dt.Rows[counter][3];
xlSheet.Cells[intRow, 5] = dt.Rows[counter][4];
group++;
total++;
intRow++;
}
else
{
xlSheet.Cells[intRow, 4] = "group name " + strTempVariable + " " + group.ToString();
strTempVariable = dt.Rows[counter][0].ToString();
intRow++;
xlSheet.Cells[intRow, 1] = strTempVariable;
intRow++;
counter--;
group = 0;
}
}
intRow++;
xlSheet.Cells[intRow, 4] = "group name " + strTempVariable + " "+group.ToString();
intRow++;
xlSheet.Cells[intRow, 4] = "GrandTotal " + " "+total.ToString();
xlWorkBook.Close(true, "GROUP REPORT", 0);//The name of the worksheet
xlApp.Quit();
// return "Report Successfully";
}
公共の文字列ReportTimeTable(){
DataTier.clsDataAccess Data = new DataTier.clsDataAccess();
int intCount = 0;
int intCount2 = 5;
Data.sqlcon.Close();
Data.sqlcon.Open();
Data.sqlAdpter = new SqlDataAdapter("SELECT * FROM USERS ORDER BY password",Data.sqlcon);
DataTable ReportDt = new DataTable("Report");
Data.sqlAdpter.Fill(ReportDt);
Data.sqlcon.Close();
string strMsg = "";
Excel.Application xlApp = new Excel.Application();
xlApp.Visible = true;
Excel.Workbook xlWorkbook = xlApp.Workbooks.Add(1);
Excel.Worksheet xlWorksheet = (Excel.Worksheet)xlWorkbook.Sheets[1];
// Setting cell values
((Excel.Range)xlWorksheet.Cells[1, "A"]).Value2 = "Report - USERS "; //main heading
((Excel.Range)xlWorksheet.Cells[3, "A"]).Value2 = "USERNAME"; //field headings
((Excel.Range)xlWorksheet.Cells[3, "B"]).Value2 = "PASSWORD";
// ((Excel.Range)xlWorksheet.Cells[3, "C"]).Value2 = "MARK";
for (intCount = 0; intCount < ReportDt.Rows.Count; intCount++)
{
xlWorksheet.Cells[intCount2, "A"] = ReportDt.Rows[intCount][0];
xlWorksheet.Cells[intCount2, "B"] = ReportDt.Rows[intCount][1];
// xlWorksheet.Cells[intCount2, "C"] = ReportDt.Rows[intCount][2];
intCount2++;
}
xlWorksheet.Cells.Columns.AutoFit();
strMsg = "report successful";
return strMsg;
XMLはテキストです - それはできないものの "実行"。プログラムは、XMLを読んで解釈し、その情報で何かを行うことができます。 – Oded
メモ帳でxmlファイルを開くことができます。あるいは、[Notepad ++](http://notepad-plus-plus.org/)を試してみてください。指定された拡張子(この場合は.xml)のファイルを開くデフォルトのアプリケーションは、選択したアプリケーションに変更できます。 –
「confusion-of-ideas」というタグを付ける必要があります。@Oded:XMLはデータです。データは実行しません。途中でプレーンテキストデータなので、特別なエディタは必要ありません(しかし、まともなテキストエディタは非常に役に立ちます - メモ帳++では+1)。 – delnan