[daisy] Parameterizing an include using a field value..

Alan Mortensen alan.mortensen at gmail.com
Wed Apr 4 17:04:21 CDT 2007


 Thanks for the quick response.  I didn't think of the include because I
figured includes had to happen before styling.. but I guess that's only true
of internal includes.  I like the einclude method it feels more in sync with
the cocoon/daisy underpinnings, I just have to make sure I format the
various database pulls first.

The xsl document() way has one benefit and that is that I can format it
right in the same xsl.  It kept giving me this:

> WARN  (2007-04-03) 18:38.07:498 [sitemap.transformer.xalan]
> (/diagnoser/g2/1068-ALDEV.html?layoutType=plain)
> SocketListener0-2/TraxErrorListener:
> daisyskin:/(diagnoserCR)document-styling/html/SubjectPage.xsl:9:113


Where 9 is the line with the document(xxx) statement on it and 113 is the
end of the line.  No other log anywhere showed any problems.. and the file
renders as if the line and it's associated template match wasn't there.  The
link I supply to document is a quoted URL that returns valid XML in
Firefox.  The only problem I see is that the doctype for some odd reason
(even though I'm using the xml serializer) is listed as html in the output
from the URL..

Just figured you'd like to know, I'm going with the include method.  Thanks
again..

Alan

P.S. Appreciate the mention of the workshop but my boss reminded me that his
last education conference was 4 days with workshops and costs $120 and it
was local.. ughh..  So we're poor boying it around here.  I'll make sure to
post a link to the site and point out what was done in Daisy/Cocoon when
it's public.

>From mpo at outerthought.org
>
> Alan Mortensen wrote:
> > I've seen this done with daisy content using queries, but I want to do
> > it with external (or more specifically cocoon:) URLs.  The situation is
> > kind of like this:
> >
>
> > DocumentType: Category
> > Name: Blue
> >
> > and either through include or through a custom publisher request I'd
> > like to include:
> >
> > cocoon://ext/mysearch/Blue
> >
>
> > Which returns XML formatted data from a database.
> >
>
> yummy!
>
> > Hrm.. another way to say it is: I'd like to parameterize an external
> > include based on the data in a document..
> >
>
> > What's the best way to do this.. or at least ANY way to do this?
> >
>
> I'ld go for modifying the document-specific styling for that document
> and insert the url there
>
> that xslt should have access to the fields
>
>
> what you need to 'leave' in the xslt output is a tag to be picked up by
> Daisy's include-transformer (a daisy provided cocoon component)
>
> the tag looks like this:
>
>   <einclude:include
>
>       xmlns:einclude="http://outerx.org/daisy/1.0#externalinclude"
>       src="cocoon:/ext/mysearch/{fielvalue-or-docname}" />
>
>
>
> note though that this include-transformer is at the end of the pipeline,
> so it is fit to insert a ready HTML blurp (not XML). In other words your
> extension-pipeline should be doing his part of the html rendering already.
>
>
> HTH,
> -marc= ((loosing the fight to resist) adding that this is the kind of
> stuff our Daisy Workshop is addressing...)
>
> PS: by the way: living in these 'modern ajax times' you might also opt
>
> to fetch this stuff asynchronously (might turn out easier)
>
>
> > I've been pulling my hair out a bit so far.  I don't see a way to do it
>
> uhuh, never looked at myself as a hair-protecting shampoo,
>
> nevertheless I'm hoping the above advise will be effective in this area
> as well :-)
>
> > in the pub request itself.  I don't see how in the document content to
> > insert a value like the name or field FOO into an include.  I finally
>
> > resorted to trying to get the document using the document() method in
> > the document-styling XSL which I know is hacky (and at this time not
> > working for me) but I don't know what else to do..
>
> >
>
> interesting approach, without wanting to judge the hack-level this
> should work imho, what error do you get?
>
> > The reason I need to do this is that there are a large number of
> > Category documents, and the users are not exactly tech savvy.  So
>
> > instead of requiring them to put in the include with the URL correctly
> > in every category document (it's a bit more complex a URL than the
> > example) or me having to edit each document I was hoping I could just
>
> > have them enter a field and be done with it.
> >
> > Oh, and if it wasn't clear, I'd like the include to be associated with
> > the type or the pubrequest somehow, just the parameter should change per
>
> > instance document.
> >
>
> attaching it to the type is easy through 'document-specific styling'
> (see http://cocoondev.org/daisydocs-2_0/374-cd/g1/26-cd.html
> )
>
> if you want to let the chosen publisher request have a say in this, then
> you should leave a @styleHint in there
> (see http://cocoondev.org/daisydocs-2_0/373-cd/194-cd.html
> )
>
> > Alan
>
> cool stuff, mate!
> -marc=
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.cocoondev.org/pipermail/daisy/attachments/20070404/eb6d483e/attachment.html


More information about the daisy mailing list