I have some documents that are structured using SGML, and I have a DTD file which describes this structure.
Can someone recommend a Python-3 compatible library or module to me to parse this data? For Python 2.x my Google-fu seems to turn up SGMLParser, but that of course is now deprecated (and outright removed from Py3k).
Many seem to suggest lxml, but that is not an option for me due to dependency issues.
I know BeautifulSoup is great for messy markup, but A) last I heard it wasn't py3k compatible, and B) this content is well-structured.
BeautifulSoup is deprecated. Use the replacement instead, which is Py3k compatible:
BeautifulSoup4
Related
I'm trying to find more information / explanation for the following scenario:
I'm writing a library in Swift and would like to use some open source library in it.
If I just integrate them into my library, is there a chance of namespace collision?
What would happen if the host app will use:
The exact same open source library
The same library but different version
Does using CocoaPods changes something here?
Consider a scenario where I import AFNetworking for example (via CocoaPods) in my library, and the host app will use it too.
Using the same library, you won't have any issues. Using different version will likely cause problems, but that is going to be dependent on the changes made in the different versions.
Namespace collisions in Swift are rare. As #mattt stated, each module acts as a namespace, so naming conflicts with classes or functions from another module won't exist as they do in Objective-C. If you have a naming conflict, the compiler will tell you. In that case, you can just prefix the conflicting signature with the module name.
I would highly recommend you use Cocoapods for dependency management. It handles version control and will make your life much easier.
Hello stackoverflow community..
Currently I'm developing a Crossplatform-App (android/iOS) which generates beside its other features pdf-files from user-content.
This works well with the help of jsPDF.
The output of this awesome library is an base64 encoded string of the binary PDF-File.
(see this issue of the creator about the 'binaryness' of pdf files under different circumstances on github).
Now my actual problem:
I need to save this base64 as a proper decoded binary file for further usage on different aspects of the system (mailing it, printing it, a.s.o.).
For Android there is a Plugin that does a similar thing with images. My current plan is to modify and publish it as a more generic plugin for saving base64 encoded to a file.
Problem is now, I cannot find a similar code for iOS, and since I have literally no experience in Objective-C (plenty of Java, ruby, javascript and c though), I'm not able to produce such a plugin in short time.
Do you guys know a plugin of this kind, which can be modified with little Objective-C knowledge.
Perhaps there is someone interested in developing this kind of plugin and we cut could a deal (the project I'm working on is commercial)
Hope to hear some interesting responses, because I'm running out of ideas here :D
Greetings
Jakob
Quick Clojure question from a Clojure noob:
we need to parse text files for our project, and are looking at using fnparse to get the job done.
What do we need to add to project.clj for leiningen to manage this dependency?
We've already tried adding [name.choi.joshua.fnparse "2.2"] to :dependencies, but lein deps then fails to find it.
We're worried that maybe we can't use leiningen for this library. In that case, are there other good parsing libraries out there for Clojure?
I recently dicovered the lein search command. is is sometimes incredibly helpful in cases like this:
lein search fnparse
== Results from clojars - Showing page 1 / 4 total
[org.clojars.hiredman/fnparse "2.2.4"] A library for creating functional parsers in Clojure.
[org.clojars.ohpauleez/fnparse "3.0.0alpha4"] A library for creating functional parsers in Clojure.
[fnparse "2.2.7"] A library for creating functional parsers in Clojure.
[fnparse "3.?.4"] A library for creating functional parsers in Clojure.
Looking on Clojars, it appears the correct dependency is just [fnparse "2.2.7"].
I'm trying to write an IDE for the iOS and I stumbled on a problem. I of course wanted to be able to do syntax highlighting, but I have no idea how I have to get this to work.
I have been googling over a month now, but I haven't found anything useful. Most libraries are C++. That I find no problem, I know enough of C++, but they all use the Boost libraries and I heavily doubt if it's easy to install them on a jailbroken iOS device, or even compile them for the iOS on the Mac.
So I come here for help. What should I do? Should I use a PHP syntax highlighter, which always colors the whole document? Should I write a syntax highlighter my self, that doesn't use the Boost library? Or does somebody here know another library, which can be used on the iOS?
Thank you in advance,
ief2
i have a simillar problem about syntax highlighting, but i prefer to solved it using UIWebview than using core text, because that is a different pixel in rendering text in core text and UITextview (in my problem i was using a core text view that cover by uitextview), and then i try to solved using uiwebview, even i'm still on developing but i can say that it is better using uiwebview than core text, maybe you can take a look at this link http://alexgorbatchev.com/SyntaxHighlighter/ it is an open source code, but it develop using javascript.
Most Boost libraries are header-only. There are only a few Boost libraries, like those for threading and asynchronous I/O, that use a compiled library. If you've found some solutions that would work fine aside from your worries about using Boost, then I would look at them again, as they'll likely work. Even if you must use a Boost library that is not header-only, you can always build it as a static library and link that into your application, so that in the end the only thing that needs to be installed is just your app bundle.
I know this is old, but in case anybody is looking for a complete syntax highlighter for iOS, there's two options:
Highlightr: A Swift library for syntax highlighting, supports hundreds of languages but uses JS as backend. It's fast enough for live editing, though. (Disclaimer: I am the creator of this library).
SyntaxKit: A native solution on early stages of development. Should support any TextMate syntax in the future.
I am developing an app for iPad, and I need to modify several attributes in a XML file at runtime.
I found the class NSXMLDocument. But I haven't been able to import it to my project.
Is this class not available for iPhone/iPad development?
Is there some other approach I can consider?
I read about libxml library. Is it my answer or there is a better approach?
NSXMLDocument is MacOS X Cocoa only. You have available on iPhone NSXMLParser, and several external libraries built on libxml2 - TouchXML, KissXML and a couple of others.
Note that KissXML supports writing XML.
Other XML libraries that have been suggested include the XML support from Google Data and VTD-XML.
You are looking for a DOM XML parser, which is best for modification of XML documents. See for example this tutorial - without mapping to and from Model Objects - use the XPath.