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: 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.jspError(DefaultErrorHandler.
java:105)
        at
org.apache.jasper.compiler.ErrorDispatcher.dispatch(ErrorDispatcher.java:430
)
        at
org.apache.jasper.compiler.ErrorDispatcher.jspError(ErrorDispatcher.java:245
)
        at
org.apache.jasper.compiler.JspDocumentParser.parse(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 [EMAIL PROTECTED] with body: "signoff JSP-INTEREST".
For digest: mailto [EMAIL 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

Reply via email to