design question

A

Ajay

hi!

I am trying to write an application, say myapp, which does some xml
processing and then interacts with another application, say app2.
App2 is in Python and i can't change it.

The problem is that both my app and app2 must work on a pocket pc. I could
write myapp in Python but the python WinCE release does not have the
pyexpat parser and i cant find any other fast xml processor for a PDA.
There is a python only processor but that is way too slow.
my options as i see it are:

1. write myapp in c, compile to a dll using embedded visual c++ and write a
python wrapper around it, which then interacts with app2. The problem here
is again the parser. i am not writing my own, i don't know if msxml can
work on a PDA. Has anyone been down this road before. if yes, i'd love to
hear how you went about it and any suggestions you may have.

2. compile expat for pda using evc. the trouble is i myapp will use DOM and
expat is event driven. i will need to write code to build the whole DOM
hierarchy.

3. try and port the PyXML package to the PDA along with expat. A daunting
task and not one that i think i can achieve.

4. use c#.net to write myapp, compile to dll and then call from python. i
am not sure if this will work. i could alternatively use python.net but i
am not sure if that will work on the PDA.

and that exhausts the list of options i have.
i would really very much appreciate it if you could reply with any
alternatives that i could pursue or how i can go about implementing one of
the options above.

thanks

cheers
 
A

Alan Kennedy

[Ajay]
I am trying to write an application, say myapp, which does some xml
processing and then interacts with another application, say app2.
App2 is in Python and i can't change it.

Show us a couple of simple examples of the type of XML processing you
need to do.

There may be simple ways to achieve your goals that don't actually
require an XML parser at run time, or that would be efficient enough
given a pure python parser/etc. It depends heavily on what type of XML
processing you're doing.
 
A

Ajay

hi!

there is a W3 standard for expressing privacy policies called P3P. what my
application needs to do is to examine a privacy policy defined by a
service against user preferences for privacy expressed using APPEL.
so eg: my privacy policy could say what sort of data i collect, whats its
used for, how long its kept, whether identifying data is taken, who all
can access the data and so on.
the user can define his preferences as a set of rules. eg: rule 1 may say
dont allow any site that wants my name. rule2 may say block any sites that
take idenitfying data. rule3 may say allow all sites under the domain
www.w3.org. rule4 may say prompt me everytime a service wants data that is
kept for more than 3 days. and so on....

there are a number of p3p user agents that do this. explorer has one i
believe. ibm have something called privacy bird.

so thats what i need to do. i read the policy and preferences as DOM
hierarchies and then starting from rule1 in the preference, i examine it
against the policy.

i have already got it done in python (it was a matter of reimplementing the
evaluator written in Java by an organization called the Joint Research
Centre) and it works fine on a pc. the trouble is using it in a PDA.

cheers


Quoting Alan Kennedy said:
[Ajay]
I am trying to write an application, say myapp, which does some xml
processing and then interacts with another application, say app2.
App2 is in Python and i can't change it.

Show us a couple of simple examples of the type of XML processing you
need to do.

There may be simple ways to achieve your goals that don't actually
require an XML parser at run time, or that would be efficient enough
given a pure python parser/etc. It depends heavily on what type of XML
processing you're doing.
 
I

Istvan Albert

Ajay said:
so thats what i need to do. i read the policy and preferences as DOM
hierarchies and then starting from rule1 in the preference,

Do you really need a DOM representation for this? It seems to me that
you are sequentially reading the XML file to extract the
rules from it.

Try element-tree for a simple and fast, pure-python XML representation.

http://effbot.org/zone/element-index.htm

Istvan.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads


Members online

No members online now.

Forum statistics

Threads
474,205
Messages
2,571,067
Members
47,673
Latest member
MahaliaPal

Latest Threads

Top