Hi All,

 

This is my first posting, but have been using HiveMind for a month or so and finding it is doing the business. I wondered if anyone knows how I can arrange for a configuration element in a schema to receive an XML string (bypassing the normal Java binding for one element and collapsing its contents into a string).

 

I tried using a string element in the schema and using a CDATA section in the configuration point but the parser didn’t seem to like it.  Hence I’m currently using an string attribute and forcing clients to do there own XML quoting, which isn’t ideal as the XML string can be a complicated XPath _expression_. Here is a snippet from my hivemodule.xml file in case my description isn’t clear:

 

 

Schema:

 

        <element name="xPathFilteredDelegator">

 

            <attribute name="order" required="true" translator="int"/>

 

            <attribute name="servicePoint" required="true" translator="service-point"/>

 

            <attribute name="xpathFilter" required="true"/>

 

            <conversion class="....XPathFilteredDelegatorConfig"/>

 

            <element name="connection">

                Information used to connect to external system.

 

                <attribute name="server" required="true">

                    Server to be connected to.

                </attribute>

 

                <attribute name="port" required="true">

                    Port on server to be connected to.

                </attribute>

 

                <attribute name="processName">

                    "Process" name to be invoked on server, if this notion

                makes sense for the delegator.

                </attribute>

 

                <attribute name="extraData">

                    Uninterpreted extra delegator-specific data to be

                passed-in.

                </attribute>

                <rules>

                    <create-object class="...ExternalConnectionDetails"/>

                    <read-attribute attribute="server" property="server"/>

                    <read-attribute attribute="port" property="port"/>

                    <read-attribute attribute="processName" property="processName"/>

                    <read-attribute attribute="extraData" property="extraData"/>

                    <invoke-parent method="setConnectionDetails"/>

                </rules>

            </element>

           

        </element>

 

Usage:

 

    <contribution configuration-id="…">

                <!-- todo CDATA didn't work, so what else can be done? -->

        <xPathFilteredDelegator order="150" servicePoint="testDelegator"

            xpathFilter="/[EMAIL PROTECTED]’a&gt;b’">

            <connection

                server="SRV1"

                port="1234"

                processName="PROC1"

                extraData="EXT1"/>

        </xPathFilteredDelegator>

    </contribution>

 

Thanks

 

Norval Hope

 

Reply via email to