[prev in list] [next in list] [prev in thread] [next in thread] 

List:       xmlbeans-user
Subject:    RE: search and replace kind of operations with XML
From:       "Radu Preotiuc-Pietro" <radup () bea ! com>
Date:       2008-02-07 17:35:19
Message-ID: BF6B6CA032BA0A429BD924F96765147D92A3D1 () repbex02 ! amer ! bea ! com
[Download RAW message or body]

You can do this in XmlBeans by using the XmlCursor.setName() and
XmlCursor.setTextValue() methods. This is the most efficient way and
it's easy enough to code, IMO.

Alteratively, XMLBeans supports XQuery via Saxon integration, but, as
far as I know, in XQuery you can't change a document "in-place" and you
basically need to create a new doc with everything from the original doc
in it, except the elements which now need to have new names. Way more
trouble than it's worth.

Radu

> -----Original Message-----
> From: dave [mailto:ceek63@yahoo.com] 
> Sent: Wednesday, February 06, 2008 7:57 PM
> To: user@xmlbeans.apache.org; xmlschema-dev@w3.org
> Subject: Re: search and replace kind of operations with XML 
> 
> 
> Am already using XmlBeans. I would need to see how I can 
> integrate VTD-XML with XMLBeans.
> 
> I agree with you that VTD-XML is an ideal match for what I 
> want to accomplish. I would still prefer if XmlBeans offers 
> anything on this line. 
> 
> Thanks Jimmy.
> 
> dave
> --- jimmy Zhang <jzhang@ximpleware.com> wrote:
> 
> > I think you may find VTD-XML ideally suited for this 
> (better than any 
> > other technologies AFAIK ) because of its incremental update 
> > capability and built-in XPath
> > 
> > 
> http://www.javaworld.com/javaworld/jw-07-2006/jw-0724-vtdxml.html
> > 
> > http://www.devx.com/xml/Article/36379
> > 
> > 
> > ----- Original Message -----
> > From: "dave" <ceek63@yahoo.com>
> > To: <user@xmlbeans.apache.org>;
> > <xmlschema-dev@w3.org>
> > Sent: Wednesday, February 06, 2008 7:39 PM
> > Subject: search and replace kind of operations with XML
> > 
> > 
> > > 
> > > For a given XML input, I would need to perform
> > 'Search
> > > and Replace' operation on Element/Attribute Tag
> > names
> > > and values. The resultant output is a transformed
> > XML.
> > > Since I would like to change both Tags and Values,
> > > what is the best way to accomplish this? XSLT or
> > > Xpath/XQuery or combination of both?
> > > 
> > > OR are there any special apis in XmlBeans to
> > > accomplish this?
> 
> 
> 
> ______________________________________________________________
> ______________________
> Never miss a thing.  Make Yahoo your home page. 
> http://www.yahoo.com/r/hs
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@xmlbeans.apache.org
> For additional commands, e-mail: user-help@xmlbeans.apache.org
> 
> 

Notice:  This email message, together with any attachments, may contain information  \
of  BEA Systems,  Inc.,  its subsidiaries  and  affiliated entities,  that may be \
confidential,  proprietary,  copyrighted  and/or legally privileged, and is intended \
solely for the use of the individual or entity named in this message. If you are not \
the intended recipient, and have received this message in error, please immediately \
return this by email and then delete it.

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@xmlbeans.apache.org
For additional commands, e-mail: user-help@xmlbeans.apache.org


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic