xsl-list
[Top] [All Lists]

Re: [xsl] Does XQuery allow you to modify the XML? (remove elements, modify element values)

2019-10-17 12:03:02

XQuery Update facility  [ https://www.w3.org/TR/xquery-update-10/ 
<https://www.w3.org/TR/xquery-update-10/>  ] is an extension. 

Saxon supports in only with licenses Saxon EE, not available in free Saxon HE. 

XQuery Update is included in BaseX implementation: 
http://docs.basex.org/wiki/XQuery_Update 
<http://docs.basex.org/wiki/XQuery_Update> 

(  I’m not sure  about eXist implementation, but I think it’s included.  )

There are some extra command line flags needed to turn on update in place for 
both BaseX and Saxon. 
( Or, using Saxon from Oxygen, flags are set in Oxygen preferences. ) 

You can also output modified XML instead of update in place using COPY/MODIFY, 
or  transform with syntax (if available). 

XSLT is better if you are doing a complete transform/rearrangement of a 
document, but XQuery seems simpler if you are just adding/deleting/modifying a 
particular element  or adding attributes to an existing nodes. 


— Steve Majewski



On Oct 17, 2019, at 11:55 AM, Costello, Roger L. 
costello(_at_)mitre(_dot_)org 
<xsl-list-service(_at_)lists(_dot_)mulberrytech(_dot_)com> wrote:

Hi Folks,

It's been a long time since I've looked at XQuery. 

I need to identify certain elements in XHTML documents and then either remove 
the elements or modify their values. Can XQuery do this? Are there free 
XQuery tools?

XHTML --> XQuery --> XHTML' (a modified version of the input XHTML document)

/Roger

--~----------------------------------------------------------------
XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list
EasyUnsubscribe: http://lists.mulberrytech.com/unsub/xsl-list/1167547
or by email: xsl-list-unsub(_at_)lists(_dot_)mulberrytech(_dot_)com
--~--
<Prev in Thread] Current Thread [Next in Thread>