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="java" %>
<%@ taglib uri="/WEB-INF/tags/c.tld" prefix ="c" %>
%@ taglib uri="/WEB-INF/tags/OutputXML.tld" prefix ="o" %>
<%
response.setHeader("Cache-Control","no-cache" //HTTP 1.1
response.setHeader("Pragma","no-cache" //HTTP 1.0
response.setDateHeader ("Expires", 0); //prevents caching at the proxy server
%>
<o:document>
<c:set var="id" value="js890"></c:set>
<o:element name="person" attr="id">
<o:element name="name">
<o:data>John Smith</o:data>
</o:element>
<o:element name="email">
<o:data>John.Smith@yahoo.com</o:data>
</o:element>
<o:element name="phone">
<o:data>650-123-4567</o:data>
</o:element>
<c:set var="city" value="Palo Alto"/>
<c:set var="state" value="CA"/>
<c:set var="zip" value="94303"/>
<c:set var="country" value="USA"/>
<o:element name="address" attr="city state zip country">
<o:element name="line1">
<o:data>JS Information Systems, Inc.</o:data>
</o:element>
<o:element name="line2">
<o:data>1001 San Antonio Road</o:data>
</o:element>
</o:element>
</o:element>
</o:document>
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="java" %>
<%@ taglib uri="/WEB-INF/tags/c.tld" prefix ="c" %>
%@ taglib uri="/WEB-INF/tags/OutputXML.tld" prefix ="o" %>
<%
response.setHeader("Cache-Control","no-cache" //HTTP 1.1
response.setHeader("Pragma","no-cache" //HTTP 1.0
response.setDateHeader ("Expires", 0); //prevents caching at the proxy server
%>
<o:document>
<c:set var="id" value="js890"></c:set>
<o:element name="person" attr="id">
<o:element name="name">
<o:data>John Smith</o:data>
</o:element>
<o:element name="email">
<o:data>John.Smith@yahoo.com</o:data>
</o:element>
<o:element name="phone">
<o:data>650-123-4567</o:data>
</o:element>
<c:set var="city" value="Palo Alto"/>
<c:set var="state" value="CA"/>
<c:set var="zip" value="94303"/>
<c:set var="country" value="USA"/>
<o:element name="address" attr="city state zip country">
<o:element name="line1">
<o:data>JS Information Systems, Inc.</o:data>
</o:element>
<o:element name="line2">
<o:data>1001 San Antonio Road</o:data>
</o:element>
</o:element>
</o:element>
</o:document>