public static void main(String[] args) throws IOException, URISyntaxException,TransformerException {
TransformerFactory factory = TransformerFactory.newInstance();
String workingDir = System.getProperty("user.dir");
Source xslt = new StreamSource(new File(workingDir+"/src/jaxp/mysqldump_xml_to_sql.xsl"));
Transformer transformer = factory.newTransformer(xslt);
Source text = new StreamSource(new File(workingDir + "/src/jaxp/words.xml"));
transformer.transform(text, new StreamResult(new File("output2.sql")));
}
When I run this program I receive this error :
**Exception in thread "main" java.lang.StackOverflowError
at mysqldump_xml_to_sql.escape$dash$quotes()
at mysqldump_xml_to_sql.escape$dash$quotes()**
I set stack and heap size with this command :
java -Xss120m -Xms120m -Xmx500m
But again I receive that error.
this is my style sheet
[1] http://mysqldump-x-restore.googlecode.com/files/mysqldump-xml-to-sql.xslt
and my xml file is result of mysqldump -x -uroot -pxxxx databasename tablename > test.xml command
and myxml file has & > < character
It happens in the MySQL transform. The method is escape dash and quote.
If I escape a value like
"&"in HTML, I replace it with"&". But there’s still an ampersand there. Is the code smart enough to realize that it’s done? If not, you can see why you’d keep trying to out that damned spot and end up recursing yourself to death.I’m guessing that your escape method for dashes and quotes is doing the same thing – chasing its tail into the ground.