希望你能指导我(因为我在其他现有问题中找不到任何真正的答案);我的代码是:
<?php
function make_product_options($data){
global $webService, $config;
/*try{*/
$xml = $webService->get(array('url' =>$config["ps_shop"].'api/product_option_values?schema=blank'));
$product_option_value = $xml->children()->children();
$product_option_value->id = 1;
$product_option_value->id_attribute_group = $data["id_attribute_group"];
$product_option_value->name->language[0][0] = $data["name"];
$product_option_value->name->language[0][0]['id'] = 1;
$opt = array('resource' => 'product_option_values');
$opt['postXml'] = $xml->asXML();
$xml = $webService->add($opt);
var_dump($xml);
die();
$product_option_value = $xml->product_option_values;
/*} catch (PrestaShopWebserviceException $e){
return;
}*/
return $product->id;
}
但我得到的“400错误请求”xml发出的是:
<?xml version="1.0" encoding="UTF-8"?>
<prestashop xmlns:xlink="http://www.w3.org/1999/xlink">
<product_option_value>
<id>1</id>
<id_attribute_group>4</id_attribute_group>
<color/>
<position/>
<name><language id="1">Logo Grande</language></name>
</product_option_value>
</prestashop>
答案 0 :(得分:1)
#read text converted to csv
myfile3 <- "tweetsc.csv"
x <- read.csv(myfile3, header = FALSE)
#make data frame
x <- data.frame(lapply(x, as.character), stringsAsFactors=FALSE)
# make vector sources
dd <- Corpus(DataframeSource(x))
# from tm package conculate tfidf
xx <- as.matrix(DocumentTermMatrix(dd, control = list(weighting = weightTfIdf)))
#data frame from columns to rows decreasing
freq = data.frame(sort(colSums(as.matrix(xx)), decreasing=FALSE))
write.csv2(freq, "important_tweets.csv")
值。name
,则值必须为空。如果没有,可以解释为更新。答案 1 :(得分:0)
我在PixelWeb的帮助下解决了这个问题,这是我使用的代码:
https://gist.github.com/is-just-me/4dadabf7e5514dcc25cf7de51eac9d21
希望能帮到某人;)