1

こんにちは、私は linkiedin api を使用しています。xml があります。

function send_messeges($access_token, $xml_atring) {

    $profile_url = "http://api.linkedin.com/v1/people/~/mailbox";
    $xml = '<?xml version="1.0" encoding="UTF-8" ?>
        <mailbox-item>
          <recipients>                
            ' . $xml_atring . '
          </recipients>
          <subject>'.$this->send_subject.'</subject>
          <body>'.$this->send_message.'</body>
        </mailbox-item>';
    $request = OAuthRequest::from_consumer_and_token($this->consumer, $access_token, "POST", $profile_url);
    $request->sign_request($this->method, $this->consumer, $access_token);
    $auth_header = $request->to_header("https://api.linkedin.com");
    $response = $this->httpRequest($profile_url, $auth_header, "POST", $xml);        
    return $response;

}

$this->send_message

メッセージがあり、メッセージ付きの HTML を追加したいのですが、リンクされた API ではそれができません。

でさえ

<![CDATA[
        Line 1 <br />
        Line 2 <br />
        Line 3 <br />
        ]]>

ここでは機能していませんso is there any built in xml tag i can use for line breaks ansd is there any tags equalant to HTML tags。助けてください

アップデート

メッセージを使用する場合

"Elephanti <br/> invitation Message, Visite our site http://elephanti.com";

応答は

Invalid xml {Element not allowed: br@http://api.linkedin.com/v1 in element body@http://api.linkedin.com/v1}
4

1 に答える 1

3

&#xDXML ドキュメント内で改行が必要な場所で使用します。

このサイトに良い説明があります: http://www.stylusstudio.com/xmldev/200309/post80050.html

別のオプション

<br/>スペースが必要な場所に入力してみてください

将来の閲覧者のために編集

彼にとってうまくいったのは\n、改行したい場所に入力することでした

于 2012-08-16T06:40:09.603 に答える