logo       

RE: replacing a node in in-memory XML: msg#00002

Subject: RE: replacing a node in in-memory XML
This is a multi-part message in MIME format.
In the absence of XQuery updates (still a draft W3C spec) it's quite a bit harder to do this in XQuery than in XSLT: you basically have to organize the recursive walk down the tree copying nodes as you go yourself "by hand". If you are comfortable with XSLT then this is definitely a task where XSLT currently wins. It will get a lot easier with XQuery updates.
 
Michael Kay

From: talk-bounces-9zRdbLeNGsRBDgjK7y7TUQ@xxxxxxxxxxxxxxxx [mailto:talk-bounces-9zRdbLeNGsRBDgjK7y7TUQ@xxxxxxxxxxxxxxxx] On Behalf Of Robert Walpole
Sent: 06 November 2007 15:05
To: talk-KUd/JJajPrLQT0dZR+AlfA@xxxxxxxxxxxxxxxx
Subject: [xquery-talk] replacing a node in in-memory XML

Hi,

I am trying to figure out the best way to replace a node within an in-memory XML fragment.

For example, lets say I have the following fragment in memory…

<communitygroup>
        <group>
                <name>Test</name>
                <services>
                        <service value="true">2</service>
                </services>
        </group>
</communitygroup>

…and want to replace the services node with the following…

<services>
        <service value="false">1</service>
        <service value="true">2</service>
        <service value="false">3</service>
</services>

Is there a way of doing this in XQuery?

Obviously I could use an XSL transformation, which would give me the result I want, but maybe there is a more efficient way using XQuery?

Thanks
Rob Walpole
Devon Portal Developer
Email robert.walpole-z67GYmfiJqS5nN1hM+u2rQ@xxxxxxxxxxxxxxxx
Web http://www.devonline.gov.uk


<Prev in Thread] Current Thread [Next in Thread>
Google Custom Search

Recently Viewed:
region.costa-ri...    user-groups.lin...    lang.prothon.us...    xfree86.cvs/200...    finance.aqbanki...    ietf.smtp/1993-...    web.turbogears....    jakarta.cactus....    yellowdog.gener...    php.gtk+.genera...    org.region.indo...    hurd.l4/2005-10...    culture.religio...    apple.fink.gene...    db.mysql.window...    bluez.devel/200...    security.pgp-ba...    video.blender.d...   
Home | blog view | USPTO Patent Archive | advertise | OSDir is an inevitable website. super tiny logo

Free Magazines

Cisco News
Receive a free quarterly e-newsletter with exclusive articles on how Cisco IT uses its own products and solutions to enable the business.
subscribe

Systems Management News, the newspaper for IT systems administration and data center managers! Each issue of Systems Management News is chock-full of news and analysis to help you understand what's happening in your field.
subscribe

The Enterprise Newsweekly eWeek is the essential technology information source for builders of e-business.
subscribe

Oracle Magazine Oracle Magazine contains technology strategy articles, sample code, tips, Oracle and partner news, how to articles for developers and DBAs, and more. Oracle (NASDAQ: ORCL) is the world's largest enterprise software company.
subscribe

Total Telecom Total Telecom is "The Economist of the communications industry".
subscribe