Version for compact framework?

Topics: Developer Forum, Project Management Forum
Dec 28, 2009 at 1:21 PM

I have seen unanswered topic http://htmlagilitypack.codeplex.com/Thread/View.aspx?ThreadId=21020 two years ago

However I am wondering if there is a chance or possibility to port it for compact framework 2.0 or 3.5 since compact framework lacks of xpath support (missing XPathNavigator, XsltArgumentList, XPathNodeType, IXPathNavigable, XPathNamespaceScope) and I really dont want to rewriting those classes for CF

I just want to parse (on mobile device) some invalid (x)HTML document as XML but it looks like that there is no solution available

I really hate using regexp to parse html, but I guess that I have tied hands.

Coordinator
Dec 29, 2009 at 9:07 AM

Well, as you said, XPATH is not supported on CF, but you can remove this from the original Html Agility Pack project and recompile (hopefully using some #if to keep the version), as the parser is using regular .net c# code, and XPATH support is more a satellite feature.

I don't think it's too much work :)

Dec 29, 2009 at 1:20 PM

It is too much work! At least for someone who is not familiar with the project... using #if to uncomment some blocks of code is not enough, there are still plenty other methods / classes that are not implemented as well in (Xslt, IO.File, Environment) and I am not so familiar with this project so I can not tell which class is required and which is not to finish my task. Well I can't force anyone to rewrite the code for me, so it does not matter. 

Dec 29, 2009 at 2:08 PM

Hum... a version for the compact framework... sounds interesting. Which mobile device were you developing for my I ask?

So anyways we'd have have to decompile and include any classes that are required for the project so that we could make a CF version. I think it sound like fun.

 

Dec 29, 2009 at 2:48 PM

Yeah, you should definetly do it, it will be lot of fun :)

I am developing for Windows Mobile 5.0 PocketPC. The subset of classes for PocketPC is much richer than for Smartphones

 

 

 

Dec 29, 2009 at 3:27 PM

I actually have quite a bit of experience in this area. I maintain a few libraries including a client access library for my work's proprietary connection protocol for legacy PICK systems (some dating back to the late 60's). The library supports .NET 1-3.5 and .NET CF 1-3.5. We have specific builds for .NET 1.1, .NET 2.0, .NET 3.5, .NET CF 1.0, .NET CF 2.0 and .NET CF 3.5. The library's source code is all shared utilizing linked source files and partial classes for the .NET 2.0 and above differences. For the .NET 1.0-1 builds the differences are handled with the precompiler #if directives.

I've done many projects on .NET CF from 1.0 and up. We make warehouse management systems for Symbol Barcode readers that run pocketpc. I've also done a good amount of work for Microsoft Windows Mobile marketing team building installation systems for their cell phone partners.

The version of Win Mo 5 you speak of supports all versions currently out of .NET CF (1.0-3.5). Which version are you targeting? The newer the easier it may be to implement. .NET CF has some rather large chunks missing. I would say we could include the parsing engine and remove the xpath system in favor of LINQ for .NET CF 3.5. That would probably be the easiest route

@kurtnelle, decompiling .NET classes and including them would violate the license for .Net. We'd need to find open source alternatives or write our own if we want to keep the xpath system.

Dec 29, 2009 at 3:44 PM

Well that sounds like a good news. My (hobby academic) project was originally targeted to .NET CF 2.0 but there is no problem to upgrade it to 3.5

Dec 29, 2009 at 3:58 PM

have you by chance used Strongly Typed Datasets in your project? if so upgrading will be a bit more painful. I've found that the xsd's need to be reimported to have it work again.

 

Dec 29, 2009 at 4:06 PM

I have recently sucessfully deployed the project with .NET CF 3.5 without errors and run it on my device while testing Visual Studio 2008. Maybe I am a just a lucky guy :)

Dec 29, 2009 at 11:58 PM

Hi.


I downloaded the source, removed any reference to the IXPath thigo and also removed String.Split references and now everything works like a charm :)

Dec 30, 2009 at 12:37 PM

Right I forgot that little fact about the Framework licence; stupid. Well at any rate we could roll our own, albeit it's much harder. Good to know you've got CF experience; I think I'll go get up to speed on that this weekend.

@techi, lucky uh? Sounds dubious :)

 

Jan 1, 2010 at 9:47 PM

perhaps the mono project has xpath classes that can be borrowed/ported?

Jun 2, 2010 at 10:45 AM

hi everybody,

im very confused about this problem, because im also want to develop an app for windows mobile, which needs to parse websites with xpath. i tried so many things like using classes from the monoprojekt, deleting references to xpath and so on... nothing brought to work :(

Is there no chance to port this beautyful library to the compact framework? Please let me now.

 

Jun 2, 2010 at 3:49 PM
I just did some playing around and got it to compile for .NET CF 3.5 . The caveats are no XPATH support and HtmlWeb class was removed, as with Silverlight too many things are missing. I'll run some tests on it and if they all pass then I'll commit my changes to SVN. As an alternative to XPATH you'll need to use LINQ to Objects . Unfortunately most of our XPATH stuff relies on XPathNavigator quite heavily and it will be rather difficult to updated to the .NET CF's rudimentary XPATH support.
Jul 2, 2010 at 2:38 AM

so when will teh CF version available?

 

--
HTML Agility Pack Test Bed

Jul 2, 2010 at 2:43 AM

It's available in the svn repo right now. Not sure when I'm going to get around to making a public binary for it. I haven't had enough time to give it a good enough test

Aug 6, 2010 at 5:39 AM
darthobiwan wrote:

It's available in the svn repo right now. Not sure when I'm going to get around to making a public binary for it. I haven't had enough time to give it a good enough test

 

Is it in trunk ? Couldn't find anywhere.

Aug 9, 2010 at 1:27 AM

Yes it is in trunk in the folder HAPCompact. It is found in the 2008 solution since VS 2010 no longer supports .NET Compact Framework

Jun 3, 2014 at 3:16 AM
I want to get mor useful and detailed information on the mentioned barcode reader. I have donens of 2d barcodes need to be scanned by using a simpel to use barcode reading application.
Feb 5, 2015 at 8:12 PM
I can't make HtmlAgilityPack cf2.0 reference working with System.Xml cf3.5 version. Does anyone knows how to do that? My WinCE device has 3.5 cf.