Tag: trang
-
XML Shell: xmlsh
- http://www.xmlsh.org
- https://github.com/xmlsh/xmlsh1_3
- they also provide a Java .jar file and a shell script etc around it, so you can run it on your platform
- http://www.xmlsh.org/CommandCsv2xml – builtin csv2xml, funny!
- http://www.xmlsh.org/CommandRngconvert – that’s trang, dealing with “Relax NG“
examples for csv2xml:
$ csv2xml -header my_file.csv
$ csv2xml -header -attr my_file.csv
# for CSV files created by Excel in Germany:
$ csv2xml -delim ‘;’ -header -attr my_file.csv
With -header the header line with its column names is being used to name the tags around the specific “cells” in XML.
If you prefer to use attributes for the column names, use -attr!
-
nXML mode – James Clark’s page (i.e. the author’s)
nxml-mode works best with an RELAX-NG schema / grammar corresponding to the XML being edited.
- http://relaxng.org/
- http://www.thaiopensource.com/relaxng/trang.html
- is there a way to translate XSD to RNG?
- is there a way to translate Schematron to RNG?
- http://stackoverflow.com/questions/14803562/how-to-convert-an-xml-schema-xsd-to-relax-ng ???
- http://stackoverflow.com/questions/122089/xsd-to-rnc-or-rng-conversion-unix-command-line !!!
- http://www.xml.gr.jp/relax/
- http://debeissat.nicolas.free.fr/XSDtoRNG.php
- https://java.net/projects/msv
- http://search.maven.org/#browse%7C738029748 – msv
-
editing JRXML in emacs using nxml-mode
Just created an RELAG-NG (“compact”) grammar for editing JRXML files.
I used trang for that, and the “input module” was a sample JRXML file. Yes, that means: occasionally some JRXML file will have tags or attributes, that my jasperreport.rnc does not know yet. But then re-running trang on an additional sample file is not really a big job.
I really love editing XML.
I re-ordered and “grouped” the XML pieces for the elements in my sample reports. That helps to clean up some things, that got a little messy over the time. In the end you recognize, how much duplicate code you have.
You may want to fight the redundancy problems through JRXML subreports.
I actually made my JRXML a “here document” for a shell script. A couple of hours later I knew, that a perl script is the better approach. Another couple of hours later there were plenty little parameterized “here documents“. I have solved my redundancy problem here through “looping over lists of configurations”. -
editing XML documents in emacs using nxml-mode
One good reason for not not authoring in XML is not having a suitable editor or IDE. I personally use and recommend emacs and James Clark‘s nxml-mode. I create and modify all sorts of XML documents this way. If you supply nxml-mode with the right schema for your document, nxml-mode can even help you with tag completion and document validation. nxml-mode makes use of schemas in RELAX-NG, co-created by James Clark. RELAX-NG schemas are rather easily created, if not yet just available, as for DocBook, DocBook Website, DocBook Slides, and many, many other XMLs.
“Trang” is your tool for creating a RELAX-NG schema:- if you want to convert a DTD into a RELAX-NG schema,
- if you want to derive a RELAX-NG schema from a couple of XML files of a specific kind,
- …
I have done that a dozen times, it does work.
Here you find nxml-mode’s manual page.
Your mileage may vary … -
bulk upload of events in XML at XING
At this link XING tells us, that they accept XML files in a certain format for uploading events to their site. They supply us with some nice but rather informal documentation in PDF, but there is no schema. Now that made me a little curious today, I downloaded their template file, created a few variants of the sample entry, and running trang I created a RELAX-NG schema file (anybody interested?). trang seems to not recognise date-time values of tags, so that always needs a little manual post-processing.
O, yes, I proudly uploaded one such event that way. (Actually on the first attempt I got the year wrong, that was quite embarrassing.) -
my CV or Resume in XML
Until not too long ago I had kept my CV in DocBook, then I converted it to XMLRésumé (but the project really looks dead nowadays), now I am converting it to HR-XML/Resume. Yes, I know, its project admin just recently declared this SourceForge project as inactive. But then, what alternatives are there?
Of course, I want to edit HR-XML files in emacs using a RELAX-G grammar, but I didn’t find any on the web. Well, that’s not really a huge problem. Take a few nice sample files (of any XML), stuff them into trang, and trang creates a RELAX-NG grammar from them. Of course, that kind of grammar is far from perfect, but it’s better than nothing, and you can always improve it manually, that’s not that hard. That way I created a RELAX-NG “compact grammar” for HR-XML/Resume last night.
The grammar created actually has problems with InternetWebAddress and Competency, but I was able to fix that for my personal use.
HR-XSL comes with a nice “XMLRésumé -> HR-XML/Resume” converter, that way my old XMLRésumé CV got converted into a good initial version for HR-XML/Resume. HR-XSL uses DocBook for creating HTML and PDF, but there is also a “DocBook -> RTF” converter, that I want to make use of.