Store data from HTML to XML file - html

Hello im trying to learn about XML , XML is media for store data but HTML media for display data, how can I store data from HTML to XML ?
Because i'd like to build some quiz maker that build up into HTML and store in XML, any tutorial/references for this?
thanks

XML is just a fancy way to store data for your application. It's a standard which means that you can easily export data from one application into another. If you are interested in this, take a look at this page: http://www.w3schools.com/xml/xml_parser.asp
You will need to use html and javascript to build a quiz. If you want you can make your quiz load questions and answers from XML.
HTML is a specialized language written in XML to describe how a webpage renders. HTML is valid XML however they very different things.

The question is very open ended, so it's hard to answer. One way is to post data from your html based website to your server and store it as xml.
However, it all depends on how you intend to use it.

I assume you mean "How can I load data stored in XML to html website". The simplest answer I can think of right now would be using jquery/javascript.
http://think2loud.com/224-reading-xml-with-jquery/
https://stackoverflow.com/questions/10811511/jquery-how-to-get-xml-data
https://stackoverflow.com/questions/16113188/convert-xml-to-html-using-jquery-javascript

Related

How to parse a PDF using AS3? (air)

is there a way to parse a pdf using AS3 via Air in mobile?.
I don't need the full content of the PDF, only some data, is that possible?.
Edit for clarification:
I got a PDF file that was originally created based on a XML, what I'd need is to be able to retrieve that XML. Or at least, to find a string inside that PDF so I can make a call to a web service.
Original:
There's nothing native in AS3 for this kind of stuff but AlivePDF. It won't let you traverse things like XML so much, as it seems like you're trying to do by taking a small bit of a PDF, but it will let you create pdf's, add pages and change fonts etc.
You weren't entirely clear on what you're attempting to achieve, if you update your question a with a bit more detail we may be able to help a bit more.
Edit:
From the refined question, AlivePDF is not what you're after as it's really only for PDF generation. I'm assuming you're after a method to traverse the document like you would XML, by looking for a tag and extracting the information. I've not found a way to do this other than iterating through the document and searching manually which probably isn't what you're after.
After some searching I found an as3-pdfreader which doesn't seem to be complete at the moment. However on the Project Home the roadmap says parsing pdf files is complete, I've not been able to try it out yet though.

Help in XML content transform to html

In my current project, I need to add information from an xml file to my html template using XSL. Does anyone know how to do it. I tried creating an xsl file and run, it just creating a temporary file and when I closed, it got deleted. I have a separate html template, I just need to add the xml file contents to it.
Thanks
Your question is rather unclear to me.
From your question I infer that you mean XSLT.
Where exactly should the transformation happen? Client-side (e.g. web browser) or server-side? Both approaches have different advantages.
What kind of HTML template is it?

How do I create some HTML help pages, with the same content at the top and bottom, without php or ASP etc?

I want to create some html help pages, separate html pages.
However, I want to have the same content on the top and bottom of the pages.
In the past I've used PHP or ASP, with header and footer files.
I've then had to do view source and save these pages to get what I want.
I just wondered if there an easiest way to do this ?
EDIT:
The pages are for use with software using a web object not a normal browser. So there won't be a web server
If your web server supports it, you could do server side includes
You could use frames, but it's not necessarily advisable (for one, it breaks navigation).
You could use XML files with an XSLT stylesheet to turn them into HTML documents that share similar elements.
You could use PHP or another server-side language to generate the pages, and then use a recursive download tool (such as wget) to turn them into HTML.
EDIT: you're basically asking whether the "standard-ish" subset of HTML supported by your component of choice provides a way of including data from a common file, just so you won't have to include the data in every HTML document.
The answer hovers somewhere between "no way" and "maybe your component has a few tricks to do that".
The sane thing to do here would be to have a tool generate the HTML documents from a common template. Could be XML + XSLT, PHP/ASP/whatever, or a fully-fledged CMS (this actually helps let non-technical users write the document contents).
It's awful, but you could include a JS file that uses a bunch of document.write("...") to include common elements. Not SEO friendly.

Converting HTML to RDF

I'm looking for a general purpose API/web service/tool/etc... that allows convert a given HTML page to an RDF graph as specific as possible (most probably using a back bone ontology and/or mapper).
Have you proved GRDDL?
GRDDL is a technique for obtaining RDF
data from XML documents and in
particular XHTML pages.
I used XQuery to extract the data out of the given set of web pages. I had to write custom queries for the web pages. I think this is the most straight forward approach to take for a specific set of HTML files. However, it is obviously not good for the general case. For a different set of web pages other custom queries are need to be written.
I used JSoup to scrape data from HTML. It uses jQuery style of querying HTML DOM, wich I was already famirial with, so it was realy simple tool to use for me. I also fund it quite robust but I needed it just to scrape 3 datasources so I dont have rich experience with this tool yet. jsoup

Using server-side XML Parser to generate HTML content

Is it possible using a server side XML parser to have it create an HTML blob that is then included in an existing HTML page?
Is the existing HTML page already being served by the same server? If so, then yes - arguably that's a rough description of what almost all web frameworks do, to a greater or lesser extent: insert some dynamic content within a static template.
Which bit are you concerned about?
Most languages should have XML libraries or parsers available to facilitate this.
For example, PHP has an XML parser.
Write a function using this to take a given XML feed, pretty it up, and spit it out. Then call this function in your HTML page.