Giter Site home page Giter Site logo

Comments (16)

GoogleCodeExporter avatar GoogleCodeExporter commented on September 3, 2024
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&param2=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.

GoogleCodeExporter avatar GoogleCodeExporter commented on September 3, 2024
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.

GoogleCodeExporter avatar GoogleCodeExporter commented on September 3, 2024
@durkjae: Probably - a string with "'" in it should be written as "&apos;" 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.

GoogleCodeExporter avatar GoogleCodeExporter commented on September 3, 2024
@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.

GoogleCodeExporter avatar GoogleCodeExporter commented on September 3, 2024
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.

GoogleCodeExporter avatar GoogleCodeExporter commented on September 3, 2024
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.

GoogleCodeExporter avatar GoogleCodeExporter commented on September 3, 2024
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.

GoogleCodeExporter avatar GoogleCodeExporter commented on September 3, 2024
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.

GoogleCodeExporter avatar GoogleCodeExporter commented on September 3, 2024
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.

GoogleCodeExporter avatar GoogleCodeExporter commented on September 3, 2024
This issue was closed by revision r50.

Original comment by [email protected] on 4 Nov 2011 at 3:03

  • Changed state: Fixed

from plist.

GoogleCodeExporter avatar GoogleCodeExporter commented on September 3, 2024
I committed the fix, revision 50.

Original comment by [email protected] on 4 Nov 2011 at 3:05

from plist.

GoogleCodeExporter avatar GoogleCodeExporter commented on September 3, 2024
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.

GoogleCodeExporter avatar GoogleCodeExporter commented on September 3, 2024
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.

GoogleCodeExporter avatar GoogleCodeExporter commented on September 3, 2024
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.

GoogleCodeExporter avatar GoogleCodeExporter commented on September 3, 2024
@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.

GoogleCodeExporter avatar GoogleCodeExporter commented on September 3, 2024
I commited the proper fix with r54.

Original comment by daniel.dreibrodt on 24 Nov 2011 at 7:51

from plist.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.