bonjour

j'ai un programme qui génère des fichiers xml ; une feuille de style a été mise en place pour faire une sortie du xml en fichier html
dans l'entete du fichier xml y'a bien sur le llien avec le fichier xsl.. il faut cliquer sur le fichier xml pour faire apparaitre bien sur l'affichage en format html. maintenant il faut que le programme génère le fichier xml et le fichier html.
j'ai mis en place le code suivant;
CoInitialize(NULL);
IXMLDOMDocument2Ptr DOMDocxml;
IXMLDOMDocument2Ptr DOMDocxsl;
IXSLTemplatePtr templateXsl;
IXSLProcessorPtr processorptr;

//Create a DOMDocument object.
DOMDocxml = CoFreeThreadedDOMDocument40::Create();

if(DOMDocxml.IsBound())
{
DOMDocxml->async = (TOLEBOOL)false;

TOLEBOOL test = DOMDocxml->load(TVariantInParam(WideString("MyXml.XML").Detach(), true));
if((bool)test == true)
{
//Create a DOMDocument object.
DOMDocxsl = CoFreeThreadedDOMDocument40::Create();

//define the DOM document content.
if(DOMDocxsl.IsBound())
{
DOMDocxsl->async = (TOLEBOOL)false;
//smartpointerDOMDocxsd->validateOnParse = (TOLEBOOL)false;

TOLEBOOL test = DOMDocxsl->load(TVariantInParam(WideString("MyXls.xsl").Detach(), true));
if((bool)test == true)
{
templateXsl = CoXSLTemplate40::Create();

if (templateXsl.IsBound() == true)
{
templateXsl->stylesheet = DOMDocxsl;
templateXsl->createProcessor((IXSLProcessorPtr*)&processorptr);
if (processorptr.IsBound () == true)
{
processorptr->set_input(TVariantInParam( (IUnknown*)DOMDocxml));

TOLEBOOL toto = processorptr->transform ();
if ((bool)toto == true)
{
TVariant toto = processorptr->get_output ();
AnsiString str = toto;
AnsiString htmlFile = "toto.html";

TStringList* p = new TStringList();
p->Add(str);
p->SaveToFile ("myHtml.html");

}
}
}
}
}

}
}
CoUninitialize();
voila si ca intéresse quelqu'un