beej71 6 days ago

Should be at fun little XML parser to write, converting the thing to HTML.

Except that it's a government thing so the parser's probably not going to be little. :)

Edit: The thing's basically XHTML without any kind of header. UTF-8 encoding, it looks like. So a conversion tool would just need to wrap it up and add styling.

Edit: Despite hints that it's XHTML, it's not valid XHTML.

Edit: Stick this at the top of the file:

--------------------- 8< ---------------------

<!DOCTYPE html>

<html>

<head>

    <meta name="viewport" content="width=device-width, initial-scale=1" />

    <meta charset="utf-8" />

    <title>H. R. 1</title>

    <style>
    body {
        max-width: 40em;
        margin: auto;
    }
    .lbexTocSectionOLC {
        display: inline-block;
    }
    .lbexTocDivisionOLC {
        margin-top: 5ex;
    }
    </style>
</head>

--------------------- 8< ---------------------

And add this to the bottom of the file:

--------------------- 8< ---------------------

</html>

--------------------- 8< ---------------------

I'll leave it as an exercise to the reader to write a script to do that. Automatically extracting the bill title should be Fun.

1
gabrielsroka 6 days ago

<html> and </html> are optional but I didn't try it with this file

https://developer.mozilla.org/en-US/docs/Web/HTML/Reference/...