https://github.com/sara-nl/js-webdav-clientが機能しませんでした
jQueryを使用してXMLファイルを読み取りました。
var URL = window.location.href;
var baseURL = URL.substring(0, URL.lastIndexOf('/'));
$.ajax({
type: "OPTIONS",
url: baseURL,
contentType: "text/xml", //for other files look up the api link below
headers: {Depth: "0"},
data: '<?xml version="1.0" encoding="utf-8" ?><D:options xmlns:D="DAV:"><D:activity-collection-set></D:activity-collection-set></D:options>',
success: function(data1, status, jqxhr){
latestRev = jqxhr.getResponseHeader('SVN-Youngest-Rev');
$.ajax({
type: "PROPFIND",
url: baseURL + '/!svn/rvr/' + latestRev,
contentType: "text/xml",
headers: {Depth: "0"},
data: '<?xml version="1.0" encoding="utf-8" ?><propfind xmlns="DAV:"><prop><resourcetype xmlns="DAV:"/></prop></propfind>',
success: function(data2, status, jqxhr){
$.ajax({
type: "OPTIONS",
url: baseURL,
contentType: "text/xml",
headers: {Depth: "0"},
data: '<?xml version="1.0" encoding="utf-8" ?><D:options xmlns:D="DAV:"><D:activity-collection-set></D:activity-collection-set></D:options>',
success: function(data3, status, jqxhr){
$.ajax({
type: "REPORT",
url: baseURL + "/!svn/me",
contentType: "text/xml",
data: '<S:update-report xmlns:S="svn:"><S:include-props>yes</S:include-props><S:src-path>/svn/check</S:src-path><S:target-revision>' + latestRev + '</S:target-revision><S:depth>unknown</S:depth><S:entry depth="infinity" rev="' + latestRev + '"></S:entry></S:update-report>',
success: function(data4,status,jqxhr){
svnSpecs = data4;
$.ajax({
type: "GET",
url: '/svn/check/!svn/rvr/' + latestRev + '/KickOff.xml',
converters: {"text xml": function(obj) {
hashBase = calcMD5(obj);
return obj;
}},
cache: false,
async: false,
success: function(data5, status, jqxhr){
hashdata5 = calcMD5(data5);
xmlString = $($.parseXML(data5));
drawTable(xmlString);
},
});
},
});
},
});
},
});
},
});
xml以外のファイルをインポートする場合は、http://api.jquery.com/jQuery.ajax/で検索してください。
で、data4/svnSpecs
xml内で使用したすべてのキーワードを見つけることができます-xmlStringの場合と同じようにします
xmlString内の最初のオブジェクトのコンテンツをHarryに設定するa = xmlString.find("Member");
と、xmlのmemberという名前のすべてのオブジェクトを含む配列が取得されます->後でテーブルを更新するだけで済みますa[0].textContent = "Harry";
drawTable()
編集: methode
内で、既存のテーブル「membertable」にすべてを書き込むために、、およびを実行drawTable()
する必要がありますa.find("")
var list = [];
list.push("html text for a table")
$("#membertable").html(list);
コミットするhashBase
ために重要です。コミットは完了していませんが、ほぼ完了しています。現在のコードとプロセスはここにあります:SVNを実行する方法http-html内でチェックイン/コミットを要求する