Dear Yoann,

I tried to reproduce your example, using the following query:

$session = new Session("localhost", 1984, "admin", "admin");
$xml = $session->execute("XQUERY <x><y/></x>");
print $xml;
$session->execute("XQUERY insert node $xml into <xml/>");
$session->close();

This one runs without problems on my machine; can you run it, too?

If it fails, it could well be that you were running the code with an
older snapshot (I remember there was an issue with line breaks). You
could also try the very latest snapshot [2].

It it succeeds, it could well be that I’ve probably misinterpreted the
problem, and it would be great if you could provide us with a little
example that runs out of the box.

Thanks,
Christian

[1] http://files.basex.org/releases/latest/
___________________________

2013/9/24 Yoann Maingon <yoann.main...@mydatalinx.com>:
> Hi,
>
> I've got a simple node move PHP script (sorry for my terrible code, I'm an
> electronician!)
>
> // get the node
> $xquery = "XQUERY //noteitem[@id='$movedID']";
> $saveNode = $session->execute($xquery);
>
> // delete the node
> $xquery = "XQUERY delete node //noteitem[@id='$movedID']";
> $content = $session->execute($xquery);
> // insert the node
> if ($nextID == 'last') {
>   $xquery = "XQUERY insert node ($saveNode) as last into
> //meeting[@id='$meetingID']/items ";
>   $content = $session->execute($xquery);
> } else {
>   echo $saveNode;
>   $xquery = "XQUERY insert node ($saveNode) before
> //meeting[@id='$meetingID']/items/noteitem[@id='$nextID'] ";
>   $content = $session->execute($xquery);
> }
> $contentFull = "<MN>$content</MN>";
> echo $contentFull;
>
>
> If I look into the content that is saved, deleted and inserted I have the
> following:
>
>  <noteitem status="new" commentsCounter="0" created_on="Tue, 24 Sep 13
> 12:09:29 +0000" modified_on="Tue, 24 Sep 13 12:09:29 +0000"
> id="MnNo524180f9587c1" genid="MnNo524180f9587c1" owner="1" type="question">
>             <notecontent>...</notecontent>
>           </noteitem>
>
> It worked fine until the latest update. Where apparently the query breaks
> with the line break.
> It creates an error saying that the closing </noteitem> tag is missing.
> Just got back to 7.6 and it works well.
>
> any idea?
>
> Yoann Maingon
> CEO - mydatalinx
> +33664324966
>
> _______________________________________________
> BaseX-Talk mailing list
> BaseX-Talk@mailman.uni-konstanz.de
> https://mailman.uni-konstanz.de/mailman/listinfo/basex-talk
>
_______________________________________________
BaseX-Talk mailing list
BaseX-Talk@mailman.uni-konstanz.de
https://mailman.uni-konstanz.de/mailman/listinfo/basex-talk

Reply via email to