Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > XML > How to extract data from a checkbox & print it in MS Word

Reply
Thread Tools

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

 
 
zahid
Guest
Posts: n/a
 
      06-13-2011
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
 
Reply With Quote
 
 
 
 
Peter Flynn
Guest
Posts: n/a
 
      06-13-2011
On 13/06/11 11:16, zahid wrote:
> 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/...l-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
--
XML FAQ: http://xml.silmaril.ie/
 
Reply With Quote
 
 
 
 
zahid
Guest
Posts: n/a
 
      06-15-2011
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>
<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>
<w/>
<w>
</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







On Jun 13, 11:37*pm, Peter Flynn <(E-Mail Removed)> wrote:
> On 13/06/11 11:16, zahid wrote:
>
> > 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. Seehttp://www.w3.org/MarkUp/Forms/2003/xforms-for-html-authors.htmlfor
> 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
> --
> XML FAQ:http://xml.silmaril.ie/


 
Reply With Quote
 
Peter Flynn
Guest
Posts: n/a
 
      06-15-2011
On 15/06/11 14:01, zahid wrote:
> 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>
> <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>
> <w/>
> <w>
> </wx:sect>
> </w:body>


The <w/> is unnecessary and the following <w> is not closed.

> 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
--
XML FAQ: http://xml.silmaril.ie/
 
Reply With Quote
 
essi
Guest
Posts: n/a
 
      06-28-2011
zahid wrote:
> 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
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Re: How include a large array? Edward A. Falk C Programming 1 04-04-2013 08:07 PM
Re: How to extract data from a checkbox & print it in MS Word zahid XML 2 06-29-2011 01:48 AM
How do i extract vidios when winrar wont extract them??? help plzzzzzzzz smuttdog@sc.rr.com Computer Support 2 12-23-2007 07:03 AM
How to extract part of the text (htm) file after start word until end word? Perl Misc 4 05-12-2006 06:51 PM
Unlarging the print to print using PDF file to print Bun Mui Computer Support 3 09-13-2004 03:15 AM



Advertisments