XUpdate in PHP classes?

Ye' old general discussion board. Basically, for everything that isn't covered elsewhere. Come here to shoot the breeze, shoot your mouth off, or whatever suits your fancy.
This forum is not for asking programming related questions.

Moderator: General Moderators

Post Reply
pbysera
Forum Newbie
Posts: 5
Joined: Fri May 05, 2006 7:54 am

XUpdate in PHP classes?

Post 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
User avatar
Weirdan
Moderator
Posts: 5978
Joined: Mon Nov 03, 2003 6:13 pm
Location: Odessa, Ukraine

Post 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
pbysera
Forum Newbie
Posts: 5
Joined: Fri May 05, 2006 7:54 am

Post 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
User avatar
Weirdan
Moderator
Posts: 5978
Joined: Mon Nov 03, 2003 6:13 pm
Location: Odessa, Ukraine

Post 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.
pbysera
Forum Newbie
Posts: 5
Joined: Fri May 05, 2006 7:54 am

Post 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
User avatar
Weirdan
Moderator
Posts: 5978
Joined: Mon Nov 03, 2003 6:13 pm
Location: Odessa, Ukraine

Post 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? :)
pbysera
Forum Newbie
Posts: 5
Joined: Fri May 05, 2006 7:54 am

Post by pbysera »

:D 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 ;)
pbysera
Forum Newbie
Posts: 5
Joined: Fri May 05, 2006 7:54 am

Post by pbysera »

So, does anybody join to this discussion?
User avatar
feyd
Neighborhood Spidermoddy
Posts: 31559
Joined: Mon Mar 29, 2004 3:24 pm
Location: Bothell, Washington, USA

Post by feyd »

pbysera wrote:So, does anybody join to this discussion?
Sure. Don't bump.
[url=http://forums.devnetwork.net/viewtopic.php?t=30037]Forum Rules[/url] Section 1.1 wrote:4. All users of any level are restricted to bumping (as defined here) any given thread within twenty-four (24) hours of its last post. Non-trivial posts are not considered bumping. A bump post found in violation will be deleted, and you may or may not recieve a warning. Persons bumping excessively be considered as spammers and dealt with accordingly.
User avatar
Weirdan
Moderator
Posts: 5978
Joined: Mon Nov 03, 2003 6:13 pm
Location: Odessa, Ukraine

Post 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.
timvw
DevNet Master
Posts: 4897
Joined: Mon Jan 19, 2004 11:11 pm
Location: Leuven, Belgium

Post 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>
Post Reply