I have the documentation for the aircraft i`m flying in my airline as XML files with associated DTD files. Our library person use a special program from the manufacturer to convert these xml files to pdf. but the generated pdf files are not user friendly. So I suggested that we maybe can convert these XML files to XHTML and generate a simple documentation website for the pilots with easier navigation for the books.
I tried to figure out the schematics of the DTD and XML files but it seems too complicated.
Any suggestions on how to do convert these files to HTML?
I searched through google about this issue but most search results didn`t give any help.
Thanks in advance :)
The DTD defines the tags in the XML. Without knowing what type of XML the file is, converting it to HTML will be hard if not impossible. XML can be basic and common like XHTML or Open XML but is often custom made. In XML you can make your own tags and that makes it hard to convert without tag data.
Typically, the easiest way to convert XML to some other Markup is by using an XSLT transform. If you can't find one you could write your own.
If you're looking at a complex DTD you probably have complex XML. A transform may not be easy in that case but is probably your best option.
Related
please my first question here,
I am working on a project on an accounting site to help generate an ixbrl file from the account details which are in json and xlsx format.
Please has anyone worked with something similar that can put me through on how to go about it.
Welcome #Abiola Aribisala.
An ixbrl file, also known as Inline XBRL or the XHTML syntax of XBRL, requires two things:
The "print friendly" part, in "raw" XHTML, that a human user can look at;
Extra tags within this XHTML (they are in a namespace specific to XBRL), which are the machine-readable part.
Thus, in order to produce Inline XBRL syntax, you first need to have a print friendly version in a format that can be converted to XHTML (like Word, etc), as this cannot be automated just reading from JSON. I imagine that if the Excel file is nicely formatted, it might be possible to convert it to some "raw" XHTML in some way, too.
Second, for the tags, you need a data source with all the contexts, characteristics, etc for each fact value. If your JSON data is in xBRL-JSON format, it should contain this information. Otherwise, it requires extra work.
Finally, a challenge is knowing to put which tag where in XHTML, i.e. "merging" the print version with the data. In a regular setup, this comes from a common source that both generated the print version and the machine-readable data. That way, this common source can directly generate the Inline XBRL file and it is best for quality and correctness.
If the binding between the print version and the data is not available, one could in theory put all the tags in an ix-hidden section in XHTML, however it defeats the purpose of tagging the data exactly where it is on the XHTML page, i.e., it makes it less interactive.
We have written XSLT's to transform XML files into HTML. We would like to have this HTML to be free from any vulnerabilities. There should not be any suspicious scripts running into it.
So, can we implement something in XSLT which will validate XML content and flag it as inappropriate to be written into HTML?
Yes, We do lot of sanitation of XML document.
XSLT is Open-source platform which is very advanced now. Here is the documentation, which helps you cleaning up and vulnerable less message object your XML document
For validation check and conditional based check you can use conditional operations in XSLT. We create templates in XSLT and make sure the XML object is very clean and vulnerable less.
Are there any good ways of converting xhtml to json? I couldn't find any existing scripts to do that, so I'm not sure if the best way is to somehow write a script to parse the xhtml, convert it to some other format and then to json.
I've found XML to JSON converters and HTML to JSON converters online with a few Google searches. You may be able to use these together to convert XHTML to JSON, or you could spend a few minutes Googling and you may find an alternative.
I've made an XML schema but I don't know if I need an XSL stylesheet to show it in HTML. Do I need one? If I do, has anyone got an example which I could see and learn how to make one for my XML schema?
For an XSLT solution take a look at:
XS3P
XSDDoc, which produces JavaDoc-like documentation.
There are also a variety of tools that can produce W3C Schema documentation, such as:
oXygen
Stylus Studio
XML Schema Documenter
I find this URL (or a similar one) always on HTML files, XML, XSD...
Like "http://www.w3.org/2001/XMLSchema" or "http://www.w3.org/2001/XMLSchema-instance"
I always wonder what those URLs means.
Even offline the XML or HTML document works without changes. What's the benefits on links to those URLs??
Thanks
Those URLs do not necessarily point to any website/server. They are a convenient naming mechanism. The idea is since every company will have a unique website, using that as their namespace will avoid clashes. Hence better interoperability. Hence the custom.
Namespaces in XML 1.0 Specification
It's the XML Schema.
An XML schema provides a view of the
document type at a relatively high
level of abstraction.