You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@forrest.apache.org by "Gav...." <br...@brightontown.com.au> on 2007/06/09 05:32:27 UTC

RE: svn commit: r545483 - .../descriptorIndex-to-contactsCSV.xsl


> -----Original Message-----
> From: rgardler@apache.org [mailto:rgardler@apache.org]
> Sent: Friday, 8 June 2007 7:41 PM
> To: svn@forrest.apache.org
> Subject: svn commit: r545483 -
> /forrest/trunk/whiteboard/plugins/org.apache.forrest.plugin.input.doap/res
> ources/stylesheets/descriptorIndex-to-contactsCSV.xsl
> 
> Author: rgardler
> Date: Fri Jun  8 04:40:29 2007
> New Revision: 545483
> 
> URL: http://svn.apache.org/viewvc?view=rev&rev=545483
> Log:
> Ensure only one line break after each record (there has to be a tidier way
> of doing this - any clue?)

I got any empty contacts.csv file when requesting
http://localhost:8888/projectDetails/contacts.csv

Have I missed out a step (this is working directly from the plugin which I
assume had sample data to go in here.)

I found this
http://sleepyhead81.blogspot.com/2004/08/line-breaks-in-xslt.html but have
not been able to try its technique, nor if it appropriate until it has been
tried.

Gav...

> 
> Modified:
> 
> forrest/trunk/whiteboard/plugins/org.apache.forrest.plugin.input.doap/reso
> urces/stylesheets/descriptorIndex-to-contactsCSV.xsl
> 
> Modified:
> forrest/trunk/whiteboard/plugins/org.apache.forrest.plugin.input.doap/reso
> urces/stylesheets/descriptorIndex-to-contactsCSV.xsl
> URL:
> http://svn.apache.org/viewvc/forrest/trunk/whiteboard/plugins/org.apache.f
> orrest.plugin.input.doap/resources/stylesheets/descriptorIndex-to-
> contactsCSV.xsl?view=diff&rev=545483&r1=545482&r2=545483
> ==========================================================================
> ====
> ---
> forrest/trunk/whiteboard/plugins/org.apache.forrest.plugin.input.doap/reso
> urces/stylesheets/descriptorIndex-to-contactsCSV.xsl (original)
> +++
> forrest/trunk/whiteboard/plugins/org.apache.forrest.plugin.input.doap/reso
> urces/stylesheets/descriptorIndex-to-contactsCSV.xsl Fri Jun  8 04:40:29
> 2007
> @@ -34,17 +34,16 @@
>      <xsl:template match="descriptor">
>          <xsl:apply-templates />
>      </xsl:template>
> -    <xsl:template match="doap:Project">
> -        <xsl:apply-templates />
> -    </xsl:template>
> +
> +    <xsl:template match="doap:Project"><xsl:apply-templates
> /></xsl:template>
> +
>      <xsl:template match="doap:maintainer">
>        <xsl:if test="starts-with(foaf:Person/foaf:mbox/@rdf:resource,
> 'mailto:')">
> -        <xsl:value-of select="normalize-space(../doap:name)"
> />,<xsl:apply-templates />
> -<xsl:text>
> -
> -</xsl:text>
> -      </xsl:if>
> +      <!-- the stange formatting in this line is to ensure only one line
> break after each record (there has to be a tidier way of doing this - any
> clue?) -->
> +        <xsl:value-of select="normalize-space(../doap:name)"
> />,<xsl:apply-templates /><xsl:text>
> +</xsl:text></xsl:if>
>      </xsl:template>
> +
>      <xsl:template match="foaf:Person">
>          <xsl:apply-templates select="foaf:name" />,<xsl:apply-templates
> select="foaf:mbox" />
>      </xsl:template>


RE: svn commit: r545483 - .../descriptorIndex-to-contactsCSV.xsl

Posted by "Gav...." <br...@brightontown.com.au>.

> -----Original Message-----
> From: ross.gardler@googlemail.com [mailto:ross.gardler@googlemail.com] On
> Behalf Of Ross Gardler
> Sent: Sunday, 10 June 2007 7:18 AM
> To: dev@forrest.apache.org
> Subject: Re: svn commit: r545483 - .../descriptorIndex-to-contactsCSV.xsl
> 
> On 09/06/07, Gav.... <br...@brightontown.com.au> wrote:
> >
> >
> > > -----Original Message-----
> > > From: rgardler@apache.org [mailto:rgardler@apache.org]
> > > Sent: Friday, 8 June 2007 7:41 PM
> > > To: svn@forrest.apache.org
> > > Subject: svn commit: r545483 -
> > >
> /forrest/trunk/whiteboard/plugins/org.apache.forrest.plugin.input.doap/res
> > > ources/stylesheets/descriptorIndex-to-contactsCSV.xsl
> > >
> > > Author: rgardler
> > > Date: Fri Jun  8 04:40:29 2007
> > > New Revision: 545483
> > >
> > > URL: http://svn.apache.org/viewvc?view=rev&rev=545483
> > > Log:
> > > Ensure only one line break after each record (there has to be a tidier
> way
> > > of doing this - any clue?)
> >
> > I got any empty contacts.csv file when requesting
> > http://localhost:8888/projectDetails/contacts.csv
> >
> > Have I missed out a step (this is working directly from the plugin which
> I
> > assume had sample data to go in here.)
> 
> I confess to not having tested it in the docs for the plugin, I did
> this for a site I have that uses the doap plugin. It is, of course, a
> fair assumption that the plugin itself would have a working sample in
> it - sorry!
> 
> Anyway, long story short, I've fixed it now (wasn't handling cases
> where root element was rdf:RDF)

And maybe I should have spotted why it wasn't working, many eyes and all
that.. thanks for fixing it.

> 
> > I found this
> > http://sleepyhead81.blogspot.com/2004/08/line-breaks-in-xslt.html but
> have
> > not been able to try its technique, nor if it appropriate until it has
> been
> > tried.
> 
> That's the method (well a slight variation of the method) I am using -
> it's just clumsy and so does not feel right..

Ok, As far as I can make out, elements by default have preserved spaces, but
we are over-riding this by use of normalize-space and so are putting in 
<xsl:text> <xsl:text> to create a line break where needed and seems to be
a common way of dealing with it.

We need to create another record to test it properly.

Gav...

> 
> Ross


Re: svn commit: r545483 - .../descriptorIndex-to-contactsCSV.xsl

Posted by Ross Gardler <rg...@apache.org>.
On 09/06/07, Gav.... <br...@brightontown.com.au> wrote:
>
>
> > -----Original Message-----
> > From: rgardler@apache.org [mailto:rgardler@apache.org]
> > Sent: Friday, 8 June 2007 7:41 PM
> > To: svn@forrest.apache.org
> > Subject: svn commit: r545483 -
> > /forrest/trunk/whiteboard/plugins/org.apache.forrest.plugin.input.doap/res
> > ources/stylesheets/descriptorIndex-to-contactsCSV.xsl
> >
> > Author: rgardler
> > Date: Fri Jun  8 04:40:29 2007
> > New Revision: 545483
> >
> > URL: http://svn.apache.org/viewvc?view=rev&rev=545483
> > Log:
> > Ensure only one line break after each record (there has to be a tidier way
> > of doing this - any clue?)
>
> I got any empty contacts.csv file when requesting
> http://localhost:8888/projectDetails/contacts.csv
>
> Have I missed out a step (this is working directly from the plugin which I
> assume had sample data to go in here.)

I confess to not having tested it in the docs for the plugin, I did
this for a site I have that uses the doap plugin. It is, of course, a
fair assumption that the plugin itself would have a working sample in
it - sorry!

Anyway, long story short, I've fixed it now (wasn't handling cases
where root element was rdf:RDF)

> I found this
> http://sleepyhead81.blogspot.com/2004/08/line-breaks-in-xslt.html but have
> not been able to try its technique, nor if it appropriate until it has been
> tried.

That's the method (well a slight variation of the method) I am using -
it's just clumsy and so does not feel right..

Ross