For those of you familiar with using xml --
I want to be able to code an xml form which will do basic mathmatical operations and store data. For exmple, my end user would see a form that said "Enter X" and "Enter Y", and after the user entered X & Y, the page would calculate X/Y, display the result, and then store everything.
Now, my actual question is not "how do I do this?" but "how annoying is it to learn enough xml to know how to do this sort of thing?" It seems like a simple enough kind of thing, but I've not actually coded in xml before. I will have access to an exceedingly simple xml form designer which will do the "enter and store X&Y" part, but not do operations based on the data entered. I kinda want to just manually edit the designer's code and add the other stuff, but I'm not sure if this falls in the category of "browse webpages on xml coding and figure it out" or "get an xml book and figure it out" or "1-day training course" or "college class". Suggestions?
I want to be able to code an xml form which will do basic mathmatical operations and store data. For exmple, my end user would see a form that said "Enter X" and "Enter Y", and after the user entered X & Y, the page would calculate X/Y, display the result, and then store everything.
Now, my actual question is not "how do I do this?" but "how annoying is it to learn enough xml to know how to do this sort of thing?" It seems like a simple enough kind of thing, but I've not actually coded in xml before. I will have access to an exceedingly simple xml form designer which will do the "enter and store X&Y" part, but not do operations based on the data entered. I kinda want to just manually edit the designer's code and add the other stuff, but I'm not sure if this falls in the category of "browse webpages on xml coding and figure it out" or "get an xml book and figure it out" or "1-day training course" or "college class". Suggestions?
no subject
Date: 2010-04-28 04:04 pm (UTC)We have a document-imaging product, ImageNow. ImageNow includes a feature that will let the users publish a custom-designed "eForm" to the web. EForms are coded in XML, and IIRC it supports (let me check) -- yes, it does work with Javascript. The next version of the product includes a simple drag-and-drop eForm designer. The designer generates eForms that will collect data and then index the form inside ImageNow based on the data collected. It also includes the form itself as a modifiable document in ImageNow.
We don't use eForms yet. My bank currently has loan officers (and other departments) filling out forms in Excel spreadsheets and then emailing the spreadsheets to loan ops. The spreadsheets mostly are just places for the loan officer to dump bits of data, which the eform can easily collect instead. However, they do a few calculations here and there.
I'd like to replace the spreadsheets with an eForm, because the eForms can do some pre-filling and possibly even exporting data, and should be a bit smoother for everyone. But the eForms designer isn't really up to doing the kind of forms I want it to do, so I'd need to do some coding to make it work. And I'm not sure how complex that coding would really be.
no subject
Date: 2010-04-28 06:38 pm (UTC)A piece of information in a field in the document can be represented as an XPath selector like: //form/field[@name='X'].
That of course presumes that the document represents user input fields as tags like <field name='X' controlType='text' /> in the final XML.
From your description, they have an event handling model wherein you can attach javascript methods or blocks to specific triggers (like the value in a field changing). The javascript would then involve using their documentation of how to select a field from the form and extract its value.)
Equivalent in html:
function addTwoFields(){ // this doesn't do error checking or any other sensible thing var x = new Number(document.getElementById('fieldOneId').value); var y = new Number(document.getElementById('fieldTwoId').value); document.getElementById('fieldThreeId').value = (x+y); }This is NOT what I'd call production grade javascript, but illustrates using number to get relatively validated values rather than concatenating strings in the users-can't-type case...
no subject
Date: 2010-04-28 06:47 pm (UTC)no subject
Date: 2010-04-29 02:21 pm (UTC)json
Date: 2010-04-29 12:32 pm (UTC)As for XML itself, here is the summary for all you need to know to start:
Namespace:
xmlns:edi='http://ecommerce.example.org/schema'
At the top of the document. An arbitrary text string that just appears to look like a url. Your supposed to make a unique one for each type of file/data and in theory going to that url would give you a listing of all the fields - but practically no one ever actually sets up the documentation page - so it's just a meaningless string.
Basically, it's so a program would now that
xmlns:edi='http://ecommerce.example.org/schema1.0'
and
xmlns:edi='http://ecommerce.example.org/schema1.1'
Are 2 different formatting options for data, elements and attributes:
http://www.w3schools.com/DTD/dtd_el_vs_attr.asp
XML elements:
something like
tagname..tagdata....closetagname
Logical, self explanatory, the data is inside the tags.
Then you could have something like
setoftags
tag1name...tagdata...closetag1name
tag2name...tagdata...closetag2name
closesetoftags
Again, all of that is intuitive sense.
But most people like to store data in attributes instead, so it's
tagname....data=value....closetag
or even something like
setofdataname....name1=value1...name2=value2....closesetofdataname
Almost every language, including javascript has a parser to parse the xml into something meaningful, http://www.w3schools.com/xmL/xml_parser.asp that can then have programming assigned to it.
Re: json
Date: 2010-04-29 01:32 pm (UTC)Thanks for the advice and links! Very nifty. :)