How to extract data from a checkbox & print it in MS Word

Z

zahid

Dear All,

Could you please guide me on how can using XML read checkbox data from
a website and then place info about that checkbox into MSWord:

For eg.

A) America
B) Britain
C) Canada

suppose B) Britain is checked, then how can I pick up Britain from a
website using XML and then print it on MSWord.

Thank you all in advance,
Zahid
 
P

Peter Flynn

Dear All,

Could you please guide me on how can using XML read checkbox data from
a websiteand then place info about that checkbox into MSWord:

XML is not a programming language, so it cannot do this by itself, but
there are XML-based systems which can help.

One way is to use XForms, and possibly XQuery and XSLT, to specify and
handle the data, by creating the web page using XForms in XHTML. See
http://www.w3.org/MarkUp/Forms/2003/xforms-for-html-authors.html for
more details. There are also proprietary solutions to this from
Microsoft, Oracle, and others.
For eg.

A) America
B) Britain
C) Canada

suppose B) Britain is checked, then how can I pick up Britain from a
website using XML and then print it on MSWord.

You don't say if you have access to the server to create the web page
and suitable scripts.

If you want to (or you are constrained to) use existing (non-XML) server
technology, you need to write a server script to accept the submitted
data, and you need to modify the web page to put the URI of your script
into the action attribute of the form element. The script has to extract
the form data from the CGI environment and *then* you can use XSLT to
insert the values into a Word OOXML (.docx) document.

///Peter
 
Z

zahid

Hi Peter,

Thanks for your reply.

I have a software which is XML based. It picks up data from textboxes
on our website and then places that data automatically into MS word
document. It uses the following stylesheet to do so.

<w:body>
<wx:sect>
<w:p>
<w:r>
<w:rPr>
<w:sz w:val="28" />
<w:sz-cs w:val="28" />
</w:rPr>
<w:t><xsl:value-of select="Fruit"/></w:t>
</w:r>
</w:p>
<w:p/>
<w:p>
</wx:sect>
</w:body>


The above code picks up the data stored in the "Fruit" text box and
places it into MSWord.

I now just want to take this a step further so that it can also pick
up data from a checkbox and place the checked option in MS Word. So if
on the website B) Britain is checked then
Britain should be placed in the MSWord. All I need is the syntax in
the stylesheet which would make this happen.

Thanks for you help,
Zahid
 
P

Peter Flynn

Hi Peter,

Thanks for your reply.

I have a software which is XML based. It picks up data from textboxes
on our website and then places that data automatically into MS word
document. It uses the following stylesheet to do so.

I think there is some confusion here. The following is not a
stylesheet; it's a result tree fragment (of an OOXML
document) with a single embedded XSLT element. It's also not
well-formed, so it won't work as it stands
<w:body>
<wx:sect>
<w:p>
<w:r>
<w:rPr>
<w:sz w:val="28" />
<w:sz-cs w:val="28" />
</w:rPr>
<w:t><xsl:value-ofselect="Fruit"/></w:t>
</w:r>
</w:p>
<w:p/>
<w:p>
</wx:sect>
</w:body>

The said:
The above code picks up the data stored in the "Fruit" text box and
places it into MSWord.

Fruit must therefore be a child element of the context element node
where this fragment is traversed.
I now just want to take this a step further so that it can also pick
up data from a checkbox and place the checked option in MS Word. So
if on the website B) Britain is checked then Britain should be placed
in the MSWord. All I need is the syntax in the stylesheet which would
make this happen.

Use the same as above but substitute the name of the element which
contains the checkbox variable value; and do this in the relevant template.

You have not shown a minimal example here, and you have not shown what
the data structure is within which this fragment gets used. So it is not
possible to answer your question.

///Peter
 
E

essi

zahid said:
Could you please guide me on how can using XML read checkbox data from
a website and then place info about that checkbox into MSWord:

This particular newsgroup really is dedicated to XML related
conversations.

Now you are (probably??) asking how to extract data from some Web site,
and that means extrarcting something from HTML. The difference between
those two may not seem to be so significant, yet it is.

This far you have passed one XSL stylesheet, that actually is purely XML
related stuff. But secondly you posted some HTML code from your own Web
site. That HTML works so far that it shows a Web page on browser, but
that's it.

Now you are asking something, how to add or make some checkbox
somewhere. And after then convert something to Word format.

There are parts in your question that somehow may belong to XML family
tree. Yet there are some parts that maybe could be solved with PHP or
some other programming language or with something else.

I do not understand what you are actually asking. If someone else does,
then hopefully he/she can help you.

Essi
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,769
Messages
2,569,580
Members
45,054
Latest member
TrimKetoBoost

Latest Threads

Top