I am using Castor 0.9.5 and am only interested in unmarshalling at the moment. I can correctly unmarshal an XML document that is not validated or has no namespace details.
However, moving on to validate and to handle namespaces, I run into difficulty. Sample of the XML below:


<?xml version="1.0" encoding="UTF-8"?>
<AccCard>
 <Header>
   <Filename>abc.xml</Filename>
   <UserID>fred_bloggs</UserID>
 </Header>
</AccCard>

Firstly assume the submitted document is not validated. How can I prompt Castor to validate it against, say, AccCard.xsd on my local filesystem.

Secondly how would I get Castor to handle the case where a user submits this document with namespace information e.g.

<?xml version="1.0" encoding="UTF-8"?>
<p:AccCard xmlns:p="urn:nmspace.co.uk" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"; xsi:schemaLocation="urn:nmspace.co.uk ChargeCard.xsd ">
<p:Header>
<p:Filename>abc.xml</p:Filename>
<p:UserID>fred_bloggs</p:UserID>
<p:/Header>
<p:/AccCard>


i.e. how do I handle (ignore) the xmlns attributes and p: namespace prefixes? My current mapping (which works fine without the p: prefix) doesn't handle this.

Any help is appreciated, thanks

Clive

_________________________________________________________________
Use MSN Messenger to send music and pics to your friends http://www.msn.co.uk/messenger


----------------------------------------------------------- If you wish to unsubscribe from this mailing, send mail to
[EMAIL PROTECTED] with a subject of:
unsubscribe castor-dev




Reply via email to