R
RC
For example I have a XML tag
<script>
<![CDATA[
My script is here
]]>
</script>
I am using org.xml.sax.ext.DefaultHandler2 to parse my XML
file. How do I retrieve my script contents?
What shall I do in these two methods?
@Override
public void startElement(String uri, String localName, String qName,
Attributes attributes)
throws SAXException
{
if (qName.equals("script"))
{
// How to retrieve my script contents?
}
}
@Override
public void endElement(String uri, String localName, String qName)
throws SAXException
{
if (qName.equals("script"))
{
// How to retrieve my script contents?
}
}
Below two methods have no print out at all
@Override
public void endCDATA()
{
System.out.println("End of CDATA");
}
@Override
public void startCDATA()
{
System.out.println("Start of CDATA");
}
Thank you very much in advance!
<script>
<![CDATA[
My script is here
]]>
</script>
I am using org.xml.sax.ext.DefaultHandler2 to parse my XML
file. How do I retrieve my script contents?
What shall I do in these two methods?
@Override
public void startElement(String uri, String localName, String qName,
Attributes attributes)
throws SAXException
{
if (qName.equals("script"))
{
// How to retrieve my script contents?
}
}
@Override
public void endElement(String uri, String localName, String qName)
throws SAXException
{
if (qName.equals("script"))
{
// How to retrieve my script contents?
}
}
Below two methods have no print out at all
@Override
public void endCDATA()
{
System.out.println("End of CDATA");
}
@Override
public void startCDATA()
{
System.out.println("Start of CDATA");
}
Thank you very much in advance!