tomcat-taglibs-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "James Strachan" <james_strac...@yahoo.co.uk>
Subject Re: Request for expert advice on design
Date Tue, 11 Sep 2001 11:43:35 GMT
Hi Ray

----- Original Message -----
From: "Ray Allis" <ray.allis@boeing.com>
> James Strachan wrote:
> > Hi Ray
> >
> > Sorry for the delay getting back - just catching up after vacation.
>
> Not a problem.  I hope you are refreshed and renewed. :)

I was though now I've got jetlag thanks to my day job and wide awake at 5AM
:-(

> >>- Eventually, I'd like to do form-based database maintenance.
> >>   :-) The Documents are in beans, but how would a setWhatever
> >>   work?  The present technique would be to build new or
> >>   replacement Documents complete using xtags and insert them
> >>   into the db?
> >>
> >
> > XSLT tends to take the view that you take an existing document and
create a
> > whole new output document.
> >
> > In XTags you can actually amend an existing document iteratively - e.g.
find
> > all the <foo> elements with certain attribute values using XPath then
add or
> > delete things. So to do iterative modification to an XML document, you
can
> > use XTags if you like. Especially if you were doing something like
NewsML
> > editing, where you just want to (say) edit the title or author's name,
> > there's no point creating a whole new document with XSLT just to do
> > incremental changes. There's folks doing this kind of thing with XTags
today
> > (using documents quite like NewsML and XML CMS type stuff)
>
> Is there code I can look at?  Incremental changes are bound to be a
> major part of this application, exactly as you describe -- changing
> a headline, adding a paragraph, correcting a typo ...
>
> Are there ways to modify an element? Or do I remove it and add a
> new one?

Mostly adding, replacing or removing elements right now. To do anything more
complex you could always use XTags to find and iterate over nodes (say
Elements) and you could add your own custom, complex changes via scriplets
or beans if need be.


> I see <xtags:element> will create an element. How to I
> indicate where it goes?  The context from select?

<xtags:element> behaves like the XSLT tag, it just outputs an XML element to
the JSP output.

XTags has 3 tags that are relevant for modification of exisitng documents,
<xtags:add>, <xtags:remove> and <xtags:replace>. They are documented here:-

http://jakarta.apache.org/taglibs/doc/xtags-doc/index.html#summary

I think they should do what you need - making modifications to parts of
existing XML documents, using XPath to denote which bits to change or where
to add new content etc.

There are some test examples in the XTags examples web app in

examples/web/test
    test_add.jsp
    test_remove.jsp
    test_replace.jsp

Have a play with those and see what you think - I know of some users of
XTags who find this very useful.

James


_________________________________________________________
Do You Yahoo!?
Get your free @yahoo.com address at http://mail.yahoo.com


Mime
View raw message