Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

XJTL taglib-->Promblems with outputting XML document

Status
Not open for further replies.

Nooby

Technical User
Nov 3, 2003
1
GB
I'm currently trying to use the XJTL XML output tag library (in conjunction with the JSTL1) to dynamically generate XML documents.

The following example is a 99% copy of a simple example provided by the XJTL developers, the only alteration I have made is to include a small fragment of code to prevent a browser from caching the page.

When I try and view the generated document through a browser (IE5.5) an error is returned explaining that the document lacks a top level element.

What could be the cause of this problem?

Cheers,

Nick



<%@ page language=&quot;java&quot; %>
<%@ taglib uri=&quot;/WEB-INF/tags/c.tld&quot; prefix =&quot;c&quot; %>
%@ taglib uri=&quot;/WEB-INF/tags/OutputXML.tld&quot; prefix =&quot;o&quot; %>
<%
response.setHeader(&quot;Cache-Control&quot;,&quot;no-cache&quot;); //HTTP 1.1
response.setHeader(&quot;Pragma&quot;,&quot;no-cache&quot;); //HTTP 1.0
response.setDateHeader (&quot;Expires&quot;, 0); //prevents caching at the proxy server

%>

<o:document>
<c:set var=&quot;id&quot; value=&quot;js890&quot;></c:set>
<o:element name=&quot;person&quot; attr=&quot;id&quot;>
<o:element name=&quot;name&quot;>
<o:data>John Smith</o:data>
</o:element>
<o:element name=&quot;email&quot;>
<o:data>John.Smith@yahoo.com</o:data>
</o:element>
<o:element name=&quot;phone&quot;>
<o:data>650-123-4567</o:data>
</o:element>
<c:set var=&quot;city&quot; value=&quot;Palo Alto&quot;/>
<c:set var=&quot;state&quot; value=&quot;CA&quot;/>
<c:set var=&quot;zip&quot; value=&quot;94303&quot;/>
<c:set var=&quot;country&quot; value=&quot;USA&quot;/>
<o:element name=&quot;address&quot; attr=&quot;city state zip country&quot;>
<o:element name=&quot;line1&quot;>
<o:data>JS Information Systems, Inc.</o:data>
</o:element>
<o:element name=&quot;line2&quot;>
<o:data>1001 San Antonio Road</o:data>
</o:element>
</o:element>
</o:element>
</o:document>


 
First problem I notice is a typo. There is no opening bracket on one of your declarations (3rd line).

In case this is an error in cutting-and-pasting (and your original code was correct), I'll keep looking and post back if I find anything.

************
RudeJohn
************
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top