2

I am trying to make an XML generator and then use Java to read into the XML schema to create a survey. How would I make a webform or something else output XML? Here is an example of part of the XML. This is just the beginning of the survey. There will be free-response and multiple choice questions, but I just need the basics.

<Section>
    <Title>
        <English> SECTION I: SOCIO ECONOMIC AND DEMOGRAPHIC CHARACTERISTICS </English>
        <Native> विभाग पहिला: सामाजिक आर्थिक आणि संख्यात्मिक वैशिष्ट्ये </Native>
    </Title>
    <ID>1</ID>
        <Question>
            <ID> 1.1 </ID>
                <Description>
                    <English> How old are you? </English>
                    <Native>तुमचे वय किती आहे?   </Native>
                </Description>
            <Edit>
                <Title>
                    <English> Years </English>
                    <Native>वर्ष  </Native>
                </Title>
                <IsNumerical>true</IsNumerical>
                    <Value></Value>//default if not empty
                    <Minvalue>15</Minvalue>
                    <Maxvalue>50</Maxvalue>
            </Edit>
        </Question>
4
  • 2
    Why not <Question id="1.1"> ... </Question>? Seems neater. And <Native> is an odd choice of language identifier. Commented Jul 9, 2012 at 22:27
  • 1
    I might also suggest <Title lang="en">SECTION I: SOCIO ECONOMIC AND DEMOGRAPHIC CHARACTERISTICS</Title><Title lang="hi">विभाग पहिला: सामाजिक आर्थिक आणि संख्यात्मिक वैशिष्ट्ये</Title>. Commented Jul 9, 2012 at 22:35
  • 1
    And I'm really not at all sure what you expect jQuery to bring to this endevour. To be clear: Do you know the difference between server-side and client-side languages? Javascript is usually client-side, and is therefore unlikely to be helpful in this scenario. Commented Jul 9, 2012 at 22:36
  • Well I was thinking I might use jQuery to assemble the XML and then write that to a document. Unfortunately the schema has already been set and the Java has already been written for the app. Commented Jul 9, 2012 at 23:44

1 Answer 1

1

You can write a PHP script for your form's action that gets necessary parameters and creates the appropriate xml document using the parameters. This script can save these created xml documents into .xml files for example.

Sign up to request clarification or add additional context in comments.

1 Comment

SimpleXML is the PHP library you want to use, probably.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.