XQuery Update
Issues related to W3C XQuery.
-
- Posts: 3
- Joined: Wed Jan 25, 2012 1:24 pm
XQuery Update
Hello,
I've got Problems with executing XQuery Update expressions but can'f find any wrong settings. Running Oxygen Editor 13.2.
Examples:
returning "F [Saxon-EE XQuery 9.3.0.5] Updating functions are allowed only in XQuery Update"
for
returning "F [Saxon-EE XQuery 9.3.0.5] Unexpected token "copy" in path expression"
for
Any ideas?
I've got Problems with executing XQuery Update expressions but can'f find any wrong settings. Running Oxygen Editor 13.2.
Examples:
returning "F [Saxon-EE XQuery 9.3.0.5] Updating functions are allowed only in XQuery Update"
for
Code: Select all
declare updating function
upsert($e as element(),
$an as xs:QName,
$av as xs:anyAtomicType)
{
let $ea := $e/attribute()[fn:node-name(.) = $an]
return
if (fn:empty($ea))
then insert node attribute {$an} {$av} into $e
else replace value of node $ea with $av
}
for
Code: Select all
let $source := doc('juicers.xml')
let $images := doc('juicer-images.xml')
return
for $i in $source//juicer return
copy $j := $i
modify
replace node $j/image with
element {'image'}
{
for $j in $images//image[@id eq $j/@id]/* return
element {$j/name()} {data($j)}
}
return $j
-
- Posts: 2879
- Joined: Tue May 17, 2005 4:01 pm
Re: XQuery Update
Hello,
I'm guessing you have enabled the support for XQuery 1.1 in Saxon(by default it's disabled). Please note that this causes the support for XQuery Update to be disabled. I can't seem to find a documentation page for Saxon that confirms or explains this.
In Oxygen go to Options > Preferences, XML > XSLT-FO-XQuery > XQuery > Saxon-HE/PE/EE and make sure that the option Enable XQuery 1.1 support is disabled.
Both errors should disappear after disabling this option.
Regards,
Adrian
I'm guessing you have enabled the support for XQuery 1.1 in Saxon(by default it's disabled). Please note that this causes the support for XQuery Update to be disabled. I can't seem to find a documentation page for Saxon that confirms or explains this.
In Oxygen go to Options > Preferences, XML > XSLT-FO-XQuery > XQuery > Saxon-HE/PE/EE and make sure that the option Enable XQuery 1.1 support is disabled.
Both errors should disappear after disabling this option.
Regards,
Adrian
Adrian Buza
<oXygen/> XML Editor, Schema Editor and XSLT Editor/Debugger
http://www.oxygenxml.com
<oXygen/> XML Editor, Schema Editor and XSLT Editor/Debugger
http://www.oxygenxml.com
-
- Posts: 2879
- Joined: Tue May 17, 2005 4:01 pm
Re: XQuery Update
I have logged this to our issue tracking tool and this limitation of Saxon will be mentioned in the Oxygen documentation.
Regards,
Adrian
Regards,
Adrian
Adrian Buza
<oXygen/> XML Editor, Schema Editor and XSLT Editor/Debugger
http://www.oxygenxml.com
<oXygen/> XML Editor, Schema Editor and XSLT Editor/Debugger
http://www.oxygenxml.com
-
- Posts: 6
- Joined: Thu Dec 01, 2011 6:44 pm
Re: XQuery Update
Post by cmcenearney »
Hi,
Just wanted to say I had this problem as well and solved as a result of this post.
Thanks!
It was really driving me nuts as I had update queries which previously worked and couldn't figure this out.
Colin
Just wanted to say I had this problem as well and solved as a result of this post.
Thanks!
It was really driving me nuts as I had update queries which previously worked and couldn't figure this out.
Colin
-
- Posts: 17
- Joined: Mon Mar 15, 2010 8:35 pm
- Location: Paris, France
Re: XQuery Update
Hi,
using oxygen XML Editor 14.0, build 2012062215 I've got a validation error:
Fichier de validation principal: /…/Sans titre1.xquery
Nom du moteur: Saxon-EE XQuery 9.4.0.3
Gravité: fatal
Description: Unexpected token "delete nodes" in path expression
URL: http://www.w3.org/TR/xpath20/#ERRXPST0003
when I validate this code:
for $st in //stitle[following-sibling::title = .]
return delete node $st
In the configuration, I've checked the chekcbox for XQuery 3.0.
What am I missing?
using oxygen XML Editor 14.0, build 2012062215 I've got a validation error:
Fichier de validation principal: /…/Sans titre1.xquery
Nom du moteur: Saxon-EE XQuery 9.4.0.3
Gravité: fatal
Description: Unexpected token "delete nodes" in path expression
URL: http://www.w3.org/TR/xpath20/#ERRXPST0003
when I validate this code:
for $st in //stitle[following-sibling::title = .]
return delete node $st
In the configuration, I've checked the chekcbox for XQuery 3.0.
What am I missing?
-
- Posts: 2879
- Joined: Tue May 17, 2005 4:01 pm
Re: XQuery Update
Hello,
Regards,
Adrian
I believe you got it wrong. You are supposed to disable the option named Enable XQuery 1.1 support. In v14.0 and later this option has been renamed to Enable XQuery 3.0 support. Disable this option, make sure you use Saxon-EE and it will work.ojeulin wrote:when I validate this code:
for $st in //stitle[following-sibling::title = .]
return delete node $st
In the configuration, I've checked the chekcbox for XQuery 3.0.
What am I missing?
Regards,
Adrian
Adrian Buza
<oXygen/> XML Editor, Schema Editor and XSLT Editor/Debugger
http://www.oxygenxml.com
<oXygen/> XML Editor, Schema Editor and XSLT Editor/Debugger
http://www.oxygenxml.com
-
- Posts: 2879
- Joined: Tue May 17, 2005 4:01 pm
Re: XQuery Update
Hi,
In case anyone else needs to enable XQuery Update and reads this thread, since v17.0 a separate option is available for XQuery Update in Options > Preferences, XML > XSLT-FO-XQuery > XQuery > Saxon-HE/PE/EE, Enable XQuery Update (in the Saxon-EE specific options subsection). So, it is no longer necessary to clear the option Enable XQuery 3.0 support.
Regards,
Adrian
In case anyone else needs to enable XQuery Update and reads this thread, since v17.0 a separate option is available for XQuery Update in Options > Preferences, XML > XSLT-FO-XQuery > XQuery > Saxon-HE/PE/EE, Enable XQuery Update (in the Saxon-EE specific options subsection). So, it is no longer necessary to clear the option Enable XQuery 3.0 support.
Regards,
Adrian
Adrian Buza
<oXygen/> XML Editor, Schema Editor and XSLT Editor/Debugger
http://www.oxygenxml.com
<oXygen/> XML Editor, Schema Editor and XSLT Editor/Debugger
http://www.oxygenxml.com
Jump to
- Oxygen XML Editor/Author/Developer
- ↳ Feature Request
- ↳ Common Problems
- ↳ DITA (Editing and Publishing DITA Content)
- ↳ SDK-API, Frameworks - Document Types
- ↳ DocBook
- ↳ TEI
- ↳ XHTML
- ↳ Other Issues
- Oxygen XML Web Author
- ↳ Feature Request
- ↳ Common Problems
- Oxygen Content Fusion
- ↳ Feature Request
- ↳ Common Problems
- Oxygen JSON Editor
- ↳ Feature Request
- ↳ Common Problems
- Oxygen PDF Chemistry
- ↳ Feature Request
- ↳ Common Problems
- Oxygen Feedback
- ↳ Feature Request
- ↳ Common Problems
- Oxygen XML WebHelp
- ↳ Feature Request
- ↳ Common Problems
- XML
- ↳ General XML Questions
- ↳ XSLT and FOP
- ↳ XML Schemas
- ↳ XQuery
- NVDL
- ↳ General NVDL Issues
- ↳ oNVDL Related Issues
- XML Services Market
- ↳ Offer a Service