-
Multiple XML document parsing in a JSP page
Hello all...
What I am trying to do is iterate through an already generated array in a
JSP page, and each pass through the array, I want to parse an XML document
based upon a dynamic URI. Problem is, XML's rules only allow for one root
element to exist, and once the second interation starts, it effectively tries
to have two, consequently throwing an error.
Is there a way to dump the parsed document from memory once I am done with
it before each pass through the array? Here is the code I am trying to use:
<%@ page contentType="text/html;charset=windows-1252"%>
<%@ page import="java.sql.*"%>
<%@ page import="java.io.*" %>
<%@ taglib uri="http://jakarta.apache.org/taglibs/xtags-1.0" prefix="xtags"
%>
<%
String tagLibUri = "";
File dataDir = new File("/xmlDocs/");
File[] listing = dataDir.listFiles();
%>
<HTML>
<HEAD>
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=windows-1252">
<TITLE>
Hello World
</TITLE>
</HEAD>
<BODY>
<%
for (int x=0; x < listing.length; x++){
tagLibUri = "/xmlDocs/" + listing[x].getName();
%>
<xtags arse uri="<%=tagLibUri%>"/>
<a href="XMLParse.jsp?xmlFile=<%=listing[x].getName()%>"><%=listing[x].getName()%></a><br>
<%
}
%>
</BODY>
</HTML>
I have tried to use out.flush, and out.clearBuffer, but neither will prevent
the error.
Any ideas/suggestions would be greatly appreciated!
Erik Stell
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
Forum Rules
|
Top DevX Stories
Easy Web Services with SQL Server 2005 HTTP Endpoints
JavaOne 2005: Java Platform Roadmap Focuses on Ease of Development, Sun Focuses on the "Free" in F.O.S.S.
Wed Yourself to UML with the Power of Associations
Microsoft to Add AJAX Capabilities to ASP.NET
IBM's Cloudscape Versus MySQL
|
Bookmarks