我必须在运行时动态生成一个xml文件.请帮我用PHP动态生成以下XML文件.
<?xml version="1.0" encoding="UTF-8"?>
<xml>
<track>
<path>song1.mp3</path>
<title>Track 1 - Track Title</title>
</track>
<track>
<path>song2.mp3</path>
<title>Track 2 - Track Title</title>
</track>
<track>
<path>song3.mp3</path>
<title>Track 3 - Track Title</title>
</track>
<track>
<path>song4.mp3</path>
<title>Track 4 - Track Title</title>
</track>
<track>
<path>song5.mp3</path>
<title>Track 5 - Track Title</title>
</track>
<track>
<path>song6.mp3</path>
<title>Track 6 - Track Title</title>
</track>
<track>
<path>song7.mp3</path>
<title>Track 7 - Track Title</title>
</track>
<track>
<path>song8.mp3</path>
<title>Track 8 - Track Title</title>
</track>
Run Code Online (Sandbox Code Playgroud)
getRealPath()
返回本地系统中的实际路径,但在与.war
文件一起部署时返回null .
<%@ page import="java.io.*" %>
<%@ page contentType="text/html;charset=ISO-8859-1" %>
<%
int iLf = 10;
char cLf = (char)iLf;
String a= application.getResource("/");
//String myfile = application.getRealPath("/")+ "generate.xml";
//String myfile = request.getContextPath()+"generate.xml";
//String myfile = request.getRealPath("/")+"generate.xml";
out.println(myfile);
File outputFile = new File(myfile);
outputFile.createNewFile();
FileWriter outfile = new FileWriter(outputFile);
outfile.write(" <?xml version='1.0' encoding='UTF-8'?> "+cLf);
outfile.write(" <playlist version='1' xmlns = 'http://xspf.org/ns/0/' > " +cLf);
outfile.write(" <title>My Band Rocks Your Socks</title> "+cLf);
outfile.write("<trackList>"+cLf);
%>
<%! String[] sports; %>
<%
sports = …
Run Code Online (Sandbox Code Playgroud) 我在windows中生成了.jar文件.
我必须在unix中执行.jar文件.
我正在运行那个命令(java -jar myJar.jar
),但它正在给予
java.lang.UnsupportedVersionError
Run Code Online (Sandbox Code Playgroud)
我在Unix中使用java版本1.5.0.12.
declare
begin
for i in (select * from emp)
loop
if i.sal=1300 then
update emp
set sal=13000;
end if;
end loop;
end;
Run Code Online (Sandbox Code Playgroud)
这段代码用工资13000更新所有记录.
相反,我想将工资1300的记录更新为13000.
你能告诉我哪里弄错了吗?
我正在使用隐式游标访问记录..
对于我正在检查该记录的sal值的每条记录..
如果特定记录中的工资值是1500,我想将其更新为15000 ..
我有两个变量:X和Y.
X的值将是以mmddyy格式给出的日期 ,我想计算该日期之前的日期,并以yyyymmdd格式返回.
让我给你举个例子.当X ="091509"(mmddyy格式)时,Y应为"20090914"(yyyymmdd格式)
当我运行player.php时,它会给出这个错误:
Warning: Cannot modify header information - headers already sent by (output started
at /www/110mb.com/m/u/s/i/c/k/i/n/musicking/htdocs/player.php:8) in
/www/110mb.com/m/u/s/i/c/k/i/n/musicking/htdocs/player.php on line 24
Run Code Online (Sandbox Code Playgroud)
你能帮忙吗?
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Player</title>
</head>
<body>
<?php
if(isset($_POST["song"])&& $_POST['song'] != "")
{
$song = $_POST["song"];
}
else {$song=array();}
for ($i="0"; $i<count($song); $i++) {
}
//start of new php codep
// create doctype
//$array = array(
// 'song.mp3','song.mp3','song.mp3',
//);
$dom = new DOMDocument("1.0");
// display document in …
Run Code Online (Sandbox Code Playgroud) trade.dat是我的文件,由数据行组成.
我必须用逗号(,)连接该文件的每一行
请帮帮我