cocoon-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From James.Aggrey-Orle...@ubsw.com
Subject XSP: trials of a newbie
Date Wed, 11 Oct 2000 17:41:20 GMT
Dear All,

I am trying to create an xsp page that dynamically fetches xml from a
server (using uri request)
and applies the specified stylesheet:-

Thx to Robin, I-Chung, bloritsch and sudheendra i have got this far:-

1) Read the FAQ/mail list on how to setup page.

2) Figured out i needed to encode the uri (swap "&" for "&" etc)

3) Fixed the xsp bug (e.getMessage), and along the way figured out how
to see the generated java code....

4) Figured out w/ I-Chung that the xml generated by my xsp starts with
text (outside root tags i suppose).....i got the following err msg...

org.apache.xalan.xslt.XSLProcessorException: Warning: can't output text
before document element!  Ignoring...
      at java.lang.Throwable.fillInStackTrace(Native Method)
      at java.lang.Throwable.(Throwable.java:94)
      at java.lang.Exception.(Exception.java:42)
      at org.xml.sax.SAXException.(SAXException.java:45)
      at org.apache.xalan.xpath.XPathException.(XPathException.java:92)

      ===[snip]===

5) Removed the xsl & xml:stylesheet PI's from my xsp page to see the xml
generated...it was as follows:-



================== Generated page =====

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN"
"http://www.w3.org/TR/REC-html40/strict.dtd">
<page>
  
{http://user_name:passwd@server:port/xxxxxx_cgi?Action=Search&amp;Search
Type=next&amp;ResultTemplate=MetaRetrieval.hts&amp;Collection=Credit&amp
;ResultStart=0&amp;ResultCount=200&amp;SortOrder=desc&amp;SortField=date
view:  
user_name}
         


</page>

<!-- This page was served in 120 milliseconds by Cocoon 1.7.4 -->

//================== End Generated page =====


================== XML (xsp) page =====

<?xml version="1.0" encoding='ISO-8859-1'?>
<?cocoon-process type="xsp"?>

<!-- <?cocoon-process type="xslt"?> removed to see xml gen'd -->
<!-- <?xml-stylesheet type="text/xsl" href="xsl/VD.xsl" ?> removed to
see xml gen'd -->

<xsp:page language="java"
        xmlns:xsp="http://www.apache.org/1999/XSP/Core"
        xmlns:util="http://www.apache.org/1999/XSP/Util">

<page>
      <util:include-uri
href="http://user_name:passwd@server:port/xxxxxx_cgi?Action=Search&amp;S
earchType=next&amp;ResultTemplate=MetaRetrieval.hts&amp;Collection=Credi
t&amp;ResultStart=0&amp;ResultCount=200&amp;SortOrder=desc&amp;SortField
=dateview"/>

</page>

</xsp:page>

//================== End XML (xsp) page =====

The xml generated when i put the request into my netscape browser
location is as follows:-

================== XML generated by request in browser  =====

<?xml version="1.0" encoding='ISO-8859-1'?>
<Results>

<totaldocs>4</totaldocs>

<Document>
<author>K C</author>
<company>AT&amp;T Corp.</company>
<title>Cox, Cox Radio, AT&amp;T, British Telecom</title>
<subject>Microsoft Word - withimage0613.doc </subject>
<sector>Telecommunications</sector>
<stock></stock>
<country>North America</country>
<url></url>
<summtext></summtext>
<textnote></textnote>
<relurl></relurl>
<verityurl></verityurl>
<score>100</score>
<size>569486</size>
<date>13 jun 2000 00 00</date >
<documenttype></documenttype>
<Mime-Type>application/pdf</Mime-Type>
<distribution>0</distribution>
<id></id>
<pagecount>41</pagecount>
</Document>

<Document>......
</Document>

<Document>......
</Document>

<Document>......
</Document>

</Results>
================== End XML generated by request in browser  =====

Why does the request (made in xsp page) not return an xml string as it
does in the browser?

Any help appreciated....

Rgds,
James





Visit our website at http://www.ubswarburg.com

This message contains confidential information and is intended only 
for the individual named.  If you are not the named addressee you 
should not disseminate, distribute or copy this e-mail.  Please 
notify the sender immediately by e-mail if you have received this 
e-mail by mistake and delete this e-mail from your system.

E-mail transmission cannot be guaranteed to be secure or error-free 
as information could be intercepted, corrupted, lost, destroyed, 
arrive late or incomplete, or contain viruses.  The sender therefore 
does not accept liability for any errors or omissions in the contents 
of this message which arise as a result of e-mail transmission.  If 
verification is required please request a hard-copy version.  This 
message is provided for informational purposes and should not be 
construed as a solicitation or offer to buy or sell any securities or 
related financial instruments.

Mime
View raw message