Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>I have same issue when running my app on emulator Android 2.1. Although for 2.2 it works perfectly. The version of the dom4j lib I am using is v1.6.</p> <p>As you can see from the following extract all attribute names are replaced with the name of the first attribute in my xml file:</p> <pre><code>&lt;?xml version="1.0" encoding="UTF-8"?&gt; &lt;!DOCTYPE ncx PUBLIC "-//NISO//DTD ncx 2005-1//EN" "http://www.daisy.org/z3986/2005/ncx-2005-1.dtd"&gt;&lt;ncx xmlns="http://www.daisy.org/z3986/2005/ncx/" version="2005-1"&gt; &lt;head&gt; &lt;meta version="dtb:uid" version="6efac3c8-0d51-46bd-b125-58dae01bf92e"/&gt; &lt;meta version="dtb:depth" version="4"/&gt; &lt;meta version="dtb:totalPageCount" version="0"/&gt; &lt;meta version="dtb:maxPageNumber" version="0"/&gt; &lt;/head&gt; &lt;docTitle&gt; &lt;text&gt;Book&lt;/text&gt; &lt;/docTitle&gt; &lt;navMap&gt; &lt;navPoint version="navPoint-1" version="1"&gt; &lt;navLabel&gt; &lt;text&gt;Header1&lt;/text&gt; &lt;/navLabel&gt; &lt;content version="Text/Section0001.xhtml"/&gt; &lt;navPoint version="navPoint-2" version="2"&gt; </code></pre> <p>When the actual xml is :</p> <pre><code>&lt;?xml version="1.0" encoding="UTF-8"?&gt; &lt;!DOCTYPE ncx PUBLIC "-//NISO//DTD ncx 2005-1//EN" "http://www.daisy.org/z3986/2005/ncx-2005-1.dtd"&gt; &lt;ncx xmlns="http://www.daisy.org/z3986/2005/ncx/" version="2005-1"&gt; &lt;head&gt; &lt;meta name="dtb:uid" content="6efac3c8-0d51-46bd-b125-58dae01bf92e"/&gt; &lt;meta name="dtb:depth" content="4"/&gt; &lt;meta name="dtb:totalPageCount" content="0"/&gt; &lt;meta name="dtb:maxPageNumber" content="0"/&gt; &lt;/head&gt; &lt;docTitle&gt; &lt;text&gt;Book&lt;/text&gt; &lt;/docTitle&gt; &lt;navMap&gt; &lt;navPoint id="navPoint-1" playOrder="1"&gt; &lt;navLabel&gt; &lt;text&gt;Header1&lt;/text&gt; &lt;/navLabel&gt; &lt;content src="Text/Section0001.xhtml"/&gt; &lt;navPoint id="navPoint-2" playOrder="2"&gt; </code></pre> <p>It seems that xml document is parsed incorrectly. Here is my source code:</p> <pre><code>inputStream = new FileInputStream(ncfPath); SAXReader reader = new SAXReader(); // dom4j SAXReader Document document = reader.read(inputStream); String xml = document.asXML(); </code></pre> <p>Let me know if you have found solution for this issue.</p> <p><strong>EDIT:</strong> same issue for the dom4j 2.0 alpha 2 <strong>EDIT2:</strong> finally I've found a solution. The problem indeed in dom4j source code. Here is the <a href="https://sourceforge.net/tracker/index.php?func=detail&amp;aid=2789052&amp;group_id=16035&amp;atid=116035#" rel="nofollow">link</a> to the issue recorded almost two years(!) ago. To fix it you need correct following method in <em>\dom4j-1.6.1\src\java\org\dom4j\tree\NamespaceStack.java</em>:</p> <pre><code>public QName getAttributeQName(String namespaceURI, String localName, String qualifiedName) { // Fix: qualifiedName is empty on Android 2.1 // refer to https://sourceforge.net/tracker/index.php?func=detail&amp;aid=2789052&amp;group_id=16035&amp;atid=116035# if (qualifiedName == null || qualifiedName.length() == 0) { qualifiedName = localName; } </code></pre>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload