View Single Post
Old 08-19-2015, 10:24 PM   #32
mattmc
Connoisseur
mattmc can program the VCR without an owner's manual.mattmc can program the VCR without an owner's manual.mattmc can program the VCR without an owner's manual.mattmc can program the VCR without an owner's manual.mattmc can program the VCR without an owner's manual.mattmc can program the VCR without an owner's manual.mattmc can program the VCR without an owner's manual.mattmc can program the VCR without an owner's manual.mattmc can program the VCR without an owner's manual.mattmc can program the VCR without an owner's manual.mattmc can program the VCR without an owner's manual.
 
Posts: 89
Karma: 185923
Join Date: May 2015
Device: iPad 1/2/Air, K3/PW2/Fire1, Kobo Touch, Samsung Tab, Nook Color/Touch
Quote:
Originally Posted by Nick_1964 View Post
Dear friends.
When I opened a commercial ebook that I bought (social DRM) I noticed the book is really slow.
So I looked to the code and that was terrible.. no way I can clean this by hand... is there software (I hope free because it is for only one book,until now) or an online tool that can clean it for me ??
Look at the spoiler for a example.
In real..this are only a couple of lines from the book...
Ew.

That's funny, because that markup looks similar to what InDesign produces, in terms of style tags covering everything. I actually already wrote a script that handles this. Specifically, it does this:

Code:
// Start:
<p><span class="123">Hello</span> <span class="123">World</span><span class="123">!</span></p>

// End:
<p><span class="123">Hello World!</span></p>
For example, I took your input and produced this:
Spoiler:

<p class="dlct-000"><span class="dlct-007">&apos;Ik weet het,&apos; zei Ro zacht. &apos;Ik heb alles gezien. Ik zat onder de tafel verstopt.</span></p>

<p class="dlct-000"><span class="dlct-007">Elena keek hem verbijsterd aan.</span></p>

<p class="dlct-000"><span class="dlct-007">&apos;Mijn moeder zei dat ze mij een afkoelperiode wilde geven en dat ik dan wel weer redelijk zou worden. Ze stopte mij in een kamer, maar ik kon ontsnappen. Joxy, mijn priv&#xE9;- bediende heb ik kunnen overhalen en zij verstopte mij onder de trolley die ze naar de grote zaal bracht. Toen ik zag dat daar van alles stond te gebeuren besloot ik mij onder tafel te verbergen. Ik heb alles gezien en nu kom ik je halen. We moeten weg hier. We moeten William en Charlotte bevrijden. Dat&#x2026; wezen is mijn moeder niet meer!&apos;</span></p>

<p class="dlct-000"><span class="dlct-007">Elena knikte en ze schreef opnieuw iets op het papier. &apos;Wat wil je doen? Samis heeft nu de twee boeken. Alles en iedereen is hier aangepast, gekruist of gemaakt. Greysdale is bewoond door zombies, Utopalta is half vergaan en Willowjinx is weg. Waar moeten we naartoe? Ik kan niets zo!&apos; Elena wees naar haar keel.</span></p>

<p class="dlct-000"><span class="dlct-007">&apos;Shit- ja!&apos; zei Ro net iets te hard. Meteen sloeg Elena een hand voor zijn mond.</span></p>

<p class="dlct-000"><span class="dlct-007">Ro haalde haar hand weg. &apos;Sorry,&apos; fluisterde hij. &apos;Ik weet het niet, maar we moeten iets doen.&apos;</span></p>

<p class="dlct-000"><span class="dlct-007">Met tegenzin schudde Elena haar hoofd. Ze pakte het papiertje en schreef verder. &apos;We hebben alleen het huis in het bos over. Misschien dat de professor ons kan helpen. Aan de Codex Trias hebben we niets. Die is veilig bij Bia en Luxis. Hier kunnen we niet blijven. We moeten William en Charlotte bevrijden en gaan dan naar het bos.&apos;</span></p>

<p class="dlct-000"><span class="dlct-007">&apos;Goed plan,&apos; fluisterde Ro.&amp;nbsp;</span></p>

<p class="dlct-000"><span class="dlct-007">Elena pakte het papier en gooide het in de open haard. Ro nam haar bij de hand en trok haar door de deur waar hij vandaan was gekomen. Ze kwam in een gelijksoortige kamer als die van haar alleen was het hier een stuk rommeliger.&amp;nbsp;</span></p>


Because I'm using an XML parsing engine, it does encode the apostrophes, ampersands and such. Is this acceptable?
mattmc is offline   Reply With Quote