I store the sql queries like stored proc call query, other queries in an xml, i use this xml to parse an execute appropriate query. I have written dtd for it. assume xml element is like this
in dtd i have given stored-procedure (#PCDATA)
If i include the dtd file in xml and parse the xml the java code and execute the query jdbc throws Malformed SQL92 string at position: 34
If i remove the dtd and run the parser and execute the query it works!
I know that the #PCDATA will parse the text between the tag, how do i make it work?
thanks for you reply Mr. Clapham,
i had checked the query that is sent to the jdbc statement.
I use apache sax parser
the value string extracted comes differently. how does this happen?
I see that the query string has been lost, before or after in the query string. but what bothers me is that if i did not include the dtd file it works fine, no string is lost, no matter how much big or complex the query be.
is this post changing topic from jdbc to xml parsing?
You have run into the common misconception about the characters() method.
It does NOT grab all of the characters inside the element reliably. If the text gets split across two buffer-load you get exactly what you are seeing. Including the DTD is changing the way the characters you are interested in fall at buffer boundaries.
You showed up just in time for the waffles! And this tiny ad:
Building a Better World in your Backyard by Paul Wheaton and Shawn Klassen-Koop