Xgrep is a nifty tool. It's a great way to explore
XPath and to develop and hone expressions.
The DOM specification (which Xerces attempts to
implement faithfully) includes methods for modifying the tree. However, I'm
beginning to wonder if you're looking for more command-line tools like Xgrep to
perform your modifications for you. If so, Xerces alone won't help, because it's
a library that implements an API. It doesn't include any programs to make
arbitrary modifications to the input.
If you want a command-line tool to do XML-aware
document transformation, you'll need something that allows you to specify the
transformation (a template or stylesheet) to be performed along with the input
document. If this is the case, you should look at XSLT, Velocity, etc. For
instance, Xalan-C includes a command-line processor (called, appropriately,
Xalan) that takes an XML source document and an XSLT stylesheet and outputs the
result of applying the stylesheet to the document.
From: premkumar srinivasan [mailto:[EMAIL PROTECTED]
Sent: Thursday, October 13, 2005 10:24 AM
To: Jesse Pelton
Subject: Re: XML Dom parsers and updators.Hi,Thanks for pointing at Pathan.I have installed xerces version 2.3 and pathan version 2. I think, the xgrep program ( http://software.decisionsoft.com/pathanXgrepDocumentation.html), can be used for XPATH. Right????Also, for modifying the DOMTree, can xerces API libraries for DOM files be used for updating the XML file ( which is been represented in the memory as a DOM Tree )? Is there anything that can be used along with XERCES and PATHAN, to update the DOM Tree.Am I going in the right direction?Thanks,--Prem,
On 10/11/05, Jesse Pelton <[EMAIL PROTECTED]> wrote:There are any number of template-based transformers, some of which use DOM and XPath as you're describing, some of which don't. Projects with their own template systems include Velocity and FreeMarker (both Java) among others. The standardized XML transformation language is XSLT, which is implemented in Apache's Xalan (C++ or Java), Gnome's libxml2/gdome2/libxslt, and quite a few other libraries.If you want your updates to be driven by code rather than templates, any of these libraries should serve, or you can use Xerces-C for the DOM and Pathan (which is built on Xerces) for XPath.
From: premkumar srinivasan [mailto:[EMAIL PROTECTED]]
Sent: Tuesday, October 11, 2005 11:23 AM
To: [email protected]
Subject: Reg: XML Dom parsers and updators.
Hi,
Is there any open source based on XML, that allows us to do the following:
- Parse XML into a DOM Tree.
- Retrieve the XML data using XPATH queries.
- Update the DOM Tree, based on the update-type. It might be DOM node updation, or addition of a new DOM node sets.It's something like making XML file, a database, and use "SQL" sort of queries to update/retrieve data.
Your suggestions would be really helpful for me.
Thanks,
--Prem.
