Hello David,
I am quite happy with your answer. ( I found the Integration Kit quite useful )
However, after a lot of experiment, I always have my null system ID. I understand that XEP want to become more compliant to standard.... but the old solution to put the
BASE properties was quite easy and good to implement.
Here is the code I used: ( StreamSource xslSource = new StreamSource(gabaritXSL.openStream(), gabaritXSL.toString()); )
public void generePDF(OutputStream out,
String xmlStringData, URL gabaritXSL,
Properties props) throws
GenerateurPDFException {
FormatterImpl formateur = null;
GenerateurPDFLogger logger = null;
FOTarget target = null;
GenerateurPDFURIResolver genPDFURIResolver = new GenerateurPDFURIResolver();
boolean environnementProd = ConfigurationInfrastructure.getTypeEnvironnement().
equalsIgnoreCase(ConstantesCommunInfra.getENVIRONNEMENT_PRODUCTION());
try {
ValidationUtil.validerNonNullOuVide(xmlStringData, "xmlStringData");
ValidationUtil.validerNonNull(out, "out");
ValidationUtil.validerNonNull(gabaritXSL, "gabaritXSL");
System.getProperties().put(XEP_TMP_DIR, System.getProperty("java.io.tmpdir"));
getDefaultProperties();
if ( environnementProd ){
logger = new GenerateurPDFLogger(new NullWriter());
}
else{
logger = new GenerateurPDFLogger();
}
target = new FOTarget(out, "PDF");
formateur = new FormatterImpl(props, logger);
TransformerFactory factory = TransformerFactory.newInstance();
factory.setURIResolver(genPDFURIResolver);
StreamSource xslSource = new StreamSource(gabaritXSL.openStream(), gabaritXSL.toString());
Transformer transformer = factory.newTransformer(xslSource);
FOTransformer foTransformer = new FOTransformer(transformer, formateur);
foTransformer.transform(new StreamSource(new StringReader(xmlStringData)), target);
}
catch (SAXException e) {
throw new GenerateurPDFException(
"Structure incorrecte de XSL, Xml ou FO: "+e.getMessage(), e);
}
catch (IOException e) {
throw new GenerateurPDFException("Problemes I/O: "+e.getMessage(),e);
}
catch (IllegalArgumentException e) {
throw e;
}
catch (Exception e) {
throw new GenerateurPDFException(e);
}
finally {
if (formateur != null) {
formateur.cleanup();
}
}
}
So, do you have suggestion? I don't want to use a SAXP or other parser... the StreamSource do the job... but, if I am force to change it... I will do it.
I wait for your suggestion,
Frédéric Ouellet
David Tolpin <dvd@davidashen.net>
Envoyé par : owner-xep-support@renderx.com
Pour
xep-support@renderx.com
2004-12-03 01:19 cc
Objet
Veuillez répondre à Re: [xep-support] BASE and ROOT Properties
xep-support@renderx.com
Frederic,
as it is explained in the documentation, to specify where XEP's configuration
resides, set the URL of the configuration file as the value of CONFIG option
(or com.renderx.xep.CONFIG system property).
To set the base URL for a document, specify the systemID for the document
when you pass StreamSource, SAXSource or DOM document to XEP. This is
the standard way to do it.
All this is explained in documentation and demonstrated in the examples
and connectors' source code available with the Integration and Connectivity
Kit.
David
> The parser don't reconize the BASE and ROOT properties in XEP v4.0.
>
> I had used those properties in XEP v3.0.
>
> I want to know how to use the features of BASE and ROOT properties in XEP v4.0.
>
> The xml:base don't seem to be relative for my WEB APPLICATION. Relative URI features are need on a distribute "servers" setting. The BASE properties with the
> URIResolver had work well in the past. I cannot put http://www.mydomain.com because I support many domain. I can only know where I am, when I process the PDF in the
> java class. I do this by accessing the classpath of my URIResolver and check on wich domain the EAR is.
>
> Without a feature to do it, I cannot evolve to v4. This imply a lot of concerns for my administration.
>
> I have put all other information in a couple email : Invalid system ID and XEP v3 to v4.
>
> I hope to have a good and fast answer about this topic.
-------------------
(*) To unsubscribe, send a message with words 'unsubscribe xep-support'
in the body of the message to majordomo@renderx.com from the address
you are subscribed from.
(*) By using the Service, you expressly agree to these Terms of Service http://www.renderx.com/tos.html
-------------------
(*) To unsubscribe, send a message with words 'unsubscribe xep-support'
in the body of the message to majordomo@renderx.com from the address
you are subscribed from.
(*) By using the Service, you expressly agree to these Terms of Service http://www.renderx.com/tos.html
Received on Fri Dec 3 12:36:05 2004
This archive was generated by hypermail 2.1.8 : Fri Dec 03 2004 - 12:36:06 PST