XML

Apr. 28th, 2010 09:24 am
rowyn: (studious)
[personal profile] rowyn
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?

Date: 2010-04-28 06:38 pm (UTC)
From: [identity profile] tetsujinnooni.livejournal.com
Quick 'how it might work' notes; this will vary depending on how well or poorly ImageNow actually structures their forms representation. This also presumes they are using either embedded or explicit browser based HTML as their UI engine for their XML forms...

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...

Date: 2010-04-28 06:47 pm (UTC)
From: [identity profile] tetsujinnooni.livejournal.com
I guess the upshot is: browse pages on coding dynamic web pages and the documentation for ImageNow. Unfortunately, ImageNow's docs are only available through their customer portal, making a quick look for complexity evaluation hard.

February 2026

S M T W T F S
1 234567
891011121314
15161718192021
22232425262728

Most Popular Tags

Active Entries

Style Credit

Expand Cut Tags

No cut tags
Page generated Feb. 11th, 2026 01:17 am
Powered by Dreamwidth Studios