Body: <p>I have a folder filled with 4chan threads, each thread can contain any number of comments. I want to create readable files for my Kindle, with multiple threads per book, with each thread clearly defined for the person reading it, each comment showing details that are present in the .xml file, such as 'date of post', the post number, the comment text, etc.</p>
  
  <p>I want to be able to combine multiple threads from a single folder, so I can decide what threads I’d like to combine into a single ebook file.</p>
  
  <p>My understanding is that the best way to do this would probably be to somehow represent the .xml data in an .html file which I can easily convert to .epub or .mobi format. My problem is I don’t know how to convert the .xml data into something readable and tidy in an .html file…and I don’t know how I’d do this en masse for many .xml files at once, combining some of them.</p>
  
  <p>I’ve added a picture here </p>
  
  <p><a href="https://i.sstatic.net/lOtdf.png" rel="nofollow noreferrer"><img src="https://i.sstatic.net/lOtdf.png" alt="Two .xml files on the left, and the outcome that I want on the right."></a></p>
  
  <p>showing basically the outcome I want, the formatting doesn’t have to be exact, I just want it tidy and readable, in a format that I can change the font size, etc on my Kindle as you would with any other ebook file.</p>
  
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2020-05-28T18:13:02.957Z
Comments.Text: the standard answer should be "use XSLT, and convert xml to xhtml", but I don't know of any free XSLT converter.
Comments.UserDisplayName: mau
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2020-06-08T11:46:11.883Z
Comments.Text: There are command line tools eg from this so question https://stackoverflow.com/questions/6527112/are-there-any-xslt-processing-command-line-tools#6527166 also there are addins to Eclipse
Comments.UserDisplayName: mmmmmm
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2022-12-17T01:22:51.097Z
Comments.Text: If you're a little bit technically inclined, as @mau said, XSLT would be a typical/standard way to go. Indeed, as @mmmmmm pointed out, on the command line, there's many options, including xmlstarlet and xproc. I also made my own, but not a GUI for it yet. Main task could be to make the stylesheet, but if you don't need something too special, generating some HTML shouldn't be a problem. How to select the material? For bulk operation, I usually use `find . -name '*.xml' -exec sh -c 'program "$1"' _ {} \;` under GNU/Linux. If this is too technical/difficult, maybe there could be some other way?
Comments.UserDisplayName: skreutzer
Tags: <conversion><ebook-management>
Title: How can I convert thousands of .xml files to an eBook format with nice formatting?
UserDisplayName: SonyaLebedinsky22
ThreadText: # How can I convert thousands of .xml files to an eBook format with nice formatting?
  
  (Asked by: username_0 on 2020-05-26)
  
  I have a folder filled with 4chan threads, each thread can contain any number of comments. I want to create readable files for my Kindle, with multiple threads per book, with each thread clearly defined for the person reading it, each comment showing details that are present in the .xml file, such as 'date of post', the post number, the comment text, etc.
  
  I want to be able to combine multiple threads from a single folder, so I can decide what threads I’d like to combine into a single ebook file.
  
  My understanding is that the best way to do this would probably be to somehow represent the .xml data in an .html file which I can easily convert to .epub or .mobi format. My problem is I don’t know how to convert the .xml data into something readable and tidy in an .html file…and I don’t know how I’d do this en masse for many .xml files at once, combining some of them.
  
  I’ve added a picture here
  
  [![Two .xml files on the left, and the outcome that I want on the right.](https://i.sstatic.net/lOtdf.png)](https://i.sstatic.net/lOtdf.png)
  
  showing basically the outcome I want, the formatting doesn’t have to be exact, I just want it tidy and readable, in a format that I can change the font size, etc on my Kindle as you would with any other ebook file.
  
  **Tags:** conversion, ebook-management
  
  > **Comments:**
  > **username_1**: the standard answer should be "use XSLT, and convert xml to xhtml", but I don't know of any free XSLT converter.  
  > **username_2**: There are command line tools eg from this so question https://stackoverflow.com/questions/6527112/are-there-any-xslt-processing-command-line-tools#6527166 also there are addins to Eclipse  
  > **username_3**: If you're a little bit technically inclined, as @username_1 said, XSLT would be a typical/standard way to go. Indeed, as @username_2 pointed out, on the command line, there's many options, including xmlstarlet and xproc. I also made my own, but not a GUI for it yet. Main task could be to make the stylesheet, but if you don't need something too special, generating some HTML shouldn't be a problem. How to select the material? For bulk operation, I usually use `find . -name '*.xml' -exec sh -c 'program "$1"' _ {} \;` under GNU/Linux. If this is too technical/difficult, maybe there could be some other way?  
  
  ---
  
  ## 0 answers
  
  