Comments (16)
It would help if you could attach a full plist file that is parsing incorrectly.
Perhaps your problem has to do with the fact that ampersands must be escaped in
xml. For example, you can't do this:
<string>http://www.example.com?param1=1234¶m2=abcd</string>
you must instead do this:
<string>http://www.example.com?param1=1234¶m2=abcd</string>
I'm not sure if that is your problem, though. I get an exception if I don't
escape the ampersand, not a string truncation.
Original comment by [email protected]
on 1 Nov 2011 at 4:30
from plist.
Also if a string�object contains ' the text from the '&' is missing
Is this same issue?
Original comment by [email protected]
on 2 Nov 2011 at 1:09
from plist.
@durkjae: Probably - a string with "'" in it should be written as "'" in
the xml. In any case, I don't get an error when I do that, "'" gets translated
back into a single quote just fine when I try it.
Please, please, please! Attach the plist file you're having trouble with.
Makes debugging so much easier.
p.s. you probably shouldn't be typing xml - use an xml writer app (or this
library) which will do the escaping for you.
Original comment by [email protected]
on 2 Nov 2011 at 4:09
from plist.
@keith:
the ampersand is correctly escaped (&)
every text that contains an ampersand will be cropped (you can try it for
yourself)
i think the issue has something to do with the dom parser
Original comment by [email protected]
on 3 Nov 2011 at 1:06
from plist.
I had use this library(r45, r46) on Android 2.2 (API 8)
following data (refer attacted file) for parsing
...
<key>filepath</>
<string>Girl's Generation</string>
...
String filepath = rootDict.objectForKey("filepath").toString();
result from above code
The filepath has "Girl". Not "Girl's Generation"
Original comment by [email protected]
on 3 Nov 2011 at 3:36
Attachments:
from plist.
Hmm, works fine for me on both OS X and Windows. Must be something up with the
Android XML parser.
Original comment by [email protected]
on 3 Nov 2011 at 4:49
from plist.
This thread may have something to do with it:
http://stackoverflow.com/questions/1973483/android-xml-parsing-omitting-amp
We are just grabbing the first child of <string> from the parser (see
XMLPropertyListParser.java:169). If the Android XML parser is returning three
chunks of text, we'd miss the last two.
I'll have to think about the right way to fix this. This "feature" might
affect more than just <string>.
Original comment by [email protected]
on 3 Nov 2011 at 4:56
from plist.
Here's a bug filed against Android about this:
http://code.google.com/p/android/issues/detail?id=2607
Upshot: try adding "docBuilderFactory.setCoalescing(true);" right after
"docBuilderFactory.setIgnoringComments(true);" in XMLPropertyListParser.java:54
Let me know if that works. Sorry I can't try it myself, I don't have an
Android environment to test on.
Original comment by [email protected]
on 3 Nov 2011 at 5:08
from plist.
Oh! works fine on Android.
Thanks for your advice.
...
private static synchronized void initDocBuilderFactory() throws
ParserConfigurationException {
docBuilderFactory = DocumentBuilderFactory.newInstance();
docBuilderFactory.setIgnoringComments(true);
docBuilderFactory.setCoalescing(true);
}
...
Original comment by [email protected]
on 4 Nov 2011 at 2:14
from plist.
This issue was closed by revision r50.
Original comment by [email protected]
on 4 Nov 2011 at 3:03
- Changed state: Fixed
from plist.
I committed the fix, revision 50.
Original comment by [email protected]
on 4 Nov 2011 at 3:05
from plist.
I am using rev52 and I am still seeing this problem.
In the attached plist if you go to
AllSports > Item 0 > AllFeeds > Item 0 > FeedUrl you will see
http://www.meangreensports.com/rss.dbml?db_oem_id=1800&media=results
but when ever I do an objectForKey on "FeedUrl" I get
http://www.meangreensports.com/rss.dbml?db_oem_id=1800
everything after the & is cut off. Any suggestions?
Original comment by [email protected]
on 23 Nov 2011 at 8:19
Attachments:
from plist.
Please check whether you are actually using r52.
If you really are, please check whether the attached version works.
In the attached version all child nodes of a NSObject tag are joined together
to form the string. Normally the whole string should be identified as one node
by the parser. But the Android parser seems to work incorrectly in this regard.
Original comment by daniel.dreibrodt
on 23 Nov 2011 at 9:08
Attachments:
from plist.
Here's the Android bug about this:
http://code.google.com/p/android/issues/detail?id=2607
Sounds like there's no way to force coalescing of entities (unlike CDATA
sections, which is what setCoalescing is for).
Original comment by [email protected]
on 23 Nov 2011 at 11:31
from plist.
@daniel.dreibrodt looks like the attached jar file you provided did the trick!!
Thanks!!
Original comment by [email protected]
on 24 Nov 2011 at 2:02
from plist.
I commited the proper fix with r54.
Original comment by daniel.dreibrodt
on 24 Nov 2011 at 7:51
from plist.
Related Issues (20)
- XMLPropertyListParser throws NPE on empty data node. HOT 3
- Does not retain the order of the original dictionary object HOT 2
- Set private constructor of PropertyListParser to protected to allow subclassing. HOT 1
- Enhancement : Add functions to get Java types from NSObjects HOT 4
- .pbxproj hash identified converted to boolean HOT 3
- pbxproj needs strings encoding HOT 2
- OSGi support HOT 2
- NSDictionary allows null values which cause an NPE when building pList HOT 9
- Parsing a plist with an empty key throws a NPE HOT 2
- I cannot use your library on android HOT 1
- I cannot read this plist HOT 1
- Better generic support in NSArray in order to have typed arrays of NSDictionary, NSNumber, etc HOT 2
- OutOfMemoryError when parsing a binary plist file on Android HOT 3
- java.lang.ClassCastException: android.content.res.AssetManager$AssetInputStream cannot be cast to com.dd.plist.Base64$InputStream HOT 1
- NS String doesn't encode all XML characters that require encoding HOT 2
- Should not crash when parsing file < 8 bytes HOT 3
- Have NSNumber keep a copy of its source String HOT 6
- BinaryPropertyListParser incorrectly checking for OOM conditions HOT 1
- Nullpointer Exception while writing NSDictionary Object to plist file. HOT 2
- Not able to parse Info.plist file extracted from Hike.ipa file using r111 version, It is getting parsed in earlier versions. HOT 4
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from plist.