You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@cocoon.apache.org by Sylvain Wallez <sy...@anyware-tech.com> on 2003/01/09 23:38:02 UTC
AsynchronousCIncludeTransformer in scratchpad
Hi team,
I just checked in Greg Weinger's AsynchronousCIncludeTransformer [1] in
the 2.0 scratchpad.
This transformer allows included resources to be fetched in parallel
using concurrent threads, which is tremedously useful when included
resources are slow such as databases queries or remote web servers (e.g.
RSS feed aggregation).
There's a sample under mount/asynchronous (Greg, I modified it a bit).
However, this makes yet-another implementation of the include family,
and it's more than time for us to try to unify those.
Should we stick to our own CInclude, or should we go back to XInclude
[2] which has reached its 2nd candidate recommendation last september
(how slow : the first draft was written nearly 3 years ago !) ?
A quick look shows that XInclude allows attributes in other namespaces
on <xi:include>, which we may use to give some parameters to the
transformer for a particular resource, and also supports an
<xi:fallback> in case the included resource isn't available.
Is this enough for our needs ?
Sylvain
[1] http://marc.theaimsgroup.com/?l=xml-cocoon-dev&m=103922681622322&w=2
[2] http://www.w3.org/TR/xinclude/
--
Sylvain Wallez Anyware Technologies
http://www.apache.org/~sylvain http://www.anyware-tech.com
{ XML, Java, Cocoon, OpenSource }*{ Training, Consulting, Projects }
---------------------------------------------------------------------
To unsubscribe, e-mail: cocoon-dev-unsubscribe@xml.apache.org
For additional commands, email: cocoon-dev-help@xml.apache.org
Re: AsynchronousCIncludeTransformer in scratchpad
Posted by Steven Noels <st...@outerthought.org>.
Sylvain Wallez wrote:
> Should we stick to our own CInclude, or should we go back to XInclude
> [2] which has reached its 2nd candidate recommendation last september
> (how slow : the first draft was written nearly 3 years ago !) ?
The PR will follow suit IIUC.
> A quick look shows that XInclude allows attributes in other namespaces
> on <xi:include>, which we may use to give some parameters to the
> transformer for a particular resource, and also supports an
> <xi:fallback> in case the included resource isn't available.
>
> Is this enough for our needs ?
Testcases for XInclude: http://dev.w3.org/cvsweb/2001/XInclude-Test-Suite/
Let's aim for standards compliance. There won't be many implementations
(yet), so being a frontrunner will be good PR for Cocoon.
</Steven>
--
Steven Noels http://outerthought.org/
Outerthought - Open Source, Java & XML Competence Support Center
Read my weblog at http://blogs.cocoondev.org/stevenn/
stevenn at outerthought.org stevenn at apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: cocoon-dev-unsubscribe@xml.apache.org
For additional commands, email: cocoon-dev-help@xml.apache.org
RE: AsynchronousCIncludeTransformer in scratchpad
Posted by Carsten Ziegeler <cz...@s-und-n.de>.
Steven Noels [mailto:stevenn@outerthought.org]
>
> Let me guess: a German company interested in racing? :)
>
No, guess again :) -
ok, a hint, they have a financial background (what else, if our
company knows them ;) )
Carsten
---------------------------------------------------------------------
To unsubscribe, e-mail: cocoon-dev-unsubscribe@xml.apache.org
For additional commands, email: cocoon-dev-help@xml.apache.org
Re: AsynchronousCIncludeTransformer in scratchpad
Posted by Steven Noels <st...@outerthought.org>.
Carsten Ziegeler wrote:
> :) - the example above might lead to this. Ok, believe me, it's not
> hackish. There are 3rd party data providers that require a post of
> an XML document in order to get data. So, if you want to include them,
> you need the above. Sad but true.
Let me guess: a German company interested in racing? :)
Sad indeed.
</Steven>
--
Steven Noels http://outerthought.org/
Outerthought - Open Source, Java & XML Competence Support Center
Read my weblog at http://blogs.cocoondev.org/stevenn/
stevenn at outerthought.org stevenn at apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: cocoon-dev-unsubscribe@xml.apache.org
For additional commands, email: cocoon-dev-help@xml.apache.org
RE: AsynchronousCIncludeTransformer in scratchpad
Posted by Carsten Ziegeler <cz...@s-und-n.de>.
Steven Noels wrote:
>
> Carsten Ziegeler wrote:
>
> > Ok, this could solve many problems, but what about:
> >
> > <cinclude src="http://post_to_my_xml_database">
> > <content>
> > <document>
> > <bla/>
> > ..
> > </document>
> > </content>
> > </cinclude>
> >
> > (I leftout some parts, but I think it's clear what I want to say)
> > With the above you can send a complete XML document to somewhere
> > and get a response which is then included. It's not possible
> > to convert a complete XML document to an attribute value.
>
> Never thought of such a use case (seems hackish to me, and a case for a
> SWT-like thing, but anyway).
>
:) - the example above might lead to this. Ok, believe me, it's not
hackish. There are 3rd party data providers that require a post of
an XML document in order to get data. So, if you want to include them,
you need the above. Sad but true.
> Getting back to the schema, any extra attribute _and_ child element on
> the xi:include are supported, so you could have something like this IIUC:
>
> <xi:include href="http://post-to-my-xml-thing">
> <content>
> <document>
> <bla/>
> </document>
> </content>
> </xi:include>
>
> It would of course be up to the XInclude transformer to implement the
> correct (and non-standard) behaviour then, but the standard syntax
> supports it apparently. I don't find any specification on the processing
> that should occur on the child-elements of xi:include, but we can ask
> the authors.
>
Ah, ok, if that is possible, we could add the extra behaviour as child
elements and still conform to the standard. That's ok for me.
Carsten
---------------------------------------------------------------------
To unsubscribe, e-mail: cocoon-dev-unsubscribe@xml.apache.org
For additional commands, email: cocoon-dev-help@xml.apache.org
Re: AsynchronousCIncludeTransformer in scratchpad
Posted by Steven Noels <st...@outerthought.org>.
Carsten Ziegeler wrote:
> Ok, this could solve many problems, but what about:
>
> <cinclude src="http://post_to_my_xml_database">
> <content>
> <document>
> <bla/>
> ..
> </document>
> </content>
> </cinclude>
>
> (I leftout some parts, but I think it's clear what I want to say)
> With the above you can send a complete XML document to somewhere
> and get a response which is then included. It's not possible
> to convert a complete XML document to an attribute value.
Never thought of such a use case (seems hackish to me, and a case for a
SWT-like thing, but anyway).
Getting back to the schema, any extra attribute _and_ child element on
the xi:include are supported, so you could have something like this IIUC:
<xi:include href="http://post-to-my-xml-thing">
<content>
<document>
<bla/>
</document>
</content>
</xi:include>
It would of course be up to the XInclude transformer to implement the
correct (and non-standard) behaviour then, but the standard syntax
supports it apparently. I don't find any specification on the processing
that should occur on the child-elements of xi:include, but we can ask
the authors.
</Steven>
--
Steven Noels http://outerthought.org/
Outerthought - Open Source, Java & XML Competence Support Center
Read my weblog at http://blogs.cocoondev.org/stevenn/
stevenn at outerthought.org stevenn at apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: cocoon-dev-unsubscribe@xml.apache.org
For additional commands, email: cocoon-dev-help@xml.apache.org
RE: AsynchronousCIncludeTransformer in scratchpad
Posted by Carsten Ziegeler <cz...@s-und-n.de>.
Steven Noels wrote:
>
> Carsten Ziegeler wrote:
>
> > Definitely no, the current CInclude transformer can do much more
> > than the simple XInclude version. You can configure the http connection
> > (set the timeout, set if you want to do a post etc.) and you
> > can add parameters described in XML.
> > So I think we really need the CInclude version - if we want to
> > implement the XInclude standard, then we need two transformers.
> > They can - as discussed many times - share the same implementation.
>
> As we see from the xi schema, adding arbitrary configuration params
> should be possible:
>
> http://www.w3.org/TR/xinclude/#syntax
>
> <xs:complexType name="includeType" mixed="true">
> <xs:choice minOccurs='0' maxOccurs='unbounded' >
> <xs:element ref='xi:fallback' />
> <xs:any namespace='##other' processContents='lax' />
> <xs:any namespace='##local' processContents='lax' />
> </xs:choice>
> <xs:attribute name="href" type="xs:anyURI" use="required"/>
> <xs:attribute name="parse" use="optional" default="xml"
> type="xi:parseType" />
> <xs:attribute name="encoding" type="xs:string" use="optional"/>
> <xs:anyAttribute namespace="##other" processContents="lax"/>
> </xs:complexType>
>
> So we could have things like:
>
> <?xml version='1.0'?>
> <document xmlns:xi="http://www.w3.org/2001/XInclude">
> <p>120 Mz is adequate for an average home user.</p>
> <xi:include href="disclaimer.xml">
> <parameter name="" value=""/>
> </xi:include>
> </document>
>
> or even better, use properly namespaced attrs/elems for Cocoon-specific
> configuration data.
>
Ok, this could solve many problems, but what about:
<cinclude src="http://post_to_my_xml_database">
<content>
<document>
<bla/>
..
</document>
</content>
</cinclude>
(I leftout some parts, but I think it's clear what I want to say)
With the above you can send a complete XML document to somewhere
and get a response which is then included. It's not possible
to convert a complete XML document to an attribute value.
Carsten
---------------------------------------------------------------------
To unsubscribe, e-mail: cocoon-dev-unsubscribe@xml.apache.org
For additional commands, email: cocoon-dev-help@xml.apache.org
Re: AsynchronousCIncludeTransformer in scratchpad
Posted by Steven Noels <st...@outerthought.org>.
Carsten Ziegeler wrote:
> Definitely no, the current CInclude transformer can do much more
> than the simple XInclude version. You can configure the http connection
> (set the timeout, set if you want to do a post etc.) and you
> can add parameters described in XML.
> So I think we really need the CInclude version - if we want to
> implement the XInclude standard, then we need two transformers.
> They can - as discussed many times - share the same implementation.
As we see from the xi schema, adding arbitrary configuration params
should be possible:
http://www.w3.org/TR/xinclude/#syntax
<xs:complexType name="includeType" mixed="true">
<xs:choice minOccurs='0' maxOccurs='unbounded' >
<xs:element ref='xi:fallback' />
<xs:any namespace='##other' processContents='lax' />
<xs:any namespace='##local' processContents='lax' />
</xs:choice>
<xs:attribute name="href" type="xs:anyURI" use="required"/>
<xs:attribute name="parse" use="optional" default="xml"
type="xi:parseType" />
<xs:attribute name="encoding" type="xs:string" use="optional"/>
<xs:anyAttribute namespace="##other" processContents="lax"/>
</xs:complexType>
So we could have things like:
<?xml version='1.0'?>
<document xmlns:xi="http://www.w3.org/2001/XInclude">
<p>120 Mz is adequate for an average home user.</p>
<xi:include href="disclaimer.xml">
<parameter name="" value=""/>
</xi:include>
</document>
or even better, use properly namespaced attrs/elems for Cocoon-specific
configuration data.
</Steven>
--
Steven Noels http://outerthought.org/
Outerthought - Open Source, Java & XML Competence Support Center
Read my weblog at http://blogs.cocoondev.org/stevenn/
stevenn at outerthought.org stevenn at apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: cocoon-dev-unsubscribe@xml.apache.org
For additional commands, email: cocoon-dev-help@xml.apache.org
RE: AsynchronousCIncludeTransformer in scratchpad
Posted by Carsten Ziegeler <cz...@s-und-n.de>.
Sylvain Wallez wrote:
>
> Hi team,
>
> I just checked in Greg Weinger's AsynchronousCIncludeTransformer [1] in
> the 2.0 scratchpad.
>
> This transformer allows included resources to be fetched in parallel
> using concurrent threads, which is tremedously useful when included
> resources are slow such as databases queries or remote web servers (e.g.
> RSS feed aggregation).
>
> There's a sample under mount/asynchronous (Greg, I modified it a bit).
>
> However, this makes yet-another implementation of the include family,
> and it's more than time for us to try to unify those.
>
> Should we stick to our own CInclude, or should we go back to XInclude
> [2] which has reached its 2nd candidate recommendation last september
> (how slow : the first draft was written nearly 3 years ago !) ?
>
> A quick look shows that XInclude allows attributes in other namespaces
> on <xi:include>, which we may use to give some parameters to the
> transformer for a particular resource, and also supports an
> <xi:fallback> in case the included resource isn't available.
>
> Is this enough for our needs ?
>
Definitely no, the current CInclude transformer can do much more
than the simple XInclude version. You can configure the http connection
(set the timeout, set if you want to do a post etc.) and you
can add parameters described in XML.
So I think we really need the CInclude version - if we want to
implement the XInclude standard, then we need two transformers.
They can - as discussed many times - share the same implementation.
Carsten
---------------------------------------------------------------------
To unsubscribe, e-mail: cocoon-dev-unsubscribe@xml.apache.org
For additional commands, email: cocoon-dev-help@xml.apache.org