Saladin-
Oops... Rereading your message I got a clearer picture of what you're
asking... No, I don't think there is a more straight forward way to
handle the ns-uri attribute vs. the bind-xml name attribute. You
might try searching the mailing list archives for ns-uri and see if
there has been a discussion about why this is so... (I vaguely
remember having a conversation with someone about it, and I don't
remember if it is supposed to be this way or it is a left over that
should be changed...)
Below is my original response because it may be of help to someone
else in the future. (I thought the question was "can I avoid having
to specify prefixes for all my bind-xml elements")
I don't know as it is that much cleaner, but in the mapping file you
can declare your namespace as the default and give Castor a prefix.
That allows you to skip the prefixes in the bind-xml name attributes
at least. I think you still need the ns-uri attribute though...
It really comes down to the fact that the mapping file has two
different schema's interacting, so the namespaces need to be
separated. You can choose to make one or the other default and prefix
the other or vice versa. Honestly, the few times I really had to have
careful validation of everything, I put prefixes on both namespaces as
a double check for myself.
HTH,
Stephen
On 3/16/07, Saladin Sharif <[EMAIL PROTECTED]> wrote:
Well it seems that I have finally figured out the
problem, thanks God.
For the external-schemaLocation property I needed to
specify the location of the xsd file following the
namespace URI:
xmlReader.setProperty("http://apache.org/xml/properties/schema/external-schemaLocation",
"http://www.nproj.com/japps/AcceptRunRequest
file:///C:/nproj/Java/classes/com/nproj/japps/castor/xsd/test/schema.xsd");
And next I had to specify the namespace URI in the
castor mapping file. In particular, I had to specify
the namespace in the ns-uri attribute for the <map-to>
tag, like so:
<map-to xml="Document"
ns-uri="http://www.nproj.com/japps/AcceptRunRequest"/>
But for the <bind-xml> tag, i had to do two things:
1. Declare the namespace URI and namespace prefix in
the root <mapping> element of the castor mapping file,
like so:
<mapping
xmlns:rns="http://www.nproj.com/japps/AcceptRunRequest">
And then use that namespace prefix in the name
attribute of the <bind-xml> tag, like so:
<bind-xml name="rns:LOGIN_LIST">
I assume that there is not another cleaner way for
specifying the namespace for both the <map-to> and the
<bind-xml> tags, so that they are both consistent in
the mapping file. I mean you cannot specify the
namespace URI in an ns-uri attribute for the
<bind-xml> tag, nor can you specify the namespace
prefix in the xml attribute of the <map-to> tag.
Please feel free to correct me if my assumptions are
incorrect.
Thanks.
-Saladin
**********************************************************
* Saladin Sharif
* e-mail: [EMAIL PROTECTED]
* Visit homepage @ http://gaia.ecs.csus.edu/~sharifs
**********************************************************
____________________________________________________________________________________
It's here! Your new message!
Get new email alerts with the free Yahoo! Toolbar.
http://tools.search.yahoo.com/toolbar/features/mail/
---------------------------------------------------------------------
To unsubscribe from this list please visit:
http://xircles.codehaus.org/manage_email
---------------------------------------------------------------------
To unsubscribe from this list please visit:
http://xircles.codehaus.org/manage_email