2013-01-10 14:12:13 |
Nicolae Brinza |
description |
Query:
=====
declare %an:sequential function local:image(
$id as xs:string, $width as xs:int*,
$height as xs:int*, $ratio as xs:decimal*, $format as xs:string) as xs:base64Binary
{
variable $obj := null;
if (fn:empty($obj)) then
()
else
{
variable $svg := $obj("svg");
if (fn:not(jn:is-null($obj("size")("width")))) then
{
variable $svg-width := $obj("size")("width");
variable $svg-height := $obj("size")("height");
if ($width) then
{
$svg-height := xs:int(($svg-height div $svg-width) * $width);
$svg-width := $width;
}
else if ($height) then
{
$svg-width := xs:int(($svg-width div $svg-height) * $height);
$svg-height := $height;
}
else if ($ratio) then
{
$svg-width := xs:int($svg-width * $ratio);
$svg-height := xs:int($svg-height * $ratio);
}
else
{}
$svg := <a>{$svg}</a>/*;
replace value of node $svg/@width width xs:string($svg-width) || "px";
replace value of node $svg/@height width xs:string($svg-height) || "px";
}
else
{}
}
};
Error Msg:
========
</Users/dagraf/work/28msec/zorba/build/test.xq>:7,22: static error [err:XPST0003]: invalid expression: syntax error, unexpected ExprSingle (missing comma "," between expressions?); raised at /Users/dagraf/work/28msec/zorba/sandbox/src/compiler/api/compiler_api.cpp:197
Actual Problem:
============
replace expressions contain a typo: s/width/with |
Query:
=====
declare %an:sequential function local:image(
$id as xs:string, $width as xs:int*,
$height as xs:int*, $ratio as xs:decimal*, $format as xs:string) as xs:base64Binary
{
variable $obj := null;
if (fn:empty($obj)) then
()
else
{
variable $svg := $obj("svg");
if (fn:not(jn:is-null($obj("size")("width")))) then
{
variable $svg-width := $obj("size")("width");
variable $svg-height := $obj("size")("height");
if ($width) then
{
$svg-height := xs:int(($svg-height div $svg-width) * $width);
$svg-width := $width;
}
else if ($height) then
{
$svg-width := xs:int(($svg-width div $svg-height) * $height);
$svg-height := $height;
}
else if ($ratio) then
{
$svg-width := xs:int($svg-width * $ratio);
$svg-height := xs:int($svg-height * $ratio);
}
else
{}
$svg := <a>{$svg}</a>/*;
replace value of node $svg/@width width xs:string($svg-width) || "px";
replace value of node $svg/@height width xs:string($svg-height) || "px";
}
else
{}
}
};
Error Msg:
========
</Users/dagraf/work/28msec/zorba/build/test.xq>:7,22: static error [err:XPST0003]: invalid expression: syntax error, unexpected ExprSingle (missing comma "," between expressions?); raised at /Users/dagraf/work/28msec/zorba/sandbox/src/compiler/api/compiler_api.cpp:197
Actual Problem:
============
replace expressions contain a typo: s/width/with |
|