[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

Re: Does XQuery allow you to modify the XML? (remove

Subject: Re: Does XQuery allow you to modify the XML? (remove elements, modify element values)
From: "Elisa Beshero-Bondar ebbondar@xxxxxxxxx" <xsl-list-service@xxxxxxxxxxxxxxxxxxxxxx>
Date: Thu, 17 Oct 2019 17:14:31 -0000
Re:  Does XQuery allow you to modify the XML? (remove
Ah, that's right--it's called type-switching in XQuery, and it's something
I experimented with a year or two ago to see if I could really do
everything in XQuery that I do in XSLT. I love both, but I tend to use
XQuery for pulling and visualizing data from complex documents, and if I
need to represent a complete, complex file with just a few spot revisions,
XSLT really seems easier. It may be that I didn't find the right
documentation, though.

For type-switching, there's this:
https://en.wikibooks.org/wiki/XQuery/Typeswitch_Transformations

Admittedly, I know XSLT identity transformations better, and it's how I
teach my students to *start* their first XSLT because it's so very easy,
especially in XSLT 3.0: https://dh.newtfire.org/XSLTExercise1.html
I mean, seriously, what could be easier than xsl:mode
on-no-match="shallow-copy"/  , and then writing a couple of dedicated
template rules to change exactly what you need?

Cheers,
Elisa
-- 
Elisa Beshero-Bondar, PhD
Director, Center for the Digital Text | Associate Professor of English
University of Pittsburgh at Greensburg | Humanities Division
150 Finoli Drive
Greensburg, PA  15601  USA
E-mail: ebb8@xxxxxxxx <ebb8@xxxxxxxx>
Development site: http://newtfire.org


On Thu, Oct 17, 2019 at 12:51 PM Adam Retter adam.retter@xxxxxxxxxxxxxx <
xsl-list-service@xxxxxxxxxxxxxxxxxxxxxx> wrote:

> Yes, you can either write a type-switch transformation in XQuery to
> create a new document by filtering the content of your original
> document, or you could use XQuery Update if your processor supports
> it.
>
> For typeswitches, this might be useful -
> https://en.wikibooks.org/wiki/XQuery/Typeswitch_Transformations
>
> On Thu, 17 Oct 2019 at 16:55, Costello, Roger L. costello@xxxxxxxxx
> <xsl-list-service@xxxxxxxxxxxxxxxxxxxxxx> 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
> >
>
>
>
> --
> Adam Retter
>
> skype: adam.retter
> tweet: adamretter
> http://www.adamretter.org.uk
> 
>


<http://newtfire.org/>

Current Thread

PURCHASE STYLUS STUDIO ONLINE TODAY!

Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
Email
First Name
Last Name
Company
Subscribe in XML format
RSS 2.0
Atom 0.3
Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery ™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2013 All Rights Reserved.