Parsing a xhtml file

46 views
Skip to first unread message

Mehmet Ali İLGAR

unread,
Sep 1, 2013, 12:58:14 PM9/1/13
to epu...@googlegroups.com
Im trying to get the content of a xhtml file from an epub file but no mater what i try it always gives me the normal xhtml files content, not the parsed version.
Ive tried using XmlStreamReader directly but still same result. Using resource.getReader().read() is giving me the same result...
Im not sure if im doing someting wrong or the xhtml file is broken... Here is the xhtml file im trying to parse...
<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
  "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head xmlns="http://www.w3.org/1999/xhtml">
<meta name="generator" content="HTML Tidy for Linux (vers 6 November 2007), see www.w3.org" />
<meta content="text/html; charset=UTF-8" />
<title>Kid's Short Story Book</title>
</head>
<body>
<div>The Donkey and The Little Dog
<p>A man had a little dog, and he was very fond of it. He would pat its head, and take it on his knee, and talk to it. Then he would give it little bits of food from his own plate.<br />
<br />
<img alt="" src="" />A donkey looked in at the window and saw the man and the dog.<br />
<br />
"Why does he not make a pet of me?" said the donkey.&#160;<br />
<br />
"It is not fair. I work hard, and the dog only wags its tail, and barks, and jumps on its master's knee. It is not fair."<br />
<br />
Then the donkey said to himself, "If I do what the dog does, he may make a pet of me."<br />
<br />
So the donkey ran into the room. It brayed as loudly as it could. It wagged its tail so hard that it knocked over a jar on the table. Then it tried to jump on to its master's knee.<br />
<br />
<img alt="" src="" />The master thought the donkey was mad, and he shouted, "Help! Help!" Men came running in with sticks, and they beat the donkey till it ran out of the house, and they drove it back to the field.<br />
<br />
"I only did what the dog does," said the donkey," and yet they make a pet of the dog, and they beat me with sticks. It is not fair."</p>
</div>
</body>
</html>
Reply all
Reply to author
Forward
0 new messages