Hi,

Reply inline.

On Friday, June 13, 2003, at 02:22 PM, Gregory Fox wrote:
I am fairly new to Castor XML and I am having trouble
with the Reference/Identity.  I have predefined
Classes that I am trying to store to XML.  The only
obvious unique value that I have in these Classes for
use as an identity is the "name" field.  This works
great except when the name has embedded spaces such as
"My Object Name".  In this case, the object reference
is not resolved when reading the XML back in.  It is
written out to the XML file, but I notice that the
output file uses spaces as separators.

For example if my objects names are as follows:
   Name1
   Second Name
   Name3

The collection output using these as identities for
references would appear as follows:

Name1 Second Name Name3

This is not a feature of Castor, but rather of XML itself. IDs in XML are not allowed to contain whitespace. This is because whitespace is used to delimit lists of IDs, as you have inadvertently discovered.


Some possibilities:
* Do some preprocessing to convert your space-bearing names into IDs. You could map the name twice so that you can recover the original spaces-and-all version on unmarshal.
* Use synthetic ids. Actually, I'm not sure if/how Castor XML supports this.


HTH,
Rhett

--
Rhett Sutphin
Research Assistant (Software)
Coordinated Laboratory for Computational Genomics
  and the Center for Macular Degeneration
University of Iowa - Iowa City - Iowa - 52246
mailto:[EMAIL PROTECTED]

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




Reply via email to