I have a xml file, mentioned below:
<?xml version="1.0" encoding="UTF-8"?>
<Workbook>
<ExcelWorkbook
xmlns="urn:schemas-microsoft-com:office:excel"/>
<Worksheet ss:Name="Table 1">
<Table>
<Row ss:Index="7" ss:AutoFitHeight="0" ss:Height="12">
<Cell ss:Index="1" ss:StyleID="s05">
<ss:Data ss:Type="String"
xmlns="http://www.w3.org/TR/REC-html40">
<Font html:Size="9" html:Face="Times New Roman" x:Family="Roman" html:Color="#000000">
ABCD
</Font>
</ss:Data>
</Cell>
</Row>
How do I extract the data, "ABCD" here, using SAX or XPATH in Java?
EDIT 1:
This is the XML-
<Table>
<Row ss:Index="74" ss:AutoFitHeight="0" ss:Height="14">
<Cell ss:Index="1" ss:MergeAcross="3" ss:StyleID="s29">
<ss:Data ss:Type="Number" xmlns="http://www.w3.org/TR/REC-html40">
0.00
</ss:Data>
</Cell>
<Cell ss:Index="15" ss:MergeAcross="5" ss:StyleID="s29">
<ss:Data ss:Type="Number" xmlns="http://www.w3.org/TR/REC-html40">
4.57
</ss:Data>
</Cell>
</Row>
String cellStringContent = "/*[@ss:Type='Number']/*[text()]/text()";. But it gives error here-if (n.getNodeType() == Node.TEXT_NODE). Instead of TEXT_NODE i tried using other nodeType named constants, but it didnt work. Please help.String cellStringContent = "/*[@ss:Type='Number']/text()";the reason is that there is no <Font> element