Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. XML / XSL
  4. XSLT exception handling

XSLT exception handling

Scheduled Pinned Locked Moved XML / XSL
helpjavaai-modelsxml
1 Posts 1 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • R Offline
    R Offline
    rana74
    wrote on last edited by
    #1

    We test a particular constriant in our XSLT and throw a custom exception on failure: Here exception is defined as: xmlns:exception="http://..../util.exception.ValidationExceptionThrower" The problem is that this kind of exception handling by-passes the java code. In our Java client,we have the following: { ......... TransformerFactory tFactory = TransformerFactory.newInstance(); transformer = tFactory.newTransformer(source); .... StreamResult result = new StreamResult(); java.io.ByteArrayOutputStream outputXmlResult = new java.io.ByteArrayOutputStream(); result.setOutputStream(outputXmlResult); transformer.transform(xmlsource, result); setOutXml(outputXmlResult.toString()); return "Success"; } catch(ValidationException ex) { System.out.println("INSIDE VALIDATIONEXCEPTION"); ...... } finally { return "failure"; } } The exception thrown by XSLT does not get trapped by the error handler in the client. How can XSLT be adapted to throw a 'catchable' exception.

    1 Reply Last reply
    0
    Reply
    • Reply as topic
    Log in to reply
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes


    • Login

    • Don't have an account? Register

    • Login or register to search.
    • First post
      Last post
    0
    • Categories
    • Recent
    • Tags
    • Popular
    • World
    • Users
    • Groups