
|
View Full Version : XML development environment?? HELP
joe259 09-01-2005, 04:17 PM Hey folks..
I am new to XML, and need to create a site that will post/receive xml requests and responses to a server.
I have manually created and parsed my 1st project with php, but this seems very cumbersome.
Can someone recommend any tools useful in developing xml bases web pages?
At the basic level I want to create some uesr input forms, that will then get inserted into a xml document, receive then parse info.. What else would I do???
I would expect that there exists some applications that will parse the dtd, allow me to specify some input vars, and then create the xml for me?
Any recommomends or input would be greatly appriciated.
Thanks..
Joe
Froggy 09-03-2005, 03:39 AM I'm not so clear what you want to do but I think you are talking about sounds a lot like SOAP. Which is a way of making requests to a server (usually remote function/method calls) and then responding in XML. With PHP you have two options with soap.
If you are using php4 you can use Pear::SOAP if you have php5 you can use the soap extension (or you could still use the Pear::SOAP). From what I hear the soap extension has problems where as the Pear::SOAP works but is a bit slow.
If you say a bit more what you are going to do with the xml, I may be able to say more.
anjanesh 09-03-2005, 07:37 AM For PHP4 you can also try nuSOAP (http://sourceforge.net/projects/nusoap) - even Google uses it for its api examples.
joe259 09-03-2005, 03:34 PM I am setting up an ordering system that needs to Check Product Availabity, Take orders, check order status, allow order cancellation, and modification.
At the most basic level Im wondering how people do web devel for with XML?? Ive had a hard time finding any good docs, that would make XML development a little easier that just brute forcing my way though DTSs, and hard coding XML responses(w/ the exception of some variables that I set from a form post)..
Most of what I've found in terms of docs, really seems to overcomplicate XML, and its usage. Conceptually its so simple, and yet I've found using it to be a bit of a bear..
I will check out Soap..
Thanks.
Joe
joe259 09-03-2005, 03:49 PM Is there any graphical DTD parser?(my terminology could be off here)
Something that would parse a DTD, show you the name and type of elements, and perhaps generate a sample XML file based on the DTD?
Schema's look much more like what I'd expect to see, but my vendor only uses DTDs..
Any other useful Graphical XML tools but like to use?
Thaks.
JOe
Burhan 09-03-2005, 05:11 PM XML Spy from Altova is a great product for all things XML.
joe259 09-03-2005, 05:59 PM Looks like soap is it's own extension of XMLl?? And not useful if am an trying to integrate into an existing API that uses XML, and not SOAP wrapped XML???
Is that correct? Or am I misunderstand something?
sea otter 09-03-2005, 08:06 PM Let me see if I got this right:
You want to use a program/editor to design a web page, and have that program spit out xml (and further, have it validate against a dtd). You then want to display the xml as a "web page".
I put the last in quotes because to do that, you'd need to use xslt to render the xml content as (x)html.
(a) I hope I didn't confuse things more!
(b) Is this what you mean?
Froggy 09-04-2005, 04:29 AM hmm...I'm still not clear what you want to do. How about this...why is it that you need to use xml? What in your mind is it doing for you?
Also, at least if I remember correctly the software that fyrestrtr mentioned should allow you to make xslt stylesheets easily too (and test them..). But the software is a bit expensive. There are tons of free libraries that you can use that will validate xml against some DTD etc.
joe259 09-04-2005, 02:06 PM Well the reason I need to use XML is because that is what our vendor uses. So for me to put order in to the vendor, check status, etc.. I need to send requests via, XML, and receive responses via XML..
They have for me DTDs, and sample requests and responses. Which are quite verbose, considering the simplicity of what is really involved in the requests and responses..
I could easily manually read/parse/construct the XML by hand, using php's internal parsers, etc.. Which I have done for a couple requests already, but its just very laborious, and hard for me to believe that something simpler doesnt exist..
Im very new to XML, have read and read and read, and searched, and really haven't found any basic, HOWTO, regarding the topic. Most of it is very overcomplicated. So Im really just trying to find out what my optoins are. The XSL thing looks interesting. I d/led a trial of XML Spy and will be looking at that...
Bottom line, is I need to use XML, and Im trying to find out how people generally code for it... I figured there would be some good Graphical and code generating tools out there somewhere.. but I really only need the simplest..
Thanks..
Joe
Froggy 09-04-2005, 04:19 PM I need to send requests via, XML, and receive responses via XML..
Yeah this sounds like SOAP, are you sure they aren't using SOAP?
If its SOAP you can use the mentioned libraries to make your life much easier. If they use some sort of costum xml format then I think you're going to have to make your own library for accessing their service. Just make a nice API for it and then you only have to worry about how verbose it is once. Usually companies have libraries that help you with this, for example ebay uses SOAP and they have libraries in many different languages to make things easier.
Also XSLT is used to transform XML into some other format (say a different XML markup or...something else like latex). You can't use it to transform some text into XML, rather the opposite.
joe259 09-04-2005, 04:28 PM Unfortuately they dont use Soap.. They dont have an extra API.. All they have is DTD definitions...
I think all data is required so Im probably best off just hand coding and inserting my form vars as needed within the hand coded XML.. I dunno... but once it's done, yes its done, and I can move on...
I think XSLT will be nice for interpreting the responses.. Because mostly it is just a matter of displaying data, and not storing anything..
As far as creating I guess Im just going to create a page with forms that posts data to a .php page that will insert the form data into a handcoded XML var and then post that var to my vendors page..
Im playing with XMLSpy right, not, but considering this is a one shot deal.. Id probably be near done, if I just hand coded my way through from the beginning... but its also about learning and trying to be more efficient.. anyhow... Thanks for the info...
Joe
Burhan 09-05-2005, 02:37 AM They might be using XML-RPC. How do you send the XML request and recieve the response? This would help greatly.
In any case, if you are sending and recieving it using http, then its some form of 'web service' as its called.
I could easily manually read/parse/construct the XML by hand
For generating a XML document, you will have to do it 'by hand' as you call it. DTD are used to validate a XML document, not generate it. After all, for each request, your XML document's content will change.
For parsing XML though, there are a few options. There is, for example, the XML_Serializer class in PEAR that will convert a XML document into a PHP array.
There are also the DOM XML functions available for PHP that allow easy creation and parsing. If you are using PHP5, the SimpleXML extension makes it very easy to parse XML documents.
The 'native' XML functions (those that begin with xml_) use the Expat library for parsing -- which is non-validating (this means, it ignores any DTDs that are linked to the document). I believe the other parsing methods are also non-validating.
There are other ways of validating documents against a DTD -- if that is what you are concerned about.
|