I have HTML page that I created using xslt and an xml file. now In this html file, there is the option to change some values, so after these changes I want to generate xml content with these changes. How can I do that? Is there an easy way?
It seems you are looking for somethig like XMLForm :- http://www.datamech.com/XMLForm/
Related
I have a XML and a XSLT that generates a HTML output.
I would like to generate a PDF with XSL/FO that gives a render like the HTML output, just paged in PDF.
For this I understood that I had to use a XSL/FO stylesheet, that generates a .fo file, and then that I have to use Apache FOP to generate a pdf from the .fo file.
My question is: how to have the XSL/FO .xsl stylesheet that generates the .fo file, from my XSLT .xsl stylesheet that generates a HTML file ?
Is there any easy way to transform a XSL (html) to the other XSL (xsl/fo) ?
Thank you
Multiple people have produced XHTML to FO stylesheets at various times. See, e.g., 'xhtml2fo.xsl' on the 'XHTML to XSL-FO' tab of https://www.antennahouse.com/antenna1/xml-to-xsl-fo-stylesheets/.
Using your inline CSS would require parsing the CSS and transforming the properties into the nearest (often identical) XSL-FO properties.
You can use the XML or the HTML as input for the XSL-FO transformation.
You may be able to use your XSL as a starting point for the XSL-FO stylesheet. Replace the HTML output blocks with XSL-FO commands.
As an alternative, you could look into CSS Paged Media. Then you can use your existing HTML, plus a CSS stylesheet that's derived from your existing CSS.
I'm trying to create a directory for an address book, and I was wondering if it would be possible to create a selectable drop down menu that would pull the contact data from an XML file. The ideal way I would want it is to have all of the names of the contacts in the drop down menu, and when one is selected the rest of the information would pop up above the drop down, such as Address, Phone Number, and Email.
Either use a server-side language such as PHP to extract the data from the XML and insert it into the HTML document, or use AJAX to pull the XML file to the client then use JavaScript to process it and insert it into the DOM.
There should be libraries/frameworks/plugins/whatever available to parse XML using whatever language you need, if you know how to insert stuff into the HTML document (in the case of PHP) or into the DOM (in the case of JavaScript), you can do this easy.
From what I understand you have an XML document. Using XSLT you create an XHTML file from your XML and that you can display in your browser (XHTML is HTML that is conform to XML rules).
If that is the case then, yes, you can make links using XSLT. But the data needs to be in your XML source file and not in some database.
There is an article that describes it: http://www.ibm.com/developerworks/xml/library/x-tipxslt/index.html
You could attach an XSL to the XML using something like this:
<?xml version="1.0" encoding="ISO-8859-1"?>
<?xml-stylesheet type="text/xsl" href="cdcatalog.xsl"?>
... actual XML content...
If applying the XSL on the XML outputs an HTML page with JavaScript, you can get the actual result.
Outputting JavaScript is a bit of a pain because of character escaping but it can be done.
I have an XML file that I've transformed with xsl and loaded into a browser as html. That html is editable using a rich text editor by the user. When they're done I need to transform their html edits back to the original xml document.
One solution I've found is using ASP: http://www.w3schools.com/xsl/xsl_editxml.asp
But I'm using Apache and I don't have ASP installed, and I'm wondering if there is an easier/better way to do this without using ASP.
Or is ASP the only way?
Thanks =)
The solutiton that you found doesn't do what you describe. It only presents the data from the XML as a form, and lets the user edit the values. That's not very complex, and you can do that using pretty much any other server side language, like PHP for example.
What you describe, on the other hand, is quite complex. It involves examining the XSL and the HTML to identify the parts of the HTML code that was created using specific XML data, so that changes can be reflected back. That's not something that is done with a simple ASP script like that.
If you design an XSL transformation for both directions, XML to HTML and HTML to XML, comparing the source XML and resulting user XML should be a much easier problem to solve.
Im trying to generate a xml from a html (url). The html website have a formulary that i want to get into a xml archive, but its too long and im searching a way to do it easier.
There is a method to generate a xml with all the fields, etc, from a html?
you can also use an html parser and print out the objects / array as xml
try this: http://sourceforge.net/projects/html2xml/
You can try the free dotnet-classlibrary SgmlReader that can load html into a xmldocument. This in turn can be saved as xml.
The assumption is the webpage is coded with correct tags. How can I Convert it to the XML file? I think the most webpages can be viewed as dom tree...How can I convert it to XML file?
JTidy reads HTML and presents it as a DOM. Once you have your HTML as a DOM you should be able to process it and write it out as XML.
To output a DOM, see the example code here and the XMLSerializer in particular.