You are viewing a plain text version of this content. The canonical link for it is here.
Posted to j-users@xalan.apache.org by Mougenot Sylvain <sy...@delta-diffusion.fr> on 2002/12/23 14:11:40 UTC

[DTM] Exception during XLST transformation

CONTEXT<?xml:namespace prefix = o ns =
"urn:schemas-microsoft-com:office:office" />

    JDK 1.4.1

    Orion 1.5.4

    Maverick (root framework of the web-app)

    Xalan 2.4.1

    Xerces 2.2.0

 

TROUBLE

    When my XML input is relatively large (about 30Ko), sometimes,

    I've an exception (DTMException) fired by Xalan (sea end of the message
for details).

    

    We used  some Templates to cache XSLT processing (there is the code
below).

QUESTIONS
    Is there some limitation in the amount of datas allowed as xml input ?
    Do someone encounter this trouble ? (and, in this case, have you solved
it?)
    Have I done something wrong ?  

  

 

----------------------------------------------------------------------------
-----------

javax.xml.transform.TransformerException: org.apache.xml.dtm.DTMException:
Aucun ID DTM disponible (meaning no DTM ID available)
 at
org.apache.xalan.transformer.TransformerImpl.transformNode(TransformerImpl.j
ava:1226)
 at
org.apache.xalan.transformer.TransformerImpl.transform(TransformerImpl.java:
638)
 at
org.apache.xalan.transformer.TransformerImpl.transform(TransformerImpl.java:
1088)
 at
org.apache.xalan.transformer.TransformerImpl.transform(TransformerImpl.java:
1066)
 at
org.infohazard.maverick.transform.XSLTransform$Step.go(XSLTransform.java:254
)
 ...
 
Where the go method is
----------------------------------------------------------------------------
-----------
public void go(Source input) throws IOException, ServletException{

Transformer trans;
try{
    trans = this.getCompiled().newTransformer(); [getCompiled() fired the
loadTemplate method below]
}catch (TransformerConfigurationException ex){
    throw new ServletException(ex);
}

// Populate any params which might have been set
if (this.getTransformCtx().getParams() != null)
    populateParams(trans, this.getTransformCtx().getParams());
Result res;
...
    res = new StreamResult(this.getNext().getResponse().getOutputStream());
...

try{
    trans.transform(input, res);
}catch (TransformerException ex){
    throw new ServletException(ex);
}
...
}

----------------------------------------------------------------------------
-----------

(path is the xsl file path)
protected Templates loadTemplate(String path, ServletContext servletCtx)
throws ConfigException{

TransformerFactory tFactory = TransformerFactory.newInstance();

if (this.uriResolver != null)
    tFactory.setURIResolver(this.uriResolver);

java.net.URL resURL = servletCtx.getResource(path);

if (resURL == null){
    log.fatal("Resource not found: " + path);
    throw new ConfigException("Resource not found: " + path);
}



log.debug("Template url is: " + resURL.toString());



return tFactory.newTemplates(new StreamSource(resURL.openStream(),
resURL.toString()));
} 



**********************************************************************
Ce message et ses éventuels fichiers attachés sont confidentiels
et sont uniquement à l'attention de la personne physique ou morale
destinatrice. Si vous avez reçu ce message par erreur, merci d'en
avertir l'expéditeur.

Ce bas de page assure également que ce message a été vérifié par un anti-virus
**********************************************************************