AW: SQL RE: 2 (should be) easy questions

2003-03-12 Thread Marco Rolappe



hi 
richard,
 
well, 
what can I say... the xsl not only looks complicated, it looks like a mess 
;-)  you should really, really (really ;-) read up on the technologies 
you're trying to use.
 
1. 
what do you need the DTD for?
2. why 
are you trying to handle elements which are supposed to be handled by the sql 
transformer (which in this case couldn't even work because you're not matching 
the correspondig namespace)?
3. in 
which sequence are transformations applied? (sql transformer -> your 
stylesheet, or vice versa?)
 
just a 
guess; starting from your database.xml you want to have an sql query executed 
and the query results formatted by your database.xsl.
 
then 
please do it like that. generate (database.xml) -> transform (sql) -> 
transform (database.xsl) -> serialize (html?)
 
you're 
not even trying to handle the query results (in database.xml I only see a query 
defined, but the results are handled nowhere). you seem to be assuming the 
results are coming from somewhere and are trying to handle them within your 
stylesheet. please read the accompanying docs; it would save you and those 
trying to help you time and struggles.
 
just 
to get you started; to handle the results you would insert appropriate 
statements within the  element to generate e.g. 
elements which contain the data you want to 
transform/style/serialize;
 
example (top off my head, based on esql logicsheet);
...

    

    SELECT artistbandname, 
generalmusictitle FROM artistband
    
 
    
    
    

    

    

    

    
    

...
 
then 
after the sql transformer step the corresponding data will be available in the 
SAX event stream which you can then handle from within your 
stylesheet.
 
 
ok, 
let's get to the stylesheet:
 
 
> 
> 
> 
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
> 
xmlns:sql="http://apache.org/cocoon/SQL/2.0">
 
> 
> 
> 
> 
> 
> 
soundpool
 
the 
 element should go into the  
element.
 
> 
 
what 
is this supposed to do? for each document root? there's only one document 
root.
 
> 
> 
> 
> 
 
is 
that if test on the document root? why aren't you just creating the table body 
via ?
 
> 
> 
> 
> 
> 
> 
> 
> 

> 
> 
> 

> 
> 

> 
> 
 
nesting mess, huh? ;-)
 
> 
> 
> 
> 
 
again, 
why not ?
 

 

 
here 
you would handle the data produced by the sql transformer 
step.
 

 
my 
last advice; read the docs, please.
 
-Ursprüngliche Nachricht-Von: 
[EMAIL PROTECTED] 
[mailto:[EMAIL PROTECTED]Im Auftrag 
von Richard CunliffeGesendet: Mittwoch, 12. März 2003 
18:47An: [EMAIL PROTECTED]Betreff: RE: SQL RE: 2 
(should be) easy questions

  
  Thorsten,
   
  Ok the following 
  statement is trying to display the results of the query from the MySQL 
  database in a table, I don’t know if this is right.
   
  What are 
  you trying to do with, anyway:
  
   
   
  The code looks 
  complicated, because I am using XML Spy designer which allows you to put 
  together your style sheet visually, with the aid of the DTD. The code above 
  was the XML Spy’s way of trying to represent it from the 
DTD.
   
  I have attached my 
  xml, xsl, and dtd for you to have a look at to get a better 
  understanding.
   
  Many 
  thanks,
   
  Richard.
   


AW: SQL RE: 2 (should be) easy questions

2003-03-12 Thread Scherler, Thorsten



Hello 
again,
 
do you 
know the book "Cocoon: Building XML Applications" form Carsten Ziegeler & 
Matthew Langham [ISBN of the book (0735712352)]?
 
Here 
is an example as attachment (hope that is allright with you, 
Carsten&Matthew) about SQL.
 
King 
regards
Thorsten

  -Ursprüngliche Nachricht-Von: Scherler, Thorsten 
  Gesendet: Mittwoch, 12. März 2003 19:58An: 
  [EMAIL PROTECTED]Betreff: AW: SQL RE: 2 (should be) easy 
  questions
  I 
  had a glance at your code, do you use the SPY as well to show the 
  result?
   
  I 
  guess not! I am using the SPY as well. 
   
  Ok, 
  correct me if I am wrong! I aspect your pipeline looks like that (because I 
  guess you are using cocoon to transform):
         
    
   
   
  Is 
  that right? If not -> it should look like that!
   
  Explanation:
     1) 
    2)    3) 
    
   
   
  1) take the 
  database.xml
  2) excecute the SQL Statement <- that will 
  produce XML 
  3) your transformation. BASED on everything 
  before!
   
  Try the following:
  
      
         
   
   
  then you see what you have to transform! See 
  the source code (browser right click) and copy it to the Spy. from there you 
  can copy the XPath. 
  ...and then you *just* have to go 
  on!
   
  Hope that helps!
  Thorsten
  
-Ursprüngliche Nachricht-Von: Richard Cunliffe 
[mailto:[EMAIL PROTECTED]Gesendet: Mittwoch, 12. März 2003 
18:47An: [EMAIL PROTECTED]Betreff: RE: SQL 
RE: 2 (should be) easy questions

Thorsten,
 
Ok the following 
statement is trying to display the results of the query from the MySQL 
database in a table, I don’t know if this is right.
 
What 
are you trying to do with, anyway:

 
 
The code looks 
complicated, because I am using XML Spy designer which allows you to put 
together your style sheet visually, with the aid of the DTD. The code above 
was the XML Spy’s way of trying to represent it from the 
DTD.
 
I have attached my 
xml, xsl, and dtd for you to have a look at to get a better 
understanding.
 
Many 
thanks,
 
Richard.
 


example.zip
Description: example.zip
-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

AW: SQL RE: 2 (should be) easy questions

2003-03-12 Thread Scherler, Thorsten



I had 
a glance at your code, do you use the SPY as well to show the 
result?
 
I 
guess not! I am using the SPY as well. 
 
Ok, 
correct me if I am wrong! I aspect your pipeline looks like that (because I 
guess you are using cocoon to transform):
       
  
 
 
Is 
that right? If not -> it should look like that!
 
Explanation:
   1) 
  2)    3) 
  
 
 
1) take the 
database.xml
2) excecute the SQL Statement <- that will 
produce XML 
3) your transformation. BASED on everything 
before!
 
Try the following:

    
       
 
 
then you see what you have to transform! See the 
source code (browser right click) and copy it to the Spy. from there you can 
copy the XPath. 
...and then you *just* have to go 
on!
 
Hope that helps!
Thorsten

  -Ursprüngliche Nachricht-Von: Richard Cunliffe 
  [mailto:[EMAIL PROTECTED]Gesendet: Mittwoch, 12. März 2003 
  18:47An: [EMAIL PROTECTED]Betreff: RE: SQL RE: 
  2 (should be) easy questions
  
  Thorsten,
   
  Ok the following 
  statement is trying to display the results of the query from the MySQL 
  database in a table, I don’t know if this is right.
   
  What are 
  you trying to do with, anyway:
  
   
   
  The code looks 
  complicated, because I am using XML Spy designer which allows you to put 
  together your style sheet visually, with the aid of the DTD. The code above 
  was the XML Spy’s way of trying to represent it from the 
DTD.
   
  I have attached my 
  xml, xsl, and dtd for you to have a look at to get a better 
  understanding.
   
  Many 
  thanks,
   
  Richard.
   


AW: SQL RE: 2 (should be) easy questions

2003-03-12 Thread Scherler, Thorsten



Hello 
Richard,
 
your 
xsl is quite complex! 
 
To 
begin with, I prefer to nest my templates! So instead of:
 soundpool..
 
I 
would do it like this:
 soundpool
 

...

 
Besides that you have a  within a 
. 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:

 

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:[EMAIL PROTECTED]Gesendet: Mittwoch, 12. März 2003 
  18:19An: [EMAIL PROTECTED]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:[EMAIL PROTECTED] Sent: 12 March 2003 16:34To: 
  [EMAIL PROTECTED]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  that tells me that you need a  in your sitemap!
  
   
  
  Like 
  that:
  
     
  
   
  
  is that 
  right? ...and is it working?
  
   
  
  King 
  regards 
  
  Thorsten
  
   
  
-Ursprüngliche 
Nachricht-Von: Richard 
Cunliffe [mailto:[EMAIL PROTECTED]Gesendet: Mittwoch, 12. März 2003 
17:07An: 
[EMAIL PROTECTED]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:[EMAIL PROTECTED] Sent: 12 March 2003 15:52To: 
[EMAIL PROTECTED]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)):

   

 

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

King 
regards

Thorsten

 

 -Ursprüngliche 
Nachricht-Von: Richard 
Cunliffe [mailto:[EMAIL PROTECTED]Gesendet: Montag, 10. März 2003 
18:49An: 
[EMAIL PROTECTED]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.


AW: SQL RE: 2 (should be) easy questions

2003-03-12 Thread Scherler, Thorsten



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  that tells me that you need a  in your sitemap!
 
Like 
that:
   
 
is 
that right? ...and is it working?
 
King 
regards 
Thorsten
 

  -Ursprüngliche Nachricht-Von: Richard Cunliffe 
  [mailto:[EMAIL PROTECTED]Gesendet: Mittwoch, 12. März 2003 
  17:07An: [EMAIL PROTECTED]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:[EMAIL PROTECTED] Sent: 12 March 2003 15:52To: 
  [EMAIL PROTECTED]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)):
  
     
  
   
  
  to 2) 
  ??? don't understand the problem 
  
  King 
  regards
  
  Thorsten
  
   
  
   -Ursprüngliche 
  Nachricht-Von: Richard 
  Cunliffe [mailto:[EMAIL PROTECTED]Gesendet: Montag, 10. März 2003 
  18:49An: 
  [EMAIL PROTECTED]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:
 
   
 
- This is what 
XML Spy produced in its XSLT designer, I have also tried
 

   
 
– 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.