Xquery to find/replace
Issues related to W3C XQuery.
-
- Posts: 26
- Joined: Wed Jun 17, 2015 10:01 pm
Xquery to find/replace
Code: Select all
//mods:displayForm[text()[contains(.,'Trust')]]/ancestor::mods:name/@type
-
- Posts: 1016
- Joined: Wed Nov 16, 2005 11:11 am
Re: Xquery to find/replace
Post by alex_jitianu »
Hi,
You need XQuery Update for that:
What's worth mentioning is that:
- XQuery Update works only on documents loaded using the doc() function
- you have to use Saxon EE and to enable the XQuery Update support (inside Preferences, on page XML / XSLT-FO-XQuery / XQuery / Saxon-HE/PE/EE)
Best regards,
Alex
You need XQuery Update for that:
Code: Select all
let $d := doc('file://path.to.file/file.xml')
for $attr in $d//mods:displayForm[text()[contains(.,'Trust')]]/ancestor::mods:name/@type
return replace value of node $attr with "changed"
- XQuery Update works only on documents loaded using the doc() function
- you have to use Saxon EE and to enable the XQuery Update support (inside Preferences, on page XML / XSLT-FO-XQuery / XQuery / Saxon-HE/PE/EE)
Best regards,
Alex
-
- Posts: 1016
- Joined: Wed Nov 16, 2005 11:11 am
Re: Xquery to find/replace
Post by alex_jitianu »
Hello,
An Oxygen project? No, but you can use the collection() function. You can use it to load files from a directory and you can load a collection using a catalog file.
Best regards,
Alex
An Oxygen project? No, but you can use the collection() function. You can use it to load files from a directory and you can load a collection using a catalog file.
Best regards,
Alex
-
- Posts: 2879
- Joined: Tue May 17, 2005 4:01 pm
Re: Xquery to find/replace
Hi,
I'm afraid you can't generate a collection over the project.
Is this still in relation to the XQuery Update?
If you need to apply the same XQuery Update on multiple (or all) files from your project, you can create a scenario of type XML Transformation with XQuery use Saxon-EE as the transformer and apply it in the root of the project. In practice this will apply the scenario in turn on each of the files from the project.
Regards,
Adrian
I'm afraid you can't generate a collection over the project.
Is this still in relation to the XQuery Update?
If you need to apply the same XQuery Update on multiple (or all) files from your project, you can create a scenario of type XML Transformation with XQuery use Saxon-EE as the transformer and apply it in the root of the project. In practice this will apply the scenario in turn on each of the files from the project.
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