Hi,
Just create the attribute with an @Attribute annotation. For example
@Attribute(required=false)
private String schemaLocation;
In this way the attribute will match your annotated field and there will be no exception. Also, if you do not like this, you can implement a org.simpleframework.xml.core.Strategy to remove the "schemaLocation" attribute.
Niall
-----Original Message-----
From: Fabian Kürten [mailto:fab...@we...]
Sent: 31 March 2009 20:36
To: sim...@li...
Subject: [Simple-support] xsi:schemaLocation
Hi List,
I have an XML file, similiar to this snippet:
<root xmlns="http://www.domain.org/namespace"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://www.domain.org/namespace root.xsd">
When i try to deserialize it, I get the following exception:
org.simpleframework.xml.core.AttributeException: Attribute 'schemaLocation' does not exist at line -1
at org.simpleframework.xml.core.Composite.readAttribute(Composite.java:424)
[...]
Is there a way to ignore this?
Thanks, Fabian
------------------------------------------------------------------------------
_______________________________________________
Simple-support mailing list
Sim...@li...
https://lists.sourceforge.net/lists/listinfo/simple-support
Visit our website at http://www.ubs.com
This message contains confidential information and is intended only
for the individual named. If you are not the named addressee you
should not disseminate, distribute or copy this e-mail. Please
notify the sender immediately by e-mail if you have received this
e-mail by mistake and delete this e-mail from your system.
E-mails are not encrypted and cannot be guaranteed to be secure or
error-free as information could be intercepted, corrupted, lost,
destroyed, arrive late or incomplete, or contain viruses. The sender
therefore does not accept liability for any errors or omissions in the
contents of this message which arise as a result of e-mail transmission.
If verification is required please request a hard-copy version. This
message is provided for informational purposes and should not be
construed as a solicitation or offer to buy or sell any securities
or related financial instruments.
UBS Limited is a company registered in England & Wales under company
number 2035362, whose registered office is at 1 Finsbury Avenue,
London, EC2M 2PP, United Kingdom.
UBS AG (London Branch) is registered as a branch of a foreign company
under number BR004507, whose registered office is at
1 Finsbury Avenue, London, EC2M 2PP, United Kingdom.
UBS Clearing and Execution Services Limited is a company registered
in England & Wales under company number 03123037, whose registered
office is at 1 Finsbury Avenue, London, EC2M 2PP, United Kingdom.
|