sax error on sql syntax ... expected behavior ?

Poster Content
nk4um Moderator
Posts: 756
July 24, 2008 09:13XML Escaping
Hi Tom,

Try using XML escaping " = "

Cheers,

Pete
nk4um User
Posts: 129
July 24, 2008 08:39sax error on sql syntax ... expected behavior ?
The following works :
  <instr>
   <type>stm</type>
   <operand>
    <sql/>
   </operand>
   <operator>
    <stm:group xmlns:stm="http://1060.org/stm">
     <stm:set xpath="/sql">
      SELECT "shortdesc_owner"
      FROM "assetbom"
      WHERE "shortdesc_owner" LIKE ''%<stm:param xpath="/nvp/search/text()"/>%''
      ORDER BY "shortdesc_owner";
     </stm:set>
    </stm:group>
   </operator>
   <param>this:param</param>
   <target>var:sql</target>
  </instr>


So does :
  <instr>
   <type>stm</type>
   <operand>
    <sql/>
   </operand>
   <operator>
    <stm:group xmlns:stm="http://1060.org/stm">
     <stm:set xpath="/sql">
      SELECT DISTINCT shortdesc_owner
      FROM assetbom
      WHERE shortdesc_owner LIKE ''%<stm:param xpath="/nvp/search/text()"/>%''
      ORDER BY shortdesc_owner;
     </stm:set>
    </stm:group>
   </operator>
   <param>this:param</param>
   <target>var:sql</target>
  </instr>


However, without the quotes it is not the correct syntax for hsqldb, so I tried this :
  <instr>
   <type>stm</type>
   <operand>
    <sql/>
   </operand>
   <operator>
    <stm:group xmlns:stm="http://1060.org/stm">
     <stm:set xpath="/sql">
      SELECT DISTINCT "shortdesc_owner"
      FROM "assetbom"
      WHERE "shortdesc_owner" LIKE ''%<stm:param xpath="/nvp/search/text()"/>%''
      ORDER BY "shortdesc_owner";
     </stm:set>
    </stm:group>
   </operator>
   <param>this:param</param>
   <target>var:sql</target>
  </instr>


Which throws the following sax-error
org.xml.sax.SAXParseException
The content of elements must consist of well-formed character data or markup.

Is that expected behavior ? If yes, is there a way to get round this problem ?
Regards,
Tom