I need to create a brochure for a conference. I export information from two databases that create two XML documents. I need to export both to one HTML / Latex document. How can I do this?
If you want to merge both the XML in one. Then you need to convert both XML's to JSON object using javascript. And do some merging operations on that JSON. Then convert back to XML.
U can get JS libraries to convert from json to xml and xml to json.
This is what XSLT is for but that topic is something you will need to study up on to learn to do that and it isn't something you'll learn overnight.
Related
I need some guidance on how to proceed with a problem.
Our integration team receives xml files which are converted to json and sent to pub/sub. We then ingest the json files (or are supposed to) into bigquery.
The problem is that the xml files do not include all possible objects or values all the time. So, I cant create a correct schema in bq to receive the json files. I got the xsd file with an extension file which gives me all possible objects but I don't know how to convert this to a correct bq schema.
Do you have any suggestions on how to create a bq schema from xsd files? I was thinking that if I create an xml file with dummy data (including all objects and more than one object when creating repeated objects) with help of the xsd maybe that xml file may be converted to json and then use the auto-schema detection of bq.
Any suggestions?
Thanks,
Cris
If you have the XSD schema files, you can convert these to a valid JSON schema. There are a few tools that can help you to accomplish this.
Keep in mind that the tools are for general purposes and not for the particular case of BigQuery, so you'll have to tune the result to get a valid JSON schema. For this check the components of a BigQuery schema, and for quick reference the sample provided in the documentation.
I want to convert JSON files to CSV in nifi. We can achieve this in Python and other programming languages and have multiple articles on it. I have multiple JSON files and each file has different schema(one specific file will have one schema only). I can see there are templates to convert CSV to JSON and other conversions. But I didn't see any template to convert JSON data to CSV. I have gone through the article https://community.hortonworks.com/articles/64069/converting-a-large-json-file-into-csv.html ,however here we are hard coding the schema. As I have multiple files and each file has different schema, I can't hardcode the schema. Any suggestions please.
Conversion between formats is typically done through ConvertRecord by plugging in the appropriate record reader and record writer, in this case a JSON reader and CSV writer.
To make use of the record processors you need to defined Avro schemas for your data and put them in a schema registry, NiFi provides a local one.
There are lots of examples and posts out there about the record stuff, this slide deck shows an example of CSV to JSON, but would be easy to reverse the situation for your scenario:
https://www.slideshare.net/BryanBende/apache-nifi-record-processing
This post has some other info:
https://bryanbende.com/development/2017/06/20/apache-nifi-records-and-schema-registries
Dear friends,
We are developing healthcare app which will monitory patient data from remote and display the patient EcG in dynamic graphs is my requirement , basically I am new to XML and XSLT. so what I wanted to know how to transfer the xml EcG data into xslt so that then in linux xsltproc command can transfer xsl file into html file and I can view in browser.
Basic example I know but graphics like lines chat I am confusing how to do ?
please if any one knows let me know thanks in advance. any reference or any links or any example is also ok and great if any one shares.
You don't transfer your XML data to XSLT. With XSLT you can define a stylesheet which defines how to transform XML data (to HTML in your case). So you apply XSLT stylesheet to your XML data.
When you have your XSLT defined, you can use xsltproc like this:
xsltproc stylesheet.xsl myData.xml
You can start with this tutorial to get some idea how it works. (Click "Try it yourself" to see an example of an XML document, XSLT stylesheet and the result)
For graphics like bar chart, pie chart and so on you need java script help which would take your generated XML as input and pass some parameters to javascript which has the ability to produce graphics for you. You can also check FusionCharts on http://www.fusioncharts.com/products/suite/?gclid=CI71hJqsjbUCFVEX6wodPgYAeg
Is there a way to read an XML file via HTML/Javascript on the client side?
I know I can add the XML data in the string in the javascript of the page. This solution works but it would be great if the xml file could be added like a css or a javascript file.
Is there a way to add a XML file like you would add a js file?
You could convert the XML into JSON or import it into a database first.
PHP has a library called Simple XML Parser that comes with most distributions. The interface is really straightforward.
Python also has a rich library called lxml to parse XML.
As the comments noted, accessing an XML file on the fly is probably not efficient.
Is there an existing program that helps forming a JSON Schema?
There's this great tool to get you started on generating a JSON Schema: http://www.jsonschema.net/ . Just feed a sample JSON files and out comes out a JSON Schema that you can then tweak.
Check this demo one. It is at an early stage but you can already edit jSON documents with a schema constraint as well as design a Schema itself.
And here is an official thread about Schema-based JSON editor:
You can use Orderly. They have DSL for schema description and you can try it online.
You could try this one (XML ValidatorBuddy) which is actually an XML editor but it also supports JSON and especially JSON Schema editing. The editor is a Windows desktop application and can do auto-completion and syntax-coloring for JSON schema files. You can also validate your JSON files against JSON schema.
You can do this in Liquid XML Studio, but its a commercial product
This isn't exactly something that'll help you with a 'schema', per se, but it's a visual way to navigate and manage JSON data.
http://braincast.nl/samples/jsoneditor/