Topic - sax error on sql syntax ... expected behavior ?
Topic - sax error on sql syntax ... expected behavior ? Topic - sax error on sql syntax ... expected behavior ?
from forum XML
 forum index   my profile   search 
 new topic  post reply 
moderators: pjr tab
sax error on sql syntax ... expected behavior ?
Joined: 22-April-2007
Posts: 79
Location: Belgium
Posted: 24-July-2008 08:39
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
XML Escaping
Joined: 7-February-2005
Posts: 397
Location: UK
Posted: 24-July-2008 09:13
Hi Tom,

Try using XML escaping " = &quot;

Cheers,

Pete
 new topic  post reply  To find out about new replies to this post as they occur
please subscribe to one of these feeds:
AtomRSS moderate 
© 2003-2006, 1060 Research Limited. 1060 registered trademark, NetKernel trademark of 1060 Research Limited.