cocoon-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Scherler, Thorsten" <Thorsten.Scher...@weidmueller.de>
Subject AW: SQL RE: 2 (should be) easy questions
Date Wed, 12 Mar 2003 17:35:28 GMT
Hello Richard,
 
your xsl is quite complex! 
 
To begin with, I prefer to nest my templates! So instead of:
<xsl:template match="/">
 <html>
<head/>
<body>
<img src="/soundpool/images/backgroundpda.jpg"/>
<title>soundpool</title>
<xsl:for-each select="/">
...
</xsl:for-each select="/">
...
</xsl:template>
 
I would do it like this:
<xsl:template match="/">
 <html>
<head/>
<body>
<img src="/soundpool/images/backgroundpda.jpg"/>
<title>soundpool</title>
<xsl:apply-templates/>
</xsl:template>
 
<xsl:template match="row|rowset">
...
</xsl:template>
 
Besides that you have a <xsl:apply-templates/> within a <xsl:for-each...>. That
will result in an overflow (anybody correct me if I am wrong!). It will be called over and
over again.
 
What are you trying to do with, anyway:
<xsl:for-each select="query">
 <xsl:for-each select="execute-query">
  <xsl:apply-templates/>
 </xsl:for-each>
</xsl:for-each>
 
Ok, I got some results to come out, but as soon as add more to the XSL style sheet nothing
appears from the database.

-> What do you mean?

-----Ursprüngliche Nachricht-----
Von: Richard Cunliffe [mailto:richard@cunliffe.net]
Gesendet: Mittwoch, 12. März 2003 18:19
An: cocoon-users@xml.apache.org
Betreff: RE: SQL RE: 2 (should be) easy questions



Thorsten,

 

Ok, I got some results to come out, but as soon as add more to the XSL style sheet nothing
appears from the database.

 

Is it possible for you to have a look at my style sheet, and see if there are any obvious
mistakes?

 

Many Thanks,

 

Richard.

 

-----Original Message-----
From: Scherler, Thorsten [mailto:Thorsten.Scherler@weidmueller.de] 
Sent: 12 March 2003 16:34
To: cocoon-users@xml.apache.org
Subject: AW: SQL RE: 2 (should be) easy questions

 

Hello Richard,

 

ok, i am still a whee bit confused but I try to answer.

 

You don't need to declare it! If so the CDATA would be the best! 

 

You are using <sql:...> that tells me that you need a <map:transform type="sql"/>
in your sitemap!

 

Like that:

<map:match pattern="verkauf-cp">
 <map:generate src="global/sql/verkauf-select-ap.xml"/>
 <map:transform type="sql"/>
 <map:serialize type="xml"/>
</map:match>

 

is that right? ...and is it working?

 

King regards 

Thorsten

 

-----Ursprüngliche Nachricht-----
Von: Richard Cunliffe [mailto:richard@cunliffe.net]
Gesendet: Mittwoch, 12. März 2003 17:07
An: cocoon-users@xml.apache.org
Betreff: SQL RE: 2 (should be) easy questions

Thorsten,

 

The second question is about the SQL statement I have in my XML document. I am unsure how
to declare it in my DTD.

 

Do you know if it is possible to define the SQL statement in my XML document in the DTD? I
have everything defined, but I know that the SQL statement is defined wrongly. It is currently
defined as data, so that means when a style sheet is applied, it only gives the SQL statement
and not the results.

 

Can you help? I have attached my DTD and XML files.

 

Richard.

 

 

-----Original Message-----
From: Scherler, Thorsten [mailto:Thorsten.Scherler@weidmueller.de] 
Sent: 12 March 2003 15:52
To: cocoon-users@xml.apache.org
Subject: AW: 2 (should be) easy questions

 

Hello Richard,

 

to 1) yes you have to define the image in the sitemap (e.g. from my sitemap (will not work
with your configuration)):

 <!-- =========================== Ressources ================================ -->
<map:pipeline>
 <!-- images gif -->
 <map:match pattern="img/**.gif">
  <map:read src="resources/images/{1}.gif" mime-type="images/gif"/>
 </map:match>
 <!-- images jpg -->
 <map:match pattern="img/**.jpg">
  <map:read src="resources/images/{1}.jpg" mime-type="images/jpeg"/>
 </map:match>
 <map:match pattern="img/**.jpeg">
  <map:read src="resources/images/{1}.jpeg" mime-type="images/jpeg"/>
 </map:match>
</map:pipeline>

 

to 2) ??? don't understand the problem 


King regards

Thorsten

 

 -----Ursprüngliche Nachricht-----
Von: Richard Cunliffe [mailto:richard@cunliffe.net]
Gesendet: Montag, 10. März 2003 18:49
An: cocoon-users@xml.apache.org
Betreff: 2 (should be) easy questions

 

 

Hi,

 

I have two questions:

 

1.                  I'm not sure if this cocoon or my inability to do XSL, but I have my web
page images in an images folder, under the root directory soundpool. Everything was looking
good until I checked the site in netscape, when I found the images were not loading. I consequently
checked on other on other computers, and they were not working there either. Do I need to
included something in my sitemap to tell cocoon where the images are. If this is not the case,
could someone please tell me how to get them to work. The rest of my XML is being parsed correctly.
Below is an example in my style sheet referencing an image:

 

   <img src="C:\tomcat\webapps\cocoon\soundpool\images\uktop10.gif"/> - This is what
XML Spy produced in its XSLT designer, I have also tried

             

   <img src="images\uktop10.gif"/> - this also doesn't work

 

 

 

2.                  My next question is a DTD question

 

I have SQL statements in my XML code to query a MySQL database, and I now want to display
the results, but how do I define this SQL query in my DTD?? I have attached a XML file.

 

 

Richard.


Mime
View raw message