Xmlcatalog in Ant script to read part of XML tags

147 Views Asked by At

I have a xyz.html file which contains the line-

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html>
<head>
<title>I am Man (2.0)</title>

I need to extract the value (2.0). I can use xmltask and do it, but because of the

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">

in the 1st line, xmltask is unable to do so. If I remove that line, it is correctly extracting the value. I found out that xmlcatalog can be used to bypass this. What will be the ant script to get this?

Edit: I added these lines but this didn't help either:

<xmlcatalog>
<dtd 
        publicId="-//W3C//DTD XHTML 1.0 Strict//EN"
        location="http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"/>
</xmlcatalog>
0

There are 0 best solutions below