Page 1 of 1
XUpdate in PHP classes?
Posted: Fri May 05, 2006 8:03 am
by pbysera
Hi!
I'm trying to find out how can I use XUpdate to make changes in XML-files in PHP code.
I've read some articles about XUpdate, but there are only common words about XUpdate
syntax

.
Can you help me- How to apply XUpdate-construction to xml-file in PHP???
Thanks
Posted: Fri May 05, 2006 8:47 am
by Weirdan
you would need
Xindice+
xindice-xmlrpc package. Then you would be able to query the webservice the latter package provide over
xmlrpc protocol according to
xindice-xmlrpc API
Posted: Fri May 05, 2006 9:06 am
by pbysera
is it only way?
Can I operate with XUpdate construction like XSL-transformation? In other words-
use XUpdate with PHP Classes only, without any engine (like Xindice)?
Thanks
Posted: Fri May 05, 2006 9:23 am
by Weirdan
I'm not aware of any such implementation of XUpdate...
And if any such solution exist, I imagine it would be slow as hell comparing to standalone xml database (it's like comparing awk to sql for operations on tabular data).
What is your concrete task? It could be that XUpdate is far from optimal solution, depending on what you need to acomplish.
Posted: Fri May 05, 2006 9:40 am
by pbysera
I'm interested in server-side transformation XML-documents to HTML-forms for editing this XML-document...
Something like this:
XML+XSD --- (PHP) --- HTML Form --- (PHP - XUpdate!!!)--XML
Posted: Fri May 05, 2006 10:42 am
by Weirdan
IMHO, for production purposes it looks like the following scheme much more robust:
xml+xsd->php->database->php->html form->php->database->php->xml
Unless it's for experimental purposes, it's usually advised to use relational databases to keep the data (especially large amounts of it). XML is not designed for handling updates, you know

What is this for? Web-clone of MS InfoPath?

Posted: Fri May 05, 2006 4:34 pm
by pbysera

Of course, relation DB is the best way to keep the data, but it's much more esier IMHO for people think about hierarchically model rather then constraints and relations

.
So, you suggest to use DB (MySQL) to keep temporary data and use PHP for transformation this data?But, for what this step: "xml+xsd->php->database->"? We can use DB only

... My subject is "Разработка подходов к доступу к XML-структурированным данным"
My ICQ - 339349626

Posted: Fri May 05, 2006 6:17 pm
by pbysera
So, does anybody join to this discussion?
Posted: Fri May 05, 2006 7:06 pm
by feyd
pbysera wrote:So, does anybody join to this discussion?
Sure. Don't bump.
Posted: Sat May 06, 2006 4:20 am
by Weirdan
pbysera wrote:it's much more esier IMHO for people think about hierarchically model rather then constraints and relations

.
Then you might want to research
hierarchical databases... while not strictly xml, they are closer to xml structure then relational db engines.
pbysera wrote:But, for what this step: "xml+xsd->php->database->"? We can use DB only

I thought you had data in xml files already. And it doesn't seem too hard to implement XSD -> SQL DDL converter... perhaps you could write XUpdate+XQuery -> SQL converter as well. Then you could claim you were first to develop xml wrapper around RDBMS in php
pbysera wrote:
... My subject is "Разработка подходов к доступу к XML-структурированным данным"
Master's thesis in CS, right?

Rough traslation to English: "Methods of accessing to XML structured data"
pbysera wrote:
My ICQ - 339349626
I'd suggest to keep technical discussion here for a variety of reasons, including wider audience, the benifits the community could get, etc.
Posted: Sat May 06, 2006 6:38 am
by timvw
If i understood your requirements well, you simply want:
(1) translate XML with XSL into XHTML
(2) update the XML with an XUPDATE document generated on basis of what the user submitted
To me it seems a bit complicated because you first have to generate an XUPDATE document, and then you still have to find an XUPDATE processor that isn't really available (afaik) for PHP yet. If you're going to implement one i would suggest that you implement one in XSL this way it becomes available for all platforms that have an XSL processor
The following seems easier (to me) and you can still present the
(1) generate XML with data coming from SQL DBMS and translate that XML into XHTML with a XSL
(2) update data in SQL DBMS on basis of what the user submitted
<off-topic->
A hierarchical model can be easily represented in terms of relationships (think about an abstract tree with one root, nodes and leaves)..
The real problem is that SQL and most SQL DBMS don't handle this kind of relationships well... Another proof that SQL is far from optimal to query 'True' Relational datbases

</off-topic>