You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@cocoon.apache.org by Thomas Klement <kl...@gmd.de> on 2001/07/05 17:01:10 UTC

Dealing with XML Fragments in logicsheets

Hi,

I wonder if there is a way to process xml fragments with logicsheets. For
instance, I want to insert the fragment "person" in the following example
into a xml database using a logicsheet (that processes xmldb:insertFragment)
in conjunction with a helper class.

<xmldb:insertFragment collection="xmldb:dbxml:///db/mydb2">
	<person>
		<fname>Thomas</fname>
		<lname>Klement</lname>
		<email type="work">klement@gmd.de</email>
		<address type="work">D-64293 Darmstadt</address>
	</person>
</xmldb:insertFragment>

The problem is "how to assign a parameter of this helper class to transport
the content below the person tag". I didn't find any example of that.

Can anyone help, please?

Cheers,
Thomas


---------
Thomas Klement
GMD - German National Research Center
for Information Technology
GMD-IPSI
PO-Box 10 01 38
D-64201 Darmstadt


---------------------------------------------------------------------
To unsubscribe, e-mail: cocoon-dev-unsubscribe@xml.apache.org
For additional commands, email: cocoon-dev-help@xml.apache.org


Re: Dealing with XML Fragments in logicsheets

Posted by Sylvain Wallez <sy...@anyware-tech.com>.

Thomas Klement a écrit :
> 
> Hi,
> 
> I wonder if there is a way to process xml fragments with logicsheets. For
> instance, I want to insert the fragment "person" in the following example
> into a xml database using a logicsheet (that processes xmldb:insertFragment)
> in conjunction with a helper class.
> 
> <xmldb:insertFragment collection="xmldb:dbxml:///db/mydb2">
>         <person>
>                 <fname>Thomas</fname>
>                 <lname>Klement</lname>
>                 <email type="work">klement@gmd.de</email>
>                 <address type="work">D-64293 Darmstadt</address>
>         </person>
> </xmldb:insertFragment>
> 
> The problem is "how to assign a parameter of this helper class to transport
> the content below the person tag". I didn't find any example of that.
> 
> Can anyone help, please?
> 
By "fragment", do you mean a DOM DocumentFragment ?

If so, your xmldb:insertFragment can change the XSP contentHandler to a
DOMBuilder, apply templates on its content so that it gets converted to
a DOM, and then restore the XSP contentHandler and insert the built DOM
into the database.

> Cheers,
> Thomas
> 
> ---------
> Thomas Klement
> GMD - German National Research Center
> for Information Technology
> GMD-IPSI
> PO-Box 10 01 38
> D-64201 Darmstadt
> 

-- 
Sylvain Wallez
Anyware Technologies - http://www.anyware-tech.com

---------------------------------------------------------------------
To unsubscribe, e-mail: cocoon-dev-unsubscribe@xml.apache.org
For additional commands, email: cocoon-dev-help@xml.apache.org