After reading the XUpdate specification[1], it gave me some ideas.  It's a
bit awkward to specify this:

    <xupdate:element name="address">
        <town>San Francisco</town>
    </xupdate:element>

To achieve this:

    <address>
        <town>San Francisco</town>
    </address>

I think I understand why it's that way.  However, XUpdate seems more ideally
suited for a JSP tag library, for tags can evaluate their bodies before
performing any updates.  I'm familiar with XTags[2], but XTags 1.0 doesn't
have useful XUpdate stuff like <insertBefore>, <update>, and <insertAfter>.

But I digress.  It might be nice to have an XUpdate-like tag library
interface to Xindice.  For example:

<xindice:database url="xmldb:xindice:...">
    <xindice:collection url="yadda">
        <xindice:document name="blah">
            <xindice:update
select="//someElement/text()">{$aJSPVariable}</xindice:update>
            <xindice:insertAfter select="//[EMAIL PROTECTED] =
'{$aJSPExpression']">
                <newElement>
                    <newChild/>
                </newElement>
            </xindice:insertAfter>
            <xindice:insertBefore select="/*">
                <xindice:comment>This comment goes before the
root.</xindice:comment>
            </xindice:insertBefore>
            ...
        </xindice:document>
        ... (more documents)
    </xindice:collection>
    ... (more collections)
</xindice:database>

[1] http://www.xmldb.org/xupdate/
[2] http://jakarta.apache.org/taglibs/doc/xtags-doc/

Reply via email to