Java Mailing List Archive

http://www.junlu.com/

Google
Google
Mailing List
Home
Forum Home
JBoss - Java Application Server
Struts - A MVC web framework
Tomcat - JSP/Servlet container
iText - An open source PDF Java Library
JDOM - JDOM XML Parser
J2EE - A mailing list for Java(tm) 2 Platform, Enterprise Edition
J2EE Pattern - An interest list for Sun Java Center J2EE Pattern Catalog
Servlet - A mailing list for discussion about Sun Microsystem's Java Servlet API Technology
JSP - A mailing list about Java Server Pages specification and reference
Struts & Hibernate
Subjects
JSP editor plugin for eclipse ?
org apache jasper JasperException: Unable to compile class for JSP
Tomcat: Connection reset by peer: socket write error
Cannot retrieve definition for form bean null
Struts Tiles Tutorial (free Struts training)
Where do I download Tomcat 4 0 6?
Data Access Object (DAO) pattern, example DAO 's
Where to download Tomcat v 4 1 24 from?
Tomcat 5 0 16 Requested resource not available
Oracle Connection Pooling in 3 2 2
Servlet : Session invalidate
Servlet action is currently unavailable
Tomcat/Struts Unicode Encoding/Decoding problems
Tomcat and webapplication specific java library path
Running a Simple JMS Example
Mapping in workers2 properties
org apache jasper JasperException
Cannot find message resources under key org apache struts action
   MESSAGE
problem with html:text bean throwing exception
Cannot find message resources under key org apache struts action MESSAGE
invalid direct reference problem with solution
Tool for jsp debug Try Sysdeo Eclipse Plugin
Tomcat 5 Cannot load JDBC driver class 'null ' SQL state: null
weblogic ejbc
java properties file
Jboss 3 2 3 Coyote Can 't re
Tomcat 5, Apache2 and mod jk2 integration problem
JBoss example problem new to J2EE
url string for connecting jboss to oracle
Value attribute of <html:checkbox
javax servlet ServletException: BeanUtils populate
HTTP Status 404 The requested resource is not available
5 0 18: Windows XP Pro vs Windows 2000
 
jsp:root doesnt allow for namespace declarations other than for t ag libraries

jsp:root doesnt allow for namespace declarations other than for t ag libraries

2003-10-20       - By Mach, Gavin

 Back
I was wondering if anyone else had problems reading in an xml file which has
declared a default namespace attribute in its root element.
The problem is that we are trying to parse an input xml file which has a
default namespace attribute in its root element. This looks like ...
<?xml version="1.0" ?>
<Task SchemaVersion="2.0" Type="ResponseTask"  xmlns="http://someURL">
etc..

When this happens the xml file is not parsed correctly because in xsl the
reference to elements in this document must be prefixed with the namespace
identifier.
This would require you to declare this other namespace with some prefix in
the XSLT stylesheet eg xmlns:lx and refer to the nodes with that prefix eg.
select="/lx:Task/lx:ApplicationData/"...
Now this is fine if your using XSLT but I am parsing the document within a
JSP page which by itself is an XML document conforming to the JSP 1.2
specification. IF you refer to the spec at
http://java.sun.com/products/jsp/syntax/1.2/syntaxref123.html you'll see in
the <jsp:root> element which is the root element in all jsp pages there is a
namespace for the JSP and optional namespace for any tag libraries required.
Unfortunately this spec doesnt offer the option of defining your own
namespace such as the one need by the input xml file. I've tried doing
this..
<jsp:root xmlns:jsp="http://java.sun.com/JSP/Page"
xmlns:lx="http://www.lexign.com/schemas/flow" version="1.2">
...jsp page...
</jsp:root>
but get the following error :
org.apache.jasper.JasperException Source code of org.apache.jasper.JasperException: This absolute uri
(http://www.lexign.com/schemas/flow) cannot be resolved in either web.xml or
the jar files deployed with this application
       at
org.apache.jasper.compiler.DefaultErrorHandler Source code of org.apache.jasper.compiler.DefaultErrorHandler(DefaultErrorHandler.
java:105)
       at
org.apache.jasper.compiler.ErrorDispatcher Source code of org.apache.jasper.compiler.ErrorDispatcher(ErrorDispatcher.java:430
)
       at
org.apache.jasper.compiler.ErrorDispatcher Source code of org.apache.jasper.compiler.ErrorDispatcher(ErrorDispatcher.java:245
)
       at
org.apache.jasper.compiler.JspDocumentParser Source code of org.apache.jasper.compiler.JspDocumentParser(JspDocumentParser.java:16
7)

This error message is basically looking for the tag library located at the
uri but we arent trying to define a taglibrary. Unfortunately this jsp:root
tag only allows you to define optional prefixes for tag libraries and not
for referencing an input xml file.
If anybody knows of another way of doing this I'd love to hear from you.

Regards,
Gavin.

===========================================================================
To unsubscribe: mailto listserv@(protected) with body: "signoff JSP-INTEREST".
For digest: mailto listserv@(protected) with body: "set JSP-INTEREST DIGEST".

Some relevant archives, FAQs and Forums on JSPs can be found at:

http://java.sun.com/products/jsp
http://archives.java.sun.com/jsp-interest.html
http://forums.java.sun.com
http://www.jspinsider.com



©2008 junlu.com - Jax Systems, LLC, U.S.A.