IdentifiantMot de passe
Loading...
Mot de passe oublié ?Je m'inscris ! (gratuit)
Navigation

Inscrivez-vous gratuitement
pour pouvoir participer, suivre les réponses en temps réel, voter pour les messages, poser vos propres questions et recevoir la newsletter

Langage PHP Discussion :

problème XML error: SYSTEM or PUBLIC, the URI is missing at line 1


Sujet :

Langage PHP

  1. #1
    Membre régulier
    Inscrit en
    Février 2008
    Messages
    455
    Détails du profil
    Informations forums :
    Inscription : Février 2008
    Messages : 455
    Points : 109
    Points
    109
    Par défaut problème XML error: SYSTEM or PUBLIC, the URI is missing at line 1
    Bonjour,

    Je commence au XMl et je pète un peu les plombs car là je suis bloqué et j'arrive pas à passé ce problème qui à l'aire assez fréquent mais j'arrive pas à le résoudre ou alors j'ai pas compris le problème

    si quelqu'un peut m'expliqué la source de ce problème ce serait gentille je vous montre le code pour que sa vous aide

    Merci d'avance

    PS: je vous demande pas de coriger mon code mais juste de m'orienter svp.

    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    22
    23
    24
    25
    26
    27
    28
    29
    30
    31
    32
    33
    34
    35
    36
    37
    38
    39
    40
    41
    42
    43
    44
    45
    46
    47
    48
    49
    50
    51
    52
    53
    54
    55
    56
    57
    58
    59
    60
    61
    62
    63
    64
    65
    66
    67
    68
    69
    70
    71
    72
    73
    74
    75
    76
    77
    78
    79
    80
    81
    82
    83
    84
    85
    86
    87
    88
    89
    90
    91
    92
    93
    94
    95
    96
    97
    98
    99
    100
    101
    102
    103
    104
    105
    106
    107
    108
    109
    110
    111
    112
    113
    114
    115
    116
    117
    118
    119
    120
    121
    122
    123
    124
    125
    126
    127
    128
    129
    130
    131
    132
    133
    134
    135
    136
    137
    138
    139
    140
    141
    142
    143
    144
    145
    146
    147
    148
    149
    150
    151
    152
    153
    154
    155
    156
    157
    158
    159
    160
    161
    162
    163
    164
    165
    166
    167
    168
    169
    170
    171
    172
    173
    174
    175
    176
    177
    178
    179
    180
    181
    182
    183
    184
    185
    186
    187
    188
    189
    190
     
    <?php
     
    $merchantCode="teste";  // Don't put this in a public readable place
    $password="test";  // Don't put this in a public readable place
    $orderCode="example".time();
     
    // Shopper specific details
    $shopperEmailAddress="alix@yopmail.com";
    $shopperID="shopper-123456";
    $firstName="John";
    $lastName="Doe";
    $shopperStreet="11 Hereortherestreet";
    $postalCode="1234 KL";
    $shopperCity="myCiti";
    $shopperTelephone="00123456789";
    $countryCode="TP";
     
    $url ="https://url-de-test.jsp";//it is better to keep this url outside your HTML dir which has public (internet) access
     
    //$xml is the order string to send to bibit
    $xml="
     
     
    <?xml version='1.0' encoding='utf-8'?>
    <!DOCTYPE paymentService PUBLIC '-//test/DTD test PaymentService v1//EN' 'http://dtd.teste.com/paymentService_v1.dtd'>
    <paymentService version='1.0' merchantCode='teste'>
    <submit>
    <order orderCode = '".time()."'>
    <description>PDD webshop</description>
    <amount value='1982' currencyCode = 'EUR' exponent = '2'/>
    <orderContent>
    <![CDATA[
    <center><table>
    <tr><td bgcolor='#CCCCCC'>Your Internet Order:</td><td colspan='2' bgcolor='#ffff00' align='right'>AY 845</td></tr>
    <tr><td bgcolor='#ffff00'>Description:</td><td>14 Tulip bulbs</td><td align='right'>1,00</td></tr>
    <tr><td colspan='2'>Subtotal:</td><td align='right'>14,00</td></tr>
    <tr><td colspan='2'>VAT: 13%</td><td align='right'>1,82</td></tr>
    <tr><td colspan='2'>Shipping and Handling:</td><td align='right'>4,00</td></tr>
    <tr><td colspan='2' bgcolor='#c0c0c0'>Total cost:</td><td bgcolor='#c0c0c0' align='right'>Euro 19,82</td></tr>
    <tr><td colspan='3'>&nbsp;</td></tr>
    <tr><td bgcolor='#ffff00' colspan='3'>Your billing address:</td></tr>
    <tr><td colspan='3'>Mr. $lastName,<br>$shopperStreet,<br>$postalCode $shopperCity,<br>Thisplace.</td></tr>
    <tr><td colspan='3'>&nbsp;</td></tr>
    <tr><td bgcolor='#ffff00' colspan='3'>Your shipping address:</td></tr>
    <tr><td colspan='3'>Mr. $lastName,<br>$shopperStreet,<br>$postalCode $shopperCity,<br>Thisplace.</td></tr>
    <tr><td colspan='3'>&nbsp;</td></tr>
    <tr><td bgcolor='#ffff00' colspan='3'>Our contact information:</td></tr>
    <tr><td colspan='3'>ACME Webshops Int. Inc.,<br>11 Strangewood Blv.,<br>1255 KZ Thisisit,<br>Nowhereatall.<br><br>acmeweb@acme.inc<br>(555) 1235 456</td></tr>
    <tr><td colspan='3'>&nbsp;</td></tr>
    <tr><td bgcolor='#c0c0c0' colspan='3'>Billing notice:</td></tr>
    <tr><td colspan='3'>Your payment will be handled by test Global Payments Services<br>This name may appear on your bank statement<br>http://www.teste.com</td></tr>
    </table></center>
    ]]>
    </orderContent>
    <paymentMethodMask>
    <include code='ALL'/>
    </paymentMethodMask>
    <shopper>
    <shopperEmailAddress>$shopperEmailAddress</shopperEmailAddress> <authenticatedShopperID>$shopperID</authenticatedShopperID>
    </shopper>
    <shippingAddress>
    <address>
    <firstName>$firstName</firstName>
    <lastName>$lastName</lastName>
    <street>$shopperStreet</street>
    <postalCode>$postalCode</postalCode>
    <city>$shopperCity</city>
    <countryCode>$countryCode</countryCode>
    <telephoneNumber>$shopperTelephone</telephoneNumber>
    </address>
    </shippingAddress>
    </order>
    </submit>
    </paymentService>";//$xml is the order string to send to bibit
     
     
    //let's make the socket connection
     
    //make socket connection with bibit
    //the curl library is used. make sure you have it installed propperly
    // more info: http://www.php.net/manual/en/ref.curl.php
     
     
     
    				$ch = curl_init ($url);
                     curl_setopt($ch, CURLOPT_POST,1);
                     curl_setopt($ch, CURLOPT_POSTFIELDS,$xml);   //$xml is the xml string
                     curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
                     curl_setopt($ch, CURLOPT_NOPROGRESS, 0);
     
                    // echo "ch: $ch<HR>" ;
     
                     $result = curl_exec ($ch); // result will contain XML reply from test curl_close ($ch);
                    if ( $result == false )
                    {
                            $this->error = "Curl could not retrieve page '$this->url', curl_exec returns false";               
                    	return $result;
           			 }
     
    //now we have the result from test containing the xml answer. we need to parse this through the XML parser
    // initialize parser //using SAX parser
    //
    //more info on SAX/PHP on these urls
    // http://www.devshed.com/Server_Side/XML/XMLwithPHP/XMLwithPHP1/page1.html
    // http://www.php.net/manual/en/ref.xml.php
     
     
    function startElement($parser, $name, $attrs) 
    {
    	global $currentTag,$ordercode,$referenceID,$errorcode,$url_togoto;
    	$currentTag = $name;
     
    	switch ($name) {
    		case "ERROR": 
     
    /*	
    THERE IS AN XML ERROR REPLY
    1 : internal error, could be everything
    2 : parse error, invalid xml
    3 : invalid number of transactions in batch
    4 : security error
    5 : invalid request
    6 : invalid content, occurs when xml is valid but content of xml not
    7 : payment details in the order element are incorrect
    */
    		$errorcode = $attrs['CODE']; //example of how to catch the error code number (i.e. 1 to 7)
    		$url_error="error_order.php";
    			break;
     
    		case "REFERENCE":
    			$referenceID = $attrs['ID'];//for storage in your own database
    			break;
     
    		case "ORDERSTATUS":
    			$ordercode = $attrs['ORDERCODE'];
    			break;
     
    		default:
    			break;
    	}
    }
     
     
    //////////////////
    function endElement($parser, $name) {
    	global $currentTag;
    	$currentTag = "";
    }
     
    /////////////////
    function characterData($parser, $result) {
     
    	global $currentTag;
    	global $url_togoto;
     
    	switch ($currentTag) {
     
    	case "REFERENCE":
    		//there is a REFERENCE so there must be an url which was provided by test for the actual payment. echo $result;
    		$url_togoto=$result;
    		break;
     
    	default:
    		break;
    	}
    }
     
    global $currentTag,$ordercode,$referenceID,$errorcode,$url_togoto;//define globals
    $xml_parser = xml_parser_create();
     
    // set callback functions
    xml_set_element_handler($xml_parser, "startElement", "endElement");
    xml_set_character_data_handler($xml_parser, "characterData");
     
    if (!xml_parse($xml_parser, $result))
    {
        die(sprintf("XML error: %s at line %d",
    	xml_error_string(xml_get_error_code($xml_parser)),
    	xml_get_current_line_number($xml_parser)));
    }
     
    // clean up
    xml_parser_free($xml_parser);
    //now we have a few important variables. Depending on what variables are set you can now perform an action like storing id's in your database or refer to a different url.
    echo "ordercode=$ordercode<BR>";
    echo "referenceID=$referenceID<BR>";
    echo "errorcode=$errorcode<BR>";
    echo "url_togoto=$url_togoto<BR>";
    ?>
    merci pour votre aide

  2. #2
    Expert confirmé
    Avatar de Thes32
    Homme Profil pro
    Développeur PHP, .Net, T-SQL
    Inscrit en
    Décembre 2006
    Messages
    2 379
    Détails du profil
    Informations personnelles :
    Sexe : Homme

    Informations professionnelles :
    Activité : Développeur PHP, .Net, T-SQL

    Informations forums :
    Inscription : Décembre 2006
    Messages : 2 379
    Points : 4 853
    Points
    4 853
    Par défaut
    Salut,
    ton affectation sur la variable $xml pose problème il doit y avoir conflit sur les ".

    Regardes cet article pour mieux comprendre : Apostrophes ou guillemets : lesquels choisir ? .

    Je te conseil vivement d'utiliser les fonctions dédiées aux XMLs pour une meilleure manipulation. Tu peux lire : Création d'un système RSS pour vos news avec PHP 4 et 5 .
    Développeur | Zend Certified Engineer

    Étapes Pour mieux se servir du forum:
    1. Commencez par lire les cours et tutoriels ;
    2. Faites une recherche;
    3. Faites un post si rien trouvé dans les deux étapes précédentes en respectant les règles;

    Nix>_Rien n'est plus pratique que la théorie

  3. #3
    Membre régulier
    Inscrit en
    Février 2008
    Messages
    455
    Détails du profil
    Informations forums :
    Inscription : Février 2008
    Messages : 455
    Points : 109
    Points
    109
    Par défaut
    Merci Thes32,

    J'ai modifier mes " par ' et modifié mon code par la suite mais j'ai toujours le même message d'erreur.

    voici mes modif si tu peux m'aider.

    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    22
    23
    24
    25
    26
    27
    28
    29
    30
    31
    32
    33
    34
    35
    36
    37
    38
    39
    40
    41
    42
    43
    44
    45
    46
    47
    48
    49
    50
    51
    52
    53
    54
    55
    56
    57
    58
    59
    60
    61
    62
    63
    64
    65
    66
    67
    68
    69
    70
    71
    72
    73
    74
    75
    76
    77
    78
    79
    80
    81
    82
    83
    84
    85
    86
    87
    88
    89
    90
    91
    92
    93
    94
    95
    96
    97
    98
    99
    100
    101
    102
    103
    104
    105
    106
    107
    108
    109
    110
    111
    112
    113
    114
    115
    116
    117
    118
    119
    120
    121
    122
    123
    124
    125
    126
    127
    128
    129
    130
    131
    132
    133
    134
    135
    136
    137
    138
    139
    140
    141
    142
    143
    144
    145
    146
    147
    148
    149
    150
    151
    152
    153
    154
    155
    156
    157
    158
    159
    160
    161
    162
    163
    164
    165
    166
    167
    168
    169
    170
    171
    172
    173
    174
    175
    176
    177
    178
    179
    180
     
     
      $shopperArray = array(
        "email"       => "a.asdfg@yopmail.com",
        "firstname"   => "fghgh",
        "lastname"    => "alix",
        "street"      => "yourstreet",
        "postalcode"  => "12345",
        "city"        => "yourcity",
        "telephone"   => "1335484866",
        "countrycode" => "IT"
      );
     
      $orderContent = '
    <center><table>
    <tr><td bgcolor="#CCCCCC">Your Internet Order:</td><td colspan="2" bgcolor="#ffff00" align="right">AY 845</td></tr>
    <tr><td bgcolor="#ffff00">Description:</td><td>14 Tulip bulbs</td><td align="right">1,00</td></tr>
    <tr><td colspan="2">Subtotal:</td><td align="right">14,00</td></tr>
    <tr><td colspan="2">VAT: 13%</td><td align="right">1,82</td></tr>
    <tr><td colspan="2">Shipping and Handling:</td><td align="right">4,00</td></tr>
    <tr><td colspan="2" bgcolor="#c0c0c0">Total cost:</td><td bgcolor="#c0c0c0" align="right">Euro 19,82</td></tr>
    <tr><td colspan="3">&nbsp;</td></tr>
    <tr><td bgcolor="#ffff00" colspan="3">Your billing address:</td></tr>
    <tr><td colspan="3">Mr. '.  $shopperArray["lastname"] .',<br>'.  $shopperArray["street"] .',<br>'.  $shopperArray["postalcode"] .' '.  $shopperArray["city"] .',<br>Thisplace.</td></tr>
    <tr><td colspan="3">&nbsp;</td></tr>
    <tr><td bgcolor="#ffff00" colspan="3">Your shipping address:</td></tr>
    <tr><td colspan="3">Mr. '.  $shopperArray["lastname"] .',<br>'.  $shopperArray["street"] .',<br>'.  $shopperArray["postalcode"] .' '.  $shopperArray["city"] .',<br>Thisplace.</td></tr>
    <tr><td colspan="3">&nbsp;</td></tr>
    <tr><td bgcolor="#ffff00" colspan="3">Our contact information:</td></tr>
    <tr><td colspan="3">ACME Webshops Int. Inc.,<br>11 Strangewood Blv.,<br>1255 KZ Thisisit,<br>Nowhereatall.<br><br>acmeweb@acme.inc<br>(555) 1235 456</td></tr>
    <tr><td colspan="3">&nbsp;</td></tr>
    <tr><td bgcolor="#c0c0c0" colspan="3">Billing notice:</td></tr>
    <tr><td colspan="3">Your payment will be handled by  Global  Services<br>This name may appear on your bank statement<br>http://www.asdfg.com</td></tr>
    </table></center>
    ';
     
     
      function StartXML() {
        $this->xml = '
    <?xml version="1.0" encoding="UTF-8"?>
    <!DOCTYPE paymentService PUBLIC "-//test/DTD test PaymentService v1//EN" "http://dtd.test.com/ddd.dtd">
    <paymentService version="1.4" merchantCode="'.$this->merchantCode.'">
      <submit>
        <order orderCode = "'.$this->orderId.'">
          <description>'.$this->description.'</description>
          <amount value="'.$this->totalammount.'" currencyCode = "EUR" exponent = "2">\n
    ';
      }
     
      function FillDataXML($invoiceData) {
        $this->xml .= '
          <orderContent>
            <![CDATA['.$invoiceData.']]>
          </orderContent>
          <paymentMethodMask>
            <include code="ALL"/>
          </paymentMethodMask>
    ';
      }
     
      function FillShopperXML($shopperArray) {
        $this->xml .= '
          <shopper>
            <shopperEmailAddress>'.$shopperArray["email"].'</shopperEmailAddress>
          </shopper>
          <shippingAddress>
            <address>
              <firstName>'.$shopperArray["firstname"].'</firstName>
              <lastName>'.$shopperArray["lastname"].'</lastName>
              <street>'.$shopperArray["street"].'</street>
              <postalCode>'.$shopperArray["postalcode"].'</postalCode>
              <city>'.$shopperArray["city"].'</city>
              <countryCode>'.$shopperArray["countrycode"].'</countryCode>
              <telephoneNumber>'.$shopperArray["telephone"].'</telephoneNumber>
            </address>
          </shippingAddress>\n
    ';
      }
     
      function EndXML() {
        $this->xml .= '
        </order>
      </submit>
    </paymentService>
    ';
      }
     
     
     
      $_bibit->StartXML();
      $_bibit->FillDataXML($orderContent);
      $_bibit->FillShopperXML($shopperArray);
      $_bibit->EndXML();
      $_bibit->xml = utf8_encode($_bibit->xml);
      $bibitResult = $_bibit->CreateConnection();
     
      $resultArray = array(
        "currentTag"  => "",
        "orderCode"   => "",
        "referenceID" => "",
        "errorcode"   => "",
        "url_togoto"  => ""
      );
     
      function CreateConnection() {
        $ch = curl_init ($this->url);
        curl_setopt($ch, CURLOPT_POST,1);
        curl_setopt($ch, CURLOPT_POSTFIELDS, $this->xml); //$xml is the xml string
        curl_setopt($ch, CURLOPT_HTTPHEADER, Array("Content-Type: text/xml"));
        curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
        curl_setopt($ch, CURLOPT_NOPROGRESS, 0);
     
        // echo "ch: $ch<HR>" ;
     
        $result = curl_exec ($ch); // result will contain XML reply from Bibit
        curl_close ($ch);
        if ( $result == false )
          print 'Curl could not retrieve page "'.$this->url.'", curl_exec returns false';
        return $result;
      }
     
     
      ParseXML($bibitResult);
      print "<p style=\"font-weight: bold;\">Reply from the bibit server:</p>";
      echo "<pre>";
      print_r($resultArray);
      echo "</pre>";
     
       function StartElement($parser, $name, $attrs) 
      {
      	global $resultArray;
        $resultArray['currentTag'] = $name;
     
      	switch ($name) {
      		case "ERROR": 
      		  $resultArray['errorcode'] = $attrs['CODE']; //example of how to catch the error code number (i.e. 1 to 7)
      		  // $url_error = "error_order.php";
      			break;
      		case "REFERENCE":
      			$resultArray['referenceID'] = $attrs['ID'];//for storage in your own database
      			break;
      		case "ORDERSTATUS":
      			$resultArray['ordercode'] = $attrs['ORDERCODE'];
      			break;
      		default:
      			break;
      	}
      }
     
      function EndElement($parser, $name) {
        global $resultArray;
      	$resultArray['currentTag'] = "";
      }
     
      function CharacterData($parser, $result) {
        global $resultArray;
      	switch ($resultArray['currentTag']) {
      	case "REFERENCE":
      		//there is a REFERENCE so there must be an url which was provided by bibit for the actual payment. echo $result;
      		$resultArray['url_togoto'] = $result;
      		break;
      	default:
      		break;
      	}
      }
     
      function ParseXML($bibitResult) {
        $xml_parser = xml_parser_create();
        // set callback functions
        xml_set_element_handler($xml_parser, "startElement", "endElement");
        xml_set_character_data_handler($xml_parser, "characterData");
        if (!xml_parse($xml_parser, $bibitResult))
        {
          die(sprintf("XML error: %s at line %d",
        	xml_error_string(xml_get_error_code($xml_parser)),
        	xml_get_current_line_number($xml_parser)));
        }
        // clean up
        xml_parser_free($xml_parser);
      }
    Merci

  4. #4
    Membre régulier
    Inscrit en
    Février 2008
    Messages
    455
    Détails du profil
    Informations forums :
    Inscription : Février 2008
    Messages : 455
    Points : 109
    Points
    109
    Par défaut
    bonjour,

    donc normalement mon problème ce trouve là non?

    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
     
    	function StartXML() {
    		$this->xml = '
    		<?xml version="1.0" encoding="UTF-8"?>
    		<!DOCTYPE paymentService PUBLIC "-//teste//DTD teste teste v1//EN" "http://teste.teste.com/teste.dtd">
    		<paymentService version="1.4" merchantCode="'.$this->merchantCode.'">
    		<submit>
    			<order orderCode = "'.$this->orderId.'">
    			<description>'.$this->description.'</description>
    			<amount value="'.$this->totalammount.'" currencyCode = "EUR" exponent = "2">
    		';
    		//print_r($this->xml);
    	}
    car mon message me dit XML error: SYSTEM or PUBLIC, the URI is missing at line 1

    sinon juste une petite précision quand je fais un echo sur cette fonction

    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
     
     
     
    	function FillDataXML($invoiceData) {
    	  $this->xml .= '
    		<orderContent>
    		  <![CDATA['.$invoiceData.']]>
    		</orderContent>
    		<paymentMethodMask>
    		  <include code="ALL"/>
    		</paymentMethodMask>
    	';
    	}
    j'ai le ]]> qui ressort es-ce sa l'erreur??

  5. #5
    Membre régulier
    Inscrit en
    Février 2008
    Messages
    455
    Détails du profil
    Informations forums :
    Inscription : Février 2008
    Messages : 455
    Points : 109
    Points
    109
    Par défaut
    Bonjour,

    j'ai du nouveau mais c'est une histoire abracadabrante don je ne comprend pas pourquoi

    voici ce que sa affiche lorsque je fais un echo de mon XML
    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    22
    23
    24
    25
    26
    27
    28
    29
    30
    31
    32
    33
    34
    35
    36
    37
    38
    39
    40
    41
    42
    43
    44
    45
    46
    47
    48
    49
     
        [xml] => <?xml version="1.0" encoding="UTF-8"?>
    <!DOCTYPE paymentService PUBLIC "-//teste//DTD teste PaymentService v1//EN"
                                    "http://dtd.teste.com/teste.dtd">
    <paymentService version="1.4" merchantCode="teste">
    	<submit>
    		<order orderCode = "1327567011">
    			<description>teste Webshops Int. Inc.</description>
    			<amount value="1982" currencyCode = "EUR" exponent = "2">
    			<orderContent>
    				<![CDATA[<center><table>
    						<tr><td bgcolor="#CCCCCC">Your Internet Order:</td><td colspan="2" bgcolor="#ffff00" align="right">AY 845</td></tr>
    						<tr><td bgcolor="#ffff00">Description:</td><td>14 Tulip bulbs</td><td align="right">1,00</td></tr>
    						<tr><td colspan="2">Subtotal:</td><td align="right">14,00</td></tr>
    						<tr><td colspan="2">VAT: 13%</td><td align="right">1,82</td></tr>
    						<tr><td colspan="2">Shipping and Handling:</td><td align="right">4,00</td></tr>
    						<tr><td colspan="2" bgcolor="#c0c0c0">Total cost:</td><td bgcolor="#c0c0c0" align="right">Euro 19,82</td></tr>
    						<tr><td colspan="3">&nbsp;</td></tr>
    						<tr><td bgcolor="#ffff00" colspan="3">Your billing address:</td></tr>
    						<tr><td colspan="3">Mr.  alix ,<br> yourstreet ,<br> 12345   yourcity ,<br>Thisplace.</td></tr>
    						<tr><td colspan="3">&nbsp;</td></tr>
    						<tr><td bgcolor="#ffff00" colspan="3">Your shipping address:</td></tr>
    						<tr><td colspan="3">Mr.  alix ,<br> yourstreet ,<br> 12345   yourcity ,<br>Thisplace.</td></tr>
    						<tr><td colspan="3">&nbsp;</td></tr>
    						<tr><td bgcolor="#ffff00" colspan="3">Our contact information:</td></tr>
    						<tr><td colspan="3">ACME Webshops Int. Inc.,<br>11 Strangewood Blv.,<br>1255 KZ Thisisit,<br>Nowhereatall.<br><br>acmeweb@teste.inc<br>(555) 1235 456</td></tr>
    						<tr><td colspan="3">&nbsp;</td></tr>
    						<tr><td bgcolor="#c0c0c0" colspan="3">Billing notice:</td></tr>
    						<tr><td colspan="3">Your payment will be handled by teste Global Payments Services<br>This name may appear on your bank statement<br>http://www.teste.com</td></tr>
    					</table></center>]]>
    			</orderContent>
    			<paymentMethodMask>
    				<include code="ALL"/>
    			</paymentMethodMask>			<shopper>
    				<shopperEmailAddress>a.teste@b-teste.com</shopperEmailAddress>
    			</shopper>
    			<shippingAddress>
    				<address>
    					<firstName>teste</firstName>
    					<lastName>alix</lastName>
    					<street>yourstreet</street>
    					<postalCode>12345</postalCode>
    					<city>yourcity</city>
    					<countryCode>IT</countryCode>
    					<telephoneNumber>1335484866</telephoneNumber>
    				</address>
    			</shippingAddress>		</order>
    	</submit>
    </paymentService>
    il me semble que mon problème vient de là <![CDATA[<center><table> car il prend pas en compte le <center> et si je le supprime il prend pas mon <table> en gros tous ce qui est juste après <![CDATA[ il le prend pas et j'ai même l'impression que le <![CDATA[ n'est pas pris en compte et c'est pour sa qu'à la fin j'ai mon ]]> mais j'arrive pas à comprendre pourquoi sa marche pas.

    voici mon code en espérant que vous pourrait m'aider

    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    22
    23
    24
    25
    26
    27
    28
    29
    30
    31
    32
    33
    34
    35
    36
    37
    38
    39
    40
    41
    42
    43
    44
    45
    46
     
    function StartXML() {
    	  $this->xml = '<?xml version="1.0" encoding="UTF-8"?>
    <!DOCTYPE paymentService PUBLIC "-//teste//DTD teste PaymentService v1//EN"
                                    "http://dtd.teste.com/teste.dtd">
    <paymentService version="1.4" merchantCode="'.$this->merchantCode.'">
    	<submit>
    		<order orderCode = "'.$this->orderId.'">
    			<description>'.$this->description.'</description>
    			<amount value="'.$this->totalammount.'" currencyCode = "EUR" exponent = "2">
    			';
    	//print_r($this->xml);
    	}
     
    	function FillDataXML($invoiceData) {
    	  $this->xml .= '<orderContent>
    				<![CDATA['.$invoiceData.']]>
    			</orderContent>
    			<paymentMethodMask>
    				<include code="ALL"/>
    			</paymentMethodMask>';
    	}
     
      $orderContent = '<center><table>
    						<tr><td bgcolor="#CCCCCC">Your Internet Order:</td><td colspan="2" bgcolor="#ffff00" align="right">AY 845</td></tr>
    						<tr><td bgcolor="#ffff00">Description:</td><td>14 Tulip bulbs</td><td align="right">1,00</td></tr>
    						<tr><td colspan="2">Subtotal:</td><td align="right">14,00</td></tr>
    						<tr><td colspan="2">VAT: 13%</td><td align="right">1,82</td></tr>
    						<tr><td colspan="2">Shipping and Handling:</td><td align="right">4,00</td></tr>
    						<tr><td colspan="2" bgcolor="#c0c0c0">Total cost:</td><td bgcolor="#c0c0c0" align="right">Euro 19,82</td></tr>
    						<tr><td colspan="3">&nbsp;</td></tr>
    						<tr><td bgcolor="#ffff00" colspan="3">Your billing address:</td></tr>
    						<tr><td colspan="3">Mr.  '. $shopperArray["lastname"] .' ,<br> '. $shopperArray["street"] .' ,<br> '. $shopperArray["postalcode"] .'   '. $shopperArray["city"] .' ,<br>Thisplace.</td></tr>
    						<tr><td colspan="3">&nbsp;</td></tr>
    						<tr><td bgcolor="#ffff00" colspan="3">Your shipping address:</td></tr>
    						<tr><td colspan="3">Mr.  '. $shopperArray["lastname"] .' ,<br> '. $shopperArray["street"] .' ,<br> '. $shopperArray["postalcode"] .'   '. $shopperArray["city"] .' ,<br>Thisplace.</td></tr>
    						<tr><td colspan="3">&nbsp;</td></tr>
    						<tr><td bgcolor="#ffff00" colspan="3">Our contact information:</td></tr>
    						<tr><td colspan="3">ACME Webshops Int. Inc.,<br>11 Strangewood Blv.,<br>1255 KZ Thisisit,<br>Nowhereatall.<br><br>acmeweb@acme.inc<br>(555) 1235 456</td></tr>
    						<tr><td colspan="3">&nbsp;</td></tr>
    						<tr><td bgcolor="#c0c0c0" colspan="3">Billing notice:</td></tr>
    						<tr><td colspan="3">Your payment will be handled by Bibit Global Payments Services<br>This name may appear on your bank statement<br>http://www.bibit.com</td></tr>
    					</table></center>';
     
      $_bibit->StartXML();
      $_bibit->FillDataXML($orderContent);
    Merci pour votre aide

  6. #6
    Membre régulier
    Inscrit en
    Février 2008
    Messages
    455
    Détails du profil
    Informations forums :
    Inscription : Février 2008
    Messages : 455
    Points : 109
    Points
    109
    Par défaut
    bonjour,

    J'ai remplacé
    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    <![CDATA['.$invoiceData.']]>
    par
    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    <[CDATA['.$invoiceData.']]>
    donc j'ai enlevé le !

    et mon tableau est bien centré et le <![CDATA[ avec la balise <center> n'est plus en commentaire.

    mais es-ce juste car j'ai toujours le même message d'erreur

  7. #7
    Membre régulier
    Inscrit en
    Février 2008
    Messages
    455
    Détails du profil
    Informations forums :
    Inscription : Février 2008
    Messages : 455
    Points : 109
    Points
    109
    Par défaut
    Bonjour,

    il me semble que j'ai cherché ailleurs ce qui ce trouvait sous mon nez.

    le véritable problème est que mon erreur ce situe là <?xml version='1.0' encoding='UTF-8'?> je sais pas pourquoi j'ai toujours un espace devant ma déclaration et c'est pour sa qu'il lit pas mon xml
    mais je comprend pas pourquoi il met cette espace devant je suis sur une page utf8-sans bom

    si quelqu'un peut m'aider ce serait gentille merci d'avance

Discussions similaires

  1. Réponses: 0
    Dernier message: 11/07/2013, 14h07
  2. [XML] XML error: SYSTEM or PUBLIC, the URI is missing at line 1
    Par sinifer dans le forum Bibliothèques et frameworks
    Réponses: 0
    Dernier message: 18/01/2012, 17h18
  3. Réponses: 3
    Dernier message: 30/08/2011, 18h30
  4. [DOM] Problème XML (je débute désolé....)
    Par canonbis dans le forum Format d'échange (XML, JSON...)
    Réponses: 2
    Dernier message: 23/03/2005, 13h43
  5. Xml file system storage
    Par sebA dans le forum Décisions SGBD
    Réponses: 1
    Dernier message: 30/09/2004, 07h49

Partager

Partager
  • Envoyer la discussion sur Viadeo
  • Envoyer la discussion sur Twitter
  • Envoyer la discussion sur Google
  • Envoyer la discussion sur Facebook
  • Envoyer la discussion sur Digg
  • Envoyer la discussion sur Delicious
  • Envoyer la discussion sur MySpace
  • Envoyer la discussion sur Yahoo