は、Firefox 3.5.xのと3.6.xの上で動作するために使用次のJavaScriptブラウザの最近の変化によって窮地に立たされたが、それはもはやFirefoxの11.xのやSafari 5.1.xではでは行われませんJavascriptは私の専門ではないので、最近の変更をスピードアップするつもりはありません。DOMParserをとXSL
具体的には、[参照]ボタンは明らかにファイルを読み込んでいます(これは検証されていませんが、FCPからのXMLシーケンスの書き出しになります)が、[処理]ボタンを押すとXSLTの結果は以前のブラウザのバージョンと同じように '出力' DIV。
最近の変化であると考えられるので、http://johnpilgrim.net/color/jProcess.html
でテストのための適切なサンプルXMLファイルはhttp://johnpilgrim.net/color/sample.xml
のhtmlに変更何も、javascriptやXSLで利用できる文脈で見ることができますブラウザ。私はFirefoxで動作するように設計してテストしただけなので、他の何かでテストしたことはありません。
思考?ソリューション?
ありがとうございます! ジョン
<head>
<script type="text/javascript">
function jProcess(){
// Get the file contents locally, using the nifty Firefox 3 nsIDOMFile interface
var file_contents = document.getElementById('xml_file').files.item(0).getAsText("utf8");
// Cast/Convert to an XML Document
var parser = new DOMParser();
xmlDoc = parser.parseFromString(file_contents, "text/xml");
// XSLT Transformation
var xslt = document.implementation.createDocument("", "", null);
xslt.async = false;
xslt.load("jProcess.xsl");
var process = new XSLTProcessor();
process.importStylesheet(xslt);
var result = process.transformToFragment(xmlDoc, document);
// Show the output
document.getElementById('output').innerHTML= " ";
document.getElementById('output').appendChild(result);
return false;
};
</script>
</head>
<body>
<form method="post" onsubmit="return jProcess();">
<fieldset>
<legend>Select the XML file for the FCP sequence you want to process into HTML.</legend>
<input type="file" size=100 name="xml_file" id="xml_file">
<input type="submit" value="Convert">
</fieldset>
</form>
<div id="output"></div>
1のように見えます。 – Smandoli