PDA

View Full Version : Have Schema, don't know what's next...


Projectus
08-14-2006, 06:50 PM
hello all.
I am new to xml.
I've been provided with a schema (.xsd) and need to create, in XML, a table that QA folks can fill out. I am unsure how to develop a stylesheet (.style or .xsl), for example, what should I use to format the stylesheet?
I have Epic Editor available to me.
I don't understand what I should do next.
I've been studying online for over a week, and am getting more confused everyday.
Thanks much.

Alex Vincent
08-14-2006, 11:01 PM
Wow. Tall order, especially for a beginner.

Can you give us some source code to start with? What's this for?

Projectus
08-15-2006, 03:34 PM
Thank you for your reply, and it's definitely is a tall order.

The purpose is to change how Manufacturing and QA enters/stores their data. Our customer's contract required that all data from us, including the data generated in the manufacturing plant, come from us in XML. (The data generated in the manufacturing plant are things like part number, part ID, part description, and so on.)

I will post what I can of the schema without worrying about "sensitive data." Perhaps just a few elements will give the idea.

Since I am no ace with writing in HTML, I've begun using Dreamweaver to design the stylesheet for me (a really simple table for input - I'll soon be asking how to process that input into an XML driven database). I did not choose CSS because there is apparently a limitation for XML, but I can't remember what it is...

Anyway, here is some of the Schema code:


<xs:element name="CustomerVariableNumber">
<xs:simpleType>
<xs:restriction base="xs:string">
<xs:maxLength value="5"></xs:maxLength>
</xs:restriction>
</xs:simpleType>
</xs:element>
<xs:element maxOccurs="unbounded" name="DetailedPartData">
<xs:complexType>
<xs:sequence>
<xs:element name="ItemUniqueID">
<xs:simpleType>
<xs:restriction base="xs:string">
<xs:maxLength value="32"></xs:maxLength>
</xs:restriction>
</xs:simpleType>
</xs:element>

Alex Vincent
08-15-2006, 06:54 PM
Okay, it sounds like you want to generate XML from raw data. Unfortunately, XSLT is only applicable when the source itself is XML, not necessarily the intended destination.

If I'm right, what you need is really a HTML or XHTML front-end for data entry, and then server-side code generates, on demand, the XML you want. If you're storing the data for a certain length of time before the customer gets it, a database may be appropriate as well for storing what you have between customer requests.

Projectus
08-15-2006, 07:11 PM
I'm glad you said that; I was starting to get the feeling that the actual entry of data in the plant would not be in XML, but rather in HTML. Then, that entered data would be gathered, stored, transformed, etc.

The construction of the HTML data entry form seems straighforward and easy. It'll just be a table. I can refer to the schema to set attributes such as max length and things like that I suppose.

Question: when I am making this data entry table in HTML, are there any favors I can do for myself, as far as retrieving the data later? I'm just making cells that each have a text input tag. Should I be using some sort of special tag that will make my XML-life easier later on?

Thanks again for the help. I need it.

Alex Vincent
08-16-2006, 01:00 AM
No, it likely won't be any HTML tag per se.

Typically what I end up doing is the following:

I design the backend database (usually MySQL)
I design the HTML form(s) I'll use to feed the database with entries
I write PHP to glue the HTML to the database - and validate the data that I'm about to put into the database.


But your mileage may vary. A lot. Everyone has their own ways of doing things. More often than not, you need to sketch out on paper how things will work before making them work.

The best advice I can give you is to experiment. This particular forum (the XML forum) isn't really a good place to help you learn best practices in database design, for example. There are other forums here which can help.

I hope you didn't tell your boss you'd have it done in two weeks... ;) What development platform (operating system, etc.) are you working with? Is it a separate computer / environment than the actual production platform?

I'll spare you the section on Subversion or CVS; right now you sound a bit overwhelmed, and you probably need to sketch on paper before writing any more code.

Projectus
08-16-2006, 12:52 PM
Thanks again. Your suggestions are clear and easy to follow for a beginner.

Sketching a plan is a good idea - my brain has been cluttered for 10 days straight. I briefly read a little about MySQL just now, and I am hoping that I will be able to use the version that appears to be free. If that doesn't make any sense, it's only because I don't know what I'm talking about.

PHP is something I am unfamiliar with, but Dreamweaver will let me play with it and experiment.

Fortunately, I didn't tell my boss that it would only be a couple weeks; I have at least 6 months before things get ugly.

I know the question that is coming for me soon at work: "Why can't you just make the data entry form in XML?" I suppose I don't really know the answer yet, other than XML is just for describing content, not for formatting. Is that about right?

I'll also poke around in some other forums and find what I can. Hopefully, when I am done with this project, I'll be able to return some advice to some poor chap like myself.

Have a good day.

Alex Vincent
08-16-2006, 07:11 PM
I know the question that is coming for me soon at work: "Why can't you just make the data entry form in XML?" I suppose I don't really know the answer yet, other than XML is just for describing content, not for formatting. Is that about right?

No. XML is about data, fundamentally, and about being able to exchange data.

As for the question you just asked, there are two answers, the short answer and the long answer.

Short answer: Not many platforms (client or server) support it, unless you mean XHTML.

Long answer: You're probably talking about XForms. While XForms is very, very cool, support for it is not very widespread. Firefox, for example, will not have it on by default for its 2.0 version; it's being worked on right now as an extension.

If you mean XHTML, then yes, it can be written as XML. XHTML is HTML reformulated as XML - that means in this case when a XHTML document submits a form, it's treated as if the submission came from a HTML document.

As for PHP versus Perl versus Python: pick whatever you think will get the job done if you don't know any of them. Some people get religious about their preferences; I'm not one of them. I pick whatever tool seems most appropriate. I am making the rather large assumption that your HTTP server will be Apache.

You might want to use XAMPP (http://www.apachefriends.org/en/xampp.html) for developing your project locally on your machine. That has support for a whole bunch of stuff, and is usually updated fairly often. I used to recommend firepages's phpdev packages, but he doesn't update them nearly enough anymore.

I also recommend you look into Subversion - it's a system for managing your project files as they evolve. Basically, you use Subversion (SVN) to "check in" your files as you continue to develop them. That way, if you check something in that's wrong, you can very easily back it out. (That's one feature of Subversion or any other version control system, but it's very useful.)

Are you the only computer technology person at your company? If you are, figure out some kind of backup system, fast.

Projectus
08-16-2006, 09:33 PM
More great advice, thanks again.

After reading articles and looking through tutorials all day, I'm left with this question:

Wouldn't Infopath be an easy solve-all?

Oh God I hope so.

Alex Vincent
08-16-2006, 11:35 PM
Wouldn't Infopath be an easy solve-all?

For once, I don't know. I've never heard of Infopath, so it all comes down to your experience with it (as opposed to your experience with other tools).