我使用EXIficient將XML數據轉換爲EXI並轉換回XML。在這裏,我使用他們的EXIficientDemo class。示例代碼:缺少名稱空間信息在使用EXIficient的XML文件中
EXIficientDemo sample = new EXIficientDemo();
sample.parseAndProofFileLocations("FilePath");
sample.codeSchemaLess();
首先,它轉換XML文件EXI然後再返回到XML,當它生成以前生成EXI的XML文件,它就會失去大約命名空間的一些信息。
實際的XML文件:
<?xml version="1.0" encoding="utf-8"?>
<tt xml:lang="ja" xmlns="http://www.w3.org/ns/ttml"
xmlns:tts="http://www.w3.org/ns/ttml#styling"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<body>
<div>
<p xml:id="s1">
<span tts:origin="somethings">somethings</span>
</p>
</div>
</body>
生成的XML文件通過EXIficient
<?xml version="1.0" encoding="UTF-8"?>
<ns3:tt xmlns:ns3="http://www.w3.org/ns/ttml"
xml:lang="ja"xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<ns3:body><ns3:div>
<ns3:p xml:id="s1">
<ns3:span xmlns:ns4="http://www.w3.org/ns/ttml#styling"
ns4:origin="somethings">somethings</ns3:span>
</ns3:p>
</ns3:div></ns3:body>
在生成的XML文件,它缺少xmlns:tts="http://www.w3.org/ns/ttml#styling"
如何修復這個問題呢?如果可以的話,請幫助我。
編輯的問題。請現在看看。在這裏,使用ttml#樣式,但它仍然不包括在內 –