Vous ne trouvez pas de réponse à votre problème ? Alors posez la question dans le forum. Souvenez-vous qu'il n'y a jamais de question bête, mais rester dans l'ignorance parce que l'on n'ose pas poser une question, ça c'est une erreur !

XSL VERS HTML VIA JAVA


Information sur la source

Description

Voila le dernier fichier pour les transformation xml to html via java

ce fichier xsl permet de creer un fichier html via le fichier java que vous trouverez dans mes sources.

J'espere que tous ces fichiers vous aideront pour la transformation vers du html ou pdf par le biais de xsl et xsl:fo et les parser java.
 

Source

  • <?xml version="1.0" encoding="UTF-8"?>
  • <xsl:stylesheet
  • version="1.0"
  • xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
  • <xsl:output method="html" encoding="UTF-8" />
  • <xsl:template match="document">
  • <html lang="fr">
  • <head>
  • <title>
  • <xsl:value-of select="//@type"/>
  • <xsl:value-of select="//code"/>
  • </title>
  • <script type="text/javascript" src="../../include/menu_scripts.js"></script>
  • </head>
  • <body >
  • <!--========================== ========================entete===========================-->
  • <form name="form_devis1" method="post">
  • <xsl:attribute name="action">../document/enreg_doc.jsp?index=entete&amp;type=<xsl:value-of select="//@type"/>
  • </xsl:attribute>
  • <table width="100%" align="center">
  • <tr>
  • <td align="center">
  • <img src="../../images/solinux/solinux_logo.png"></img>
  • </td>
  • <td align="center">
  • <h3><b>
  • <xsl:if test="//@type = 'devis'">
  • Devis
  • </xsl:if>
  • <xsl:if test="//@type = 'facture'">
  • Facture
  • </xsl:if>
  • <xsl:if test="//@type = 'bl'">
  • Bon de livraison
  • </xsl:if>
  • </b></h3><br/>
  • Date :<xsl:if test="//@type != 'bl'">
  • <xsl:value-of select="date_creation"/><br/>
  • <xsl:if test="//@type = 'facture'">
  • Echeance :<input type="text" name="date_valid">
  • <xsl:attribute name="value">
  • <xsl:value-of select="date_validite"/>
  • </xsl:attribute>
  • </input>
  • </xsl:if>
  • <xsl:if test="//@type = 'devis'">
  • Valable jusqu au : <input type="text" name="date_valid">
  • <xsl:attribute name="value">
  • <xsl:value-of select="date_validite"/>
  • </xsl:attribute>
  • </input>
  • </xsl:if>
  • </xsl:if>
  • <xsl:if test="//@type = 'bl'">
  • <input type="text" name="date_valid">
  • <xsl:attribute name="value">
  • <xsl:value-of select="date_validite"/>
  • </xsl:attribute>
  • </input>
  • </xsl:if>
  • </td>
  • </tr>
  • </table>
  • <table border="1" width="100%" align="center">
  • <tr>
  • <td bgcolor="#84b6e0" align="center" width="48%"><font color="white" >Nos references</font></td>
  • <td bgcolor="#84b6e0" align="center" width="48%"><font color="white" >Vos coordonnees</font></td>
  • </tr>
  • <tr>
  • <td> Client : <xsl:value-of select="client"/>
  • <br/>
  • Code : <xsl:value-of select="code"/>
  • <input type="hidden" name="id" >
  • <xsl:attribute name="value">
  • <xsl:value-of select="//@id"/>
  • </xsl:attribute>
  • </input>
  • </td>
  • <td align="center">
  • <table border="0" align="center">
  • <tr>
  • <td colspan="2">
  • </td>
  • </tr>
  • <tr>
  • <td align="center" colspan="2">
  • <input type="hidden" name="cont_societe" >
  • <xsl:attribute name="value">
  • <xsl:value-of select="societe/@id"/>
  • </xsl:attribute>
  • </input>
  • <b><font size="4"><xsl:value-of select="societe"/></font></b>
  • </td>
  • </tr>
  • <tr>
  • <td align="center" colspan="2">
  • <select name="cont_pers" >
  • <xsl:attribute name="onChange">javascript:document.form_devis1.submit();</xsl:attribute>
  • <option value="">Choisir un contact</option>
  • <xsl:apply-templates select="liste"/>
  • </select>
  • </td>
  • </tr>
  • <tr>
  • <td colspan="2" align="center"> <input type="hidden" name="cont_adresse">
  • <xsl:attribute name="value">
  • <xsl:value-of select="adresse"/>
  • </xsl:attribute>
  • </input><xsl:value-of select="adresse"/>
  • </td>
  • </tr>
  • <tr>
  • <td align="center"> <input type="hidden" name="cont_cp">
  • <xsl:attribute name="value">
  • <xsl:value-of select="cp"/>
  • </xsl:attribute>
  • </input>
  • <xsl:value-of select="cp"/>
  • </td>
  • <td align="center"> <input type="hidden" name="cont_ville">
  • <xsl:attribute name="value">
  • <xsl:value-of select="ville"/>
  • </xsl:attribute>
  • </input>
  • <xsl:value-of select="ville"/>
  • </td>
  • </tr>
  • </table>
  • </td>
  • </tr>
  • <tr>
  • <td colspan="2" align="center">
  • <xsl:if test="status != 'valide'">
  • <input type="submit" value="Valider l entete"/>
  • </xsl:if>
  • </td>
  • </tr>
  • </table>
  • </form>
  • <!-- ====================fin de l entete debut du corps==================================-->
  • <table width="100%" align="center">
  • <tr>
  • <td width="4%" align="center">
  • <xsl:if test="status != 'valide'">
  • <xsl:element name="a" >
  • <xsl:attribute name="href">../document/ajout_ligne.jsp?id=<xsl:value-of select="//@id"/>&amp;index=ajout&amp;type=<xsl:value-of select="//@type"/>
  • </xsl:attribute>
  • <img src="../../images/ajout.gif" width="10" height="10" border="0" />
  • </xsl:element>
  • </xsl:if>
  • </td>
  • <td width="96%">
  • <table border="1" width="100%" align="center">
  • <tr>
  • <xsl:if test="//@type != 'bl'">
  • <td bgcolor="#84b6e0" align="center" width="15%"><font color="white" >Reference</font></td>
  • <td bgcolor="#84b6e0" align="center" width="40%"><font color="white" >Designation</font></td>
  • <td bgcolor="#84b6e0" align="center" width="6%"><font color="white" >Q</font></td>
  • <td bgcolor="#84b6e0" align="center" width="15%"><font color="white" >PU HT</font></td>
  • <td bgcolor="#84b6e0" align="center" width="15%"><font color="white" >Total HT</font></td>
  • <td bgcolor="#84b6e0" align="center" width="7%"><font color="white" >TVA</font></td>
  • </xsl:if>
  • <xsl:if test="//@type = 'bl'">
  • <td bgcolor="#84b6e0" align="center" width="25%"><font color="white" >Reference</font></td>
  • <td bgcolor="#84b6e0" align="center" width="65%"><font color="white" >Designation</font></td>
  • <td bgcolor="#84b6e0" align="center" width="10%"><font color="white" >Quantite</font></td>
  • </xsl:if>
  • </tr>
  • </table>
  • </td>
  • </tr>
  • <xsl:apply-templates select="ligne"/>
  • <tr>
  • <td> </td>
  • </tr>
  • </table>
  • <!-- ===========================fin du corps pied de page===================================-->
  • <form name="form_devis2" method="post" action="enreg_devis.jsp">
  • <xsl:if test="//@type != 'bl'">
  • <table border='1' width="100%" align="center">
  • <tr>
  • <td bgcolor="#84b6e0" width='25%'><font color="white" >Paiement</font></td>
  • <td width='25%'><xsl:if test="@type != 'facture'">
  • <input type='text' name="paiement">
  • <xsl:attribute name="value">
  • <xsl:value-of select="paiement"/>
  • </xsl:attribute>
  • </input>
  • </xsl:if>
  • <xsl:if test="@type = 'facture'"><xsl:value-of select="paiement"/></xsl:if></td>
  • <td bgcolor="#84b6e0" width='25%'><font color="white" >Total HT</font></td>
  • <td width='25%'><xsl:value-of select="doc_ht"/></td>
  • </tr>
  • <tr>
  • <td width='25%'></td>
  • <td width='25%'></td>
  • <td bgcolor="#84b6e0" width='25%'><font color="white" >Total TVA</font></td>
  • <td width='25%'><xsl:value-of select="doc_tva"/></td>
  • </tr>
  • <xsl:if test="//@type = 'facture'">
  • <tr>
  • <td/>
  • <td/>
  • <td bgcolor="#84b6e0" width='25%'><font color="white" >Total TTC</font></td>
  • <td width='25%'><xsl:value-of select="doc_ttc"/></td>
  • </tr>
  • </xsl:if>
  • <tr>
  • <td bgcolor="#84b6e0" width='25%'><font color="white" >Acompte</font></td>
  • <td width='25%'>
  • <xsl:if test="@type != 'facture'">
  • <input type='text' name="accompte">
  • <xsl:attribute name="value">
  • <xsl:value-of select="accompte"/>
  • </xsl:attribute>
  • </input>
  • </xsl:if>
  • <xsl:if test="@type = 'facture'"><xsl:value-of select="accompte"/></xsl:if>
  • </td>
  • <xsl:if test="@type = 'facture'">
  • <td bgcolor="#84b6e0" width='25%'><font color="white" >Net a payer</font></td>
  • <td width='25%'>
  • <xsl:variable name="ttc"><xsl:value-of select="doc_ttc"/></xsl:variable>
  • <xsl:variable name="acc"><xsl:value-of select="accompte"/></xsl:variable>
  • <xsl:value-of select="$ttc - $acc"/>
  • </td>
  • </xsl:if>
  • <xsl:if test="@type != 'facture'">
  • <td bgcolor="#84b6e0" width='25%'><font color="white" >Total TTC</font></td>
  • <td width='25%'><xsl:value-of select="doc_ttc"/></td>
  • </xsl:if>
  • </tr>
  • </table>
  • </xsl:if >
  • <table>
  • <tr>
  • <td>
  • <input type="hidden" name="id">
  • <xsl:attribute name="value">
  • <xsl:value-of select="@id"/>
  • </xsl:attribute>
  • </input>
  • <input type="hidden" name="type">
  • <xsl:attribute name="value">
  • <xsl:value-of select="@type"/>
  • </xsl:attribute>
  • </input>
  • <input type="hidden" name="index">
  • <xsl:attribute name="value"></xsl:attribute>
  • </input>
  • <input type="radio" name="statut" value="courant" >
  • <xsl:if test="status = 'courant'">
  • <xsl:attribute name="checked">true</xsl:attribute>
  • </xsl:if>
  • </input>
  • En cours de realisation<br/>
  • <input type="radio" name="statut" value="attente" >
  • <xsl:if test="status = 'attente'">
  • <xsl:attribute name="checked">true</xsl:attribute>
  • </xsl:if>
  • </input>
  • En attente<br/>
  • <input type="radio" name="statut" value="valide" >
  • <xsl:if test="status = 'valide'">
  • <xsl:attribute name="checked">true</xsl:attribute>
  • </xsl:if>
  • </input>
  • Valide<br/>
  • <input type="radio" name="statut" value="annule" >
  • <xsl:if test="status = 'annule'">
  • <xsl:attribute name="checked">true</xsl:attribute>
  • </xsl:if>
  • </input>
  • Annule<br/>
  • </td>
  • </tr>
  • <tr>
  • <td align="center">
  • <xsl:if test="status != 'valide'">
  • <input type="button" value="Enregistrer">
  • <xsl:attribute name="onclick">javascript:verif2();</xsl:attribute>
  • </input>
  • </xsl:if>
  • </td>
  • <td align="center">
  • <xsl:element name="a" >
  • <xsl:attribute name="href">../../servlet/ParserXML.Bdd2Pdf?code=<xsl:value-of select="code"/>&amp;id=<xsl:value-of select="@id"/>&amp;type=mail&amp;envoi=null</xsl:attribute>
  • <img src="../../images/mail.jpg" width="40" height="40" border="0"/>
  • </xsl:element>
  • <xsl:element name="a" >
  • <xsl:attribute name="href">../../doc/pdf/<xsl:value-of select="substring(code,0,10)"/>.pdf</xsl:attribute>
  • <xsl:attribute name="onClick">pdf(<xsl:value-of select="code"/>,<xsl:value-of select="@id"/>)</xsl:attribute>
  • <img src="../../images/print.jpg" width="40" height="40" border="0"/>
  • </xsl:element>
  • </td>
  • </tr>
  • <tr>
  • <td><input type="button" value="Quitter" onClick="javascript:fermer()"/></td>
  • </tr>
  • </table>
  • </form>
  • </body>
  • </html>
  • </xsl:template>
  • <!-- =====================ligne==================================-->
  • <xsl:template match="ligne">
  • <tr>
  • <td width="4%" align="center">
  • <xsl:if test="//status != 'valide'">
  • <table>
  • <tr>
  • <td colspan="2">
  • <xsl:element name="a" >
  • <xsl:attribute name="href">../document/ajout_ligne.jsp?index=ordre_haut&amp;lig_id=<xsl:value-of select="@id"/>&amp;type=<xsl:value-of select="//@type"/>
  • </xsl:attribute>
  • <img src="../../images/desc.png" width="15" height="15" border="0" />
  • </xsl:element>
  • </td>
  • </tr>
  • <tr>
  • <td align="center">
  • <input type="image" src="../../images/supp.gif" width="10" height="10" border="0" alt="Supprimer la ligne">
  • <xsl:attribute name="onClick">
  • verif(<xsl:value-of select="@id"/>,<xsl:value-of select="//@id"/>,"<xsl:value-of select="//@type"/>")
  • </xsl:attribute>
  • <xsl:attribute name="align">middle</xsl:attribute>
  • <xsl:attribute name="name">image</xsl:attribute>
  • </input>
  • </td>
  • <td align="center">
  • <input type="image" src="../../images/modif.gif" width="10" height="10" border="0" alt="Info sur la ligne"> <xsl:attribute name="onClick"></xsl:attribute>
  • <xsl:attribute name="align">middle</xsl:attribute>
  • <xsl:attribute name="name">image</xsl:attribute>
  • </input>
  • </td>
  • </tr>
  • <tr>
  • <td colspan="2">
  • <xsl:element name="a" >
  • <xsl:attribute name="href">../document/ajout_ligne.jsp?index=ordre_bas&amp;lig_id=<xsl:value-of select="@id"/>&amp;type=<xsl:value-of select="//@type"/>
  • </xsl:attribute>
  • <img src="../../images/asc.png" width="15" height="15" border="0" />
  • </xsl:element>
  • </td>
  • </tr>
  • </table>
  • </xsl:if>
  • </td>
  • <td width="96%">
  • <form name="form_ligne" method="post">
  • <xsl:attribute name="action">../document/ajout_ligne.jsp?index=update&amp;type=<xsl:value-of select="//@type"/>
  • </xsl:attribute>
  • <table border="1" width="100%" align="center">
  • <tr>
  • <td align="center" width="15%">
  • <input type="hidden" name="lig_ordre">
  • <xsl:attribute name="value"><xsl:value-of select="@ordre"/></xsl:attribute>
  • </input>
  • <input type="hidden" name="id">
  • <xsl:attribute name="value"><xsl:value-of select="//@id"/></xsl:attribute>
  • </input>
  • <input type="hidden" name="lig_id">
  • <xsl:attribute name="value"><xsl:value-of select="@id"/></xsl:attribute>
  • </input>
  • <xsl:if test="//@type = 'devis'">
  • <input type="text" name="lig_ref" size="13%">
  • <xsl:attribute name="value"><xsl:value-of select="ref"/></xsl:attribute>
  • </input>
  • </xsl:if>
  • <xsl:if test="//@type != 'devis'">
  • <xsl:if test="ref != ' '">
  • <input type="hidden" name="lig_ref">
  • <xsl:attribute name="value"><xsl:value-of select="ref"/></xsl:attribute>
  • </input>
  • <xsl:value-of select="ref"/>
  • </xsl:if>
  • <xsl:if test="ref = ' '">
  • <input type="text" name="lig_ref">
  • <xsl:if test="//@type != 'bl'">
  • <xsl:attribute name="size">23% </xsl:attribute>
  • </xsl:if>
  • <xsl:if test="//@type = 'bl'">
  • <xsl:attribute name="size">8% </xsl:attribute>
  • </xsl:if>
  • </input>
  • </xsl:if>
  • </xsl:if>
  • </td>
  • <td align="center" width="40%">
  • <input type="button" value="editer">
  • <xsl:attribute name="onClick">javascript:editer(<xsl:value-of select="@id"/>)</xsl:attribute>
  • </input><br/>
  • <input type="hidden" name="edit">
  • <xsl:attribute name="value"><xsl:value-of select="description" disable-output-escaping="no"/>
  • </xsl:attribute>
  • </input>
  • <xsl:value-of select="description" disable-output-escaping="yes"/>
  • </td>
  • <td align="center" width="6%">
  • <input type="text" name="lig_quantite" size="4%">
  • <xsl:attribute name="value"><xsl:value-of select="quantite"/></xsl:attribute>
  • <xsl:attribute name="onChange">maj_total(<xsl:value-of select="@ordre"/>)</xsl:attribute>
  • </input>
  • </td>
  • <xsl:if test="//@type != 'bl'">
  • <td align="center" width="15%" >
  • <xsl:if test="//@type = 'devis'">
  • <input type="text" name="lig_pu" size="13%">
  • <xsl:attribute name="value"><xsl:value-of select="pu_ht"/></xsl:attribute>
  • <xsl:attribute name="onChange">maj_total(<xsl:value-of select="@ordre"/>)</xsl:attribute>
  • </input>
  • </xsl:if>
  • <xsl:if test="//@type != 'devis'">
  • <xsl:if test="pu_ht != ' '">
  • <input type="hidden" name="lig_pu">
  • <xsl:attribute name="value"><xsl:value-of select="pu_ht"/></xsl:attribute>
  • </input>
  • <xsl:value-of select="pu_ht"/>
  • </xsl:if>
  • <xsl:if test="pu_ht = ' '">
  • <input type="text" name="lig_pu"/>
  • </xsl:if>
  • </xsl:if>
  • </td>
  • <td align="center" width="15%" >
  • <xsl:if test="//@type = 'devis'">
  • <input type="text" name="lig_prix_total" size="13%">
  • <xsl:attribute name="value"><xsl:value-of select="total_ht"/></xsl:attribute>
  • <xsl:attribute name="onClick">maj_total(<xsl:value-of select="@ordre"/>)</xsl:attribute>
  • </input>
  • </xsl:if>
  • <xsl:if test="//@type != 'devis'">
  • <xsl:if test="total_ht != ' '">
  • <input type="hidden" name="lig_prix_total">
  • <xsl:attribute name="value"><xsl:value-of select="total_ht"/></xsl:attribute>
  • </input><xsl:value-of select="total_ht"/>
  • </xsl:if>
  • <xsl:if test="total_ht = ' '">
  • <input type="text" name="lig_prix_total"/>
  • </xsl:if>
  • </xsl:if>
  • </td>
  • <td align="center" width="7%" >
  • <xsl:if test="//@type = 'devis'">
  • <input type="text" name="lig_tva" size="5%" >
  • <xsl:attribute name="value"><xsl:value-of select="tva"/></xsl:attribute>
  • </input>
  • </xsl:if>
  • <xsl:if test="//@type != 'devis'">
  • <xsl:if test="tva != ' '">
  • <input type="hidden" name="lig_tva">
  • <xsl:attribute name="value"><xsl:value-of select="tva"/></xsl:attribute>
  • </input>
  • <xsl:value-of select="tva"/>
  • </xsl:if>
  • <xsl:if test="tva = ' '">
  • <input type="text" name="lig_tva"/>
  • </xsl:if>
  • </xsl:if>
  • </td>
  • </xsl:if>
  • </tr>
  • <tr>
  • <td colspan="6" align="center">
  • <xsl:if test="//status != 'valide'">
  • <input type="submit" value="Valider la ligne" />
  • </xsl:if>
  • </td>
  • </tr>
  • </table>
  • </form>
  • </td>
  • </tr>
  • </xsl:template>
  • <xsl:template match="liste">
  • <xsl:apply-templates select="contact"/>
  • </xsl:template>
  • <xsl:template match="contact">
  • <option>
  • <xsl:attribute name="value"><xsl:value-of select="@id"/></xsl:attribute>
  • <xsl:if test="@checked='true'">
  • <xsl:attribute name="selected">true</xsl:attribute>
  • </xsl:if>
  • <xsl:value-of select="."/>
  • </option>
  • </xsl:template>
  • </xsl:stylesheet>
<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet
    version="1.0"
    xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
  <xsl:output method="html" encoding="UTF-8" />




  <xsl:template match="document">

		<html lang="fr">
			<head>
				<title>
					<xsl:value-of select="//@type"/>
					<xsl:value-of select="//code"/>
				</title>
				<script type="text/javascript" src="../../include/menu_scripts.js"></script>
				
			</head>
			<body >

<!--========================== ========================entete===========================-->
<form name="form_devis1" method="post">
 <xsl:attribute name="action">../document/enreg_doc.jsp?index=entete&amp;type=<xsl:value-of select="//@type"/>
	</xsl:attribute>
		<table width="100%" align="center">
				<tr>
					<td align="center">
						<img src="../../images/solinux/solinux_logo.png"></img>
					</td>
					<td align="center">
					<h3><b>
						<xsl:if test="//@type = 'devis'">
							Devis
						</xsl:if>
						<xsl:if test="//@type = 'facture'">
							Facture
						</xsl:if>
						<xsl:if test="//@type = 'bl'">
							Bon de livraison
						</xsl:if>
					</b></h3><br/>
					Date :<xsl:if test="//@type != 'bl'">
						<xsl:value-of select="date_creation"/><br/>
						<xsl:if test="//@type = 'facture'">
							Echeance :<input type="text" name="date_valid">
  							<xsl:attribute name="value">
    								<xsl:value-of select="date_validite"/>
  							</xsl:attribute>
							</input>

						</xsl:if>
						<xsl:if test="//@type = 'devis'">
					Valable jusqu au : <input type="text" name="date_valid">
  							<xsl:attribute name="value">
    								<xsl:value-of select="date_validite"/>
  							</xsl:attribute>
						</input>
						</xsl:if>
						</xsl:if>
						<xsl:if test="//@type = 'bl'">
						<input type="text" name="date_valid">
  							<xsl:attribute name="value">
    								<xsl:value-of select="date_validite"/>
  							</xsl:attribute>
						</input>
						</xsl:if>
					</td>
				</tr>
			</table>
			<table border="1" width="100%" align="center">
				<tr>
					<td bgcolor="#84b6e0" align="center" width="48%"><font color="white" >Nos references</font></td>
					<td bgcolor="#84b6e0" align="center" width="48%"><font color="white" >Vos coordonnees</font></td>
				</tr>
				<tr>
					<td>  Client : <xsl:value-of select="client"/>

						<br/>
						  Code : <xsl:value-of select="code"/>

					<input type="hidden" name="id" >
  							<xsl:attribute name="value">
    								<xsl:value-of select="//@id"/>
  							</xsl:attribute>
						</input>
					</td>
					<td align="center">
						<table border="0" align="center">
							<tr>
								<td colspan="2">
				 				</td>
							</tr>
							<tr>
								<td align="center" colspan="2">
			 						<input type="hidden"  name="cont_societe" >
										<xsl:attribute name="value">
    											<xsl:value-of select="societe/@id"/>
  										</xsl:attribute>
									</input>
									<b><font size="4"><xsl:value-of select="societe"/></font></b>
								</td>

							</tr>
							<tr>
								<td align="center" colspan="2">
									<select name="cont_pers" >
										<xsl:attribute name="onChange">javascript:document.form_devis1.submit();</xsl:attribute>
										<option value="">Choisir un contact</option>
										<xsl:apply-templates select="liste"/>

                							</select>
								</td>
							</tr>
							<tr>
								<td  colspan="2" align="center"> <input type="hidden"  name="cont_adresse">
  							<xsl:attribute name="value">
								<xsl:value-of select="adresse"/>
  							</xsl:attribute>
     							 </input><xsl:value-of select="adresse"/>
								</td>
							</tr>
							<tr>
								<td align="center"> <input type="hidden" name="cont_cp">
  							<xsl:attribute name="value">
								<xsl:value-of select="cp"/>
  							</xsl:attribute>
						</input>
						<xsl:value-of select="cp"/>
						</td>
								<td align="center"> <input type="hidden" name="cont_ville">
  							<xsl:attribute name="value">
								<xsl:value-of select="ville"/>
  							</xsl:attribute>
						</input>
						<xsl:value-of select="ville"/>
						</td>
							</tr>
						</table>
					</td>
				</tr>
				<tr>
					<td colspan="2" align="center">
						<xsl:if test="status != 'valide'">
							<input type="submit" value="Valider l entete"/>

						</xsl:if>
					</td>
				</tr>
			</table>
		</form>
<!-- ====================fin de l entete            debut du corps==================================-->
			<table  width="100%" align="center">
	<tr>
		<td width="4%"  align="center">
			<xsl:if test="status != 'valide'">
			<xsl:element name="a" >
				<xsl:attribute name="href">../document/ajout_ligne.jsp?id=<xsl:value-of select="//@id"/>&amp;index=ajout&amp;type=<xsl:value-of select="//@type"/>
				</xsl:attribute>
				<img src="../../images/ajout.gif" width="10" height="10" border="0" />
			</xsl:element>
			</xsl:if>
		</td>

		<td width="96%">
			<table border="1" width="100%" align="center">
				<tr>
				<xsl:if test="//@type != 'bl'">
					<td bgcolor="#84b6e0" align="center" width="15%"><font color="white" >Reference</font></td>
					<td bgcolor="#84b6e0" align="center" width="40%"><font color="white" >Designation</font></td>
					<td bgcolor="#84b6e0" align="center" width="6%"><font color="white" >Q</font></td>
					<td bgcolor="#84b6e0" align="center" width="15%"><font color="white" >PU HT</font></td>
					<td bgcolor="#84b6e0" align="center" width="15%"><font color="white" >Total HT</font></td>
					<td bgcolor="#84b6e0" align="center" width="7%"><font color="white" >TVA</font></td>
				</xsl:if>
				<xsl:if test="//@type = 'bl'">
					<td bgcolor="#84b6e0" align="center" width="25%"><font color="white" >Reference</font></td>
					<td bgcolor="#84b6e0" align="center" width="65%"><font color="white" >Designation</font></td>
					<td bgcolor="#84b6e0" align="center" width="10%"><font color="white" >Quantite</font></td>
				</xsl:if>
				</tr>
			</table>
		</td>
	</tr>

		<xsl:apply-templates select="ligne"/>

	<tr>
		<td> </td>
	</tr>
</table>

<!-- ===========================fin du corps    pied de page===================================-->

<form name="form_devis2" method="post" action="enreg_devis.jsp">
<xsl:if test="//@type != 'bl'">
<table border='1' width="100%" align="center">

	<tr>
		<td bgcolor="#84b6e0" width='25%'><font color="white" >Paiement</font></td>
		<td width='25%'><xsl:if test="@type != 'facture'">
			<input type='text' name="paiement">
						<xsl:attribute name="value">
    								<xsl:value-of select="paiement"/>

  							</xsl:attribute>
						</input>
						</xsl:if>
					<xsl:if test="@type = 'facture'"><xsl:value-of select="paiement"/></xsl:if></td>
		<td bgcolor="#84b6e0" width='25%'><font color="white" >Total HT</font></td>
		<td width='25%'><xsl:value-of select="doc_ht"/></td>
	</tr>
	<tr>
		<td width='25%'></td>
		<td width='25%'></td>
		<td bgcolor="#84b6e0" width='25%'><font color="white" >Total TVA</font></td>
		<td width='25%'><xsl:value-of select="doc_tva"/></td>
	</tr>
	<xsl:if test="//@type = 'facture'">
	<tr>
		<td/>
		<td/>
		<td bgcolor="#84b6e0" width='25%'><font color="white" >Total TTC</font></td>
		<td width='25%'><xsl:value-of select="doc_ttc"/></td>
	</tr>
	</xsl:if>
	<tr>
		<td bgcolor="#84b6e0" width='25%'><font color="white" >Acompte</font></td>
		<td width='25%'>
			<xsl:if test="@type != 'facture'">
			<input type='text' name="accompte">
						<xsl:attribute name="value">
    								<xsl:value-of select="accompte"/>

  							</xsl:attribute>
						</input>
						</xsl:if>
					<xsl:if test="@type = 'facture'"><xsl:value-of select="accompte"/></xsl:if>
		</td>
	<xsl:if test="@type = 'facture'">
		<td bgcolor="#84b6e0" width='25%'><font color="white" >Net a payer</font></td>
		<td width='25%'>
			<xsl:variable name="ttc"><xsl:value-of select="doc_ttc"/></xsl:variable>
			<xsl:variable name="acc"><xsl:value-of select="accompte"/></xsl:variable>
			<xsl:value-of select="$ttc - $acc"/>
		</td>
	</xsl:if>

	<xsl:if test="@type != 'facture'">
		<td bgcolor="#84b6e0" width='25%'><font color="white" >Total TTC</font></td>
		<td width='25%'><xsl:value-of select="doc_ttc"/></td>
	</xsl:if>
	</tr>



</table>
</xsl:if >
<table>
	<tr>
		<td>
		<input type="hidden" name="id">
			<xsl:attribute name="value">
    				<xsl:value-of select="@id"/>
  			</xsl:attribute>
		</input>
		<input type="hidden" name="type">
			<xsl:attribute name="value">
    				<xsl:value-of select="@type"/>
  			</xsl:attribute>
		</input>
		<input type="hidden" name="index">
			<xsl:attribute name="value"></xsl:attribute>
		</input>
		<input type="radio" name="statut" value="courant" >
			<xsl:if test="status = 'courant'">
				<xsl:attribute name="checked">true</xsl:attribute>
			</xsl:if>
		</input>
		En cours de realisation<br/>
		<input type="radio" name="statut" value="attente" >
		<xsl:if test="status = 'attente'">
		<xsl:attribute name="checked">true</xsl:attribute>
		</xsl:if>
		</input>
		En attente<br/>
		<input type="radio" name="statut" value="valide" >
			<xsl:if test="status = 'valide'">
				<xsl:attribute name="checked">true</xsl:attribute>
			</xsl:if>
		</input>
		Valide<br/>
		<input type="radio" name="statut" value="annule" >
			<xsl:if test="status = 'annule'">
				<xsl:attribute name="checked">true</xsl:attribute>
			</xsl:if>
		</input>
		Annule<br/>
		</td>
	</tr>
	<tr>
		<td  align="center">
			<xsl:if test="status != 'valide'">
				<input type="button" value="Enregistrer">
					<xsl:attribute name="onclick">javascript:verif2();</xsl:attribute>
				</input>


			</xsl:if>
		</td>
		<td align="center">
		<xsl:element name="a" >
				<xsl:attribute name="href">../../servlet/ParserXML.Bdd2Pdf?code=<xsl:value-of select="code"/>&amp;id=<xsl:value-of select="@id"/>&amp;type=mail&amp;envoi=null</xsl:attribute>
				<img src="../../images/mail.jpg" width="40" height="40" border="0"/>
			</xsl:element>
			<xsl:element name="a" >
				<xsl:attribute name="href">../../doc/pdf/<xsl:value-of select="substring(code,0,10)"/>.pdf</xsl:attribute>
				<xsl:attribute name="onClick">pdf(<xsl:value-of select="code"/>,<xsl:value-of select="@id"/>)</xsl:attribute>
				<img src="../../images/print.jpg" width="40" height="40" border="0"/>
			</xsl:element>


		</td>
	</tr>
	<tr>

		<td><input type="button" value="Quitter"  onClick="javascript:fermer()"/></td>
	</tr>
</table>
</form>



			</body>
		</html>

	</xsl:template>



<!-- =====================ligne==================================-->
<xsl:template match="ligne">
<tr>
<td width="4%" align="center">
	<xsl:if test="//status != 'valide'">
	<table>

		<tr>

			<td colspan="2">
				<xsl:element name="a" >
				<xsl:attribute name="href">../document/ajout_ligne.jsp?index=ordre_haut&amp;lig_id=<xsl:value-of select="@id"/>&amp;type=<xsl:value-of select="//@type"/>
				</xsl:attribute>
				<img src="../../images/desc.png" width="15" height="15" border="0" />
				</xsl:element>
			</td>
		</tr>
		<tr>

			<td align="center">

				<input type="image"  src="../../images/supp.gif" width="10" height="10" border="0" alt="Supprimer la ligne">
				<xsl:attribute name="onClick">
  					verif(<xsl:value-of select="@id"/>,<xsl:value-of select="//@id"/>,"<xsl:value-of select="//@type"/>")
				</xsl:attribute>
				<xsl:attribute name="align">middle</xsl:attribute>
				<xsl:attribute name="name">image</xsl:attribute>
				</input>

			</td>
			<td  align="center">
			<input type="image" src="../../images/modif.gif" width="10" height="10" border="0" alt="Info sur la ligne"> 					<xsl:attribute name="onClick"></xsl:attribute>
				<xsl:attribute name="align">middle</xsl:attribute>
				<xsl:attribute name="name">image</xsl:attribute>
				</input>
			</td>
		</tr>
		<tr>
			<td colspan="2">
				<xsl:element name="a" >
				<xsl:attribute name="href">../document/ajout_ligne.jsp?index=ordre_bas&amp;lig_id=<xsl:value-of select="@id"/>&amp;type=<xsl:value-of select="//@type"/>
				</xsl:attribute>
				<img src="../../images/asc.png" width="15" height="15" border="0" />
				</xsl:element>
			</td>

		</tr>
	</table>
	</xsl:if>
</td>
<td width="96%">
   <form name="form_ligne" method="post">
   	<xsl:attribute name="action">../document/ajout_ligne.jsp?index=update&amp;type=<xsl:value-of select="//@type"/>
	</xsl:attribute>
	<table border="1" width="100%" align="center">
		<tr>
			<td  align="center" width="15%">
				<input type="hidden" name="lig_ordre">
					<xsl:attribute name="value"><xsl:value-of select="@ordre"/></xsl:attribute>
				</input>
				<input type="hidden" name="id">
					<xsl:attribute name="value"><xsl:value-of select="//@id"/></xsl:attribute>
				</input>
				<input type="hidden" name="lig_id">
					<xsl:attribute name="value"><xsl:value-of select="@id"/></xsl:attribute>
				</input>
				<xsl:if test="//@type = 'devis'">
					<input type="text" name="lig_ref"  size="13%">
						<xsl:attribute name="value"><xsl:value-of select="ref"/></xsl:attribute>
					</input>
				</xsl:if>
				<xsl:if test="//@type != 'devis'">
					<xsl:if test="ref != ' '">
				<input type="hidden" name="lig_ref">
						<xsl:attribute name="value"><xsl:value-of select="ref"/></xsl:attribute>
					</input>
					<xsl:value-of select="ref"/>
					</xsl:if>
					<xsl:if test="ref = ' '">
						<input type="text" name="lig_ref">
							<xsl:if test="//@type != 'bl'">
							<xsl:attribute name="size">23% </xsl:attribute>
						</xsl:if>
						<xsl:if test="//@type = 'bl'">
							<xsl:attribute name="size">8% </xsl:attribute>
						</xsl:if>
						</input>
					</xsl:if>
				</xsl:if>
			</td>
			<td  align="center" width="40%">

			<input type="button" value="editer">
				<xsl:attribute name="onClick">javascript:editer(<xsl:value-of select="@id"/>)</xsl:attribute>
			</input><br/>
			<input type="hidden" name="edit">
				<xsl:attribute name="value"><xsl:value-of select="description" disable-output-escaping="no"/>
				</xsl:attribute>
			</input>
			<xsl:value-of select="description" disable-output-escaping="yes"/>


			</td>
			<td  align="center" width="6%">

				<input  type="text" name="lig_quantite" size="4%">
					<xsl:attribute name="value"><xsl:value-of select="quantite"/></xsl:attribute>
					<xsl:attribute name="onChange">maj_total(<xsl:value-of select="@ordre"/>)</xsl:attribute>
				</input>

			</td>
			<xsl:if test="//@type != 'bl'">
			<td  align="center" width="15%" >
				<xsl:if test="//@type = 'devis'">
				<input  type="text" name="lig_pu" size="13%">
					<xsl:attribute name="value"><xsl:value-of select="pu_ht"/></xsl:attribute>
					<xsl:attribute name="onChange">maj_total(<xsl:value-of select="@ordre"/>)</xsl:attribute>
				</input>
				</xsl:if>
				<xsl:if test="//@type != 'devis'">
					<xsl:if test="pu_ht != ' '">
					<input type="hidden" name="lig_pu">
						<xsl:attribute name="value"><xsl:value-of select="pu_ht"/></xsl:attribute>

					</input>
					<xsl:value-of select="pu_ht"/>
				</xsl:if>
				<xsl:if test="pu_ht = ' '">
					<input type="text" name="lig_pu"/>
				</xsl:if>
			</xsl:if>
			</td>
			<td  align="center" width="15%" >
   			<xsl:if test="//@type = 'devis'">
				<input  type="text" name="lig_prix_total"  size="13%">
					<xsl:attribute name="value"><xsl:value-of select="total_ht"/></xsl:attribute>
					<xsl:attribute name="onClick">maj_total(<xsl:value-of select="@ordre"/>)</xsl:attribute>
				</input>
    			</xsl:if>
				<xsl:if test="//@type != 'devis'">
					<xsl:if test="total_ht != ' '">
					<input type="hidden" name="lig_prix_total">
						<xsl:attribute name="value"><xsl:value-of select="total_ht"/></xsl:attribute>
					</input><xsl:value-of select="total_ht"/>
				</xsl:if>
				<xsl:if test="total_ht = ' '">
					<input type="text" name="lig_prix_total"/>
				</xsl:if>
			</xsl:if>
			</td>
			<td  align="center" width="7%" >
			<xsl:if test="//@type = 'devis'">
				<input  type="text" name="lig_tva" size="5%" >
					<xsl:attribute name="value"><xsl:value-of select="tva"/></xsl:attribute>
				</input>
			</xsl:if>
			<xsl:if test="//@type != 'devis'">
				<xsl:if test="tva != ' '">
				<input type="hidden" name="lig_tva">
					<xsl:attribute name="value"><xsl:value-of select="tva"/></xsl:attribute>
				</input>
				<xsl:value-of select="tva"/>
			</xsl:if>
				<xsl:if test="tva = ' '">
					<input type="text" name="lig_tva"/>
				</xsl:if>
			</xsl:if>
			</td>
   			</xsl:if>
		</tr>
		<tr>
			<td colspan="6" align="center">
    				<xsl:if test="//status != 'valide'">
					<input type="submit" value="Valider la ligne" />

				</xsl:if>
			</td>
		</tr>
	</table>
  </form>
</td>
</tr>
</xsl:template>

<xsl:template match="liste">
	<xsl:apply-templates select="contact"/>
</xsl:template>

<xsl:template match="contact">
<option>
	<xsl:attribute name="value"><xsl:value-of select="@id"/></xsl:attribute>
	<xsl:if test="@checked='true'">
		<xsl:attribute name="selected">true</xsl:attribute>
	</xsl:if>
	<xsl:value-of select="."/>
</option>

</xsl:template>

</xsl:stylesheet>

Commentaires et avis

Aucun commentaire pour le moment.

Ajouter un commentaire

Discussions en rapport avec ce code source dans le forum

generer html avec xml+xsl depuis application java [ par scrogneugneu ] J'ai un fichier xml et un xsl permettant (théoriquement) de générer du html.Question : comment faire depuis un programme java pour générer ce fichier generer html a partir de xml en utilisant xsl/fo [ par minou2005 ] j'ai un document xml et un autre xsl/fo a partir d'eux j'ai g&#233;ner&#233; un fichier pdf(en utilsant fop et java).mon question : j'ai besoin mainte convertir un html en xml suivant un xsd [ par bassoumbassoum ] salut je veux savoir comment convertir un html en xml via un xsd XML->XSL-FO->RTF [ par fredmorvant29 ] bjr,jutilise FOP pr transformer un flux xml en fichier PDF vias une feuille de style xsl-fo.et maintenant jessaie d'utiliser JFOR pour générer un fich html ou xml? [ par limalima ] Bonjour,J'ai envie d'apprendre le html mais on m'a dit que vu que je me suis lancé dans java, il vaut mieux d'apprende le xml.ma question est donc à q xml,xsl [ par amira21 ] SOSUrgent....Je cherche à créer un parseur de xsl qui peut prendre un fichier xsl en entrée et produire le design correspondant.C utile et très urgent convertir de html en des objcet [ par bassoumbassoum ] salut , au secours aidez moi je suis bloqué mon probleme estest ce que je peux convertir une code html en des objets en java par exemple balise IMG se Récupérer données formulaire html [ par bidule7 ] Bonjour, voilà, j'ai créé un formulaire HTML avec Netbeans. Quand on le remplit, ça devrait créer un fichier XML rempli avec les valeurs entrées dans tranformer un fichier xml en fichier java a travers un xsl [ par hannounamah ] slt tt le monde,svp est ce que quelqu'un peut me donner une fonction qui prend en parametre le path d'un fichier xml, celui d'un fichier xsl et  celui récupérer contenu d'une balise XML contenant du HTML [ par neg03 ] Bonjour, je possède un parseur XML qui fonctionne mais mon souci est que je n'arrive pas à récupérer le contenu HTML(en gardant les balises html) prés


Nos sponsors

Sondage...

CalendriCode

Juillet 2009
LMMJVSD
  12345
6789101112
13141516171819
20212223242526
2728293031  

Consulter la suite du CalendriCode

Téléchargements

Logiciels à télécharger sur le même thème :

Comparez les prix Nouvelle version

Photothèque Nouveau !



Développement réalisé par Nicolas SOREL (Nix) avec l'aide de : Cyril DURAND et Emmanuel (EBArtSoft), Merci à Vincent pour ses précieux conseils
CodeS-SourceS.com© Toute reproduction même partielle est interdite sauf accord écrit du Webmaster
CodeS-SourceS.com© est une marque déposée tous droits réservés
Temps d'éxécution de la page : 0,484 sec

Google Coop CodeS-SourceS Google Coop CodeS-SourceS


Certaines images présentes sur le site (notament certains avatars) sont issues des collections IconShock, donc si vous souhaitez utiliser ces icons vous devez les acheter, ne les copiez pas et ne utilisez pas dans vos sites et applications sans les avoir commandé.