anystyle icon indicating copy to clipboard operation
anystyle copied to clipboard

xml output

Open dbvisel opened this issue 2 years ago • 2 comments

Hi! I'm trying to make a Docker container to run this to output XML, which I can do fine using the command line, though I'm having trouble doing it in Ruby. This works to get BibTeX out of a string input:

  output = AnyStyle.parse input, format: 'bibtex'

and if I change BibText to 'csl' I get CSL out. What do I need to get a string of XML out of this? Apologies if this is a dumb question!

dbvisel avatar Oct 03 '22 07:10 dbvisel

You can get the XML like this:

output = AnyStyle.parse(input, format: 'wapiti').to_xml

You can pass an options hash to set the indent, margin or quote options of XML Builder.

inukshuk avatar Oct 03 '22 07:10 inukshuk

That works perfectly! Thanks so much.

dbvisel avatar Oct 03 '22 07:10 dbvisel