On Wednesday, December 18, 2002, at 01:20  PM, Ethan Cerami wrote:
This is not actually what I want. I basically want to be able to take a
Castor generated object, and determine its specific location within the XML
file.

For example, suppose I have an XML document with 5 elements, named Protein.
I get 5 Protein objects from Castor. But, suppose the third one has a
database error in it (not an XML validation error) -- I want to be able to
query this object to determine its specific location in the file.
I see. That is an interesting problem. I am pretty sure you can't do this with castor as-is. Off the top of my head, the only way to do it would be to use a custom XML parser that would interact with castor's unmarshaller to create a registry of objects and the files/locations they came from. I am pretty sure that just plain SAX will not expose that level of detail.

But maybe someone else knows better.

Rhett
=====================================================
| Rhett Sutphin
| Research Assistant (Software)
| Coordinated Laboratory for Computational Genomics
| and the Center for Macular Degeneration
| University of Iowa - Iowa City, IA 52242 - USA
| 4111 MEBRF - email: [EMAIL PROTECTED]
=====================================================


----- Original Message -----
From: "Rhett Sutphin" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Wednesday, December 18, 2002 2:12 PM
Subject: Re: [castor-dev] File Location of Castor Generated Objects


Hi,

On Wednesday, December 18, 2002, at 11:48  AM, Ethan Cerami wrote:
First, it goes through regular XML Validation.
Second, we go though the objects created by castor, and perform
additional validation checks.  For example, we check that IDs
specified in the XML file are not already in the database.

If we find an error in the second validation phase, we would like to
display the error, along with the location of the error.  But, the
Castor generated objects do not contain information such as line
number, column number, etc.

Is there any way to determine the location of these objects?
I'm not sure if this is what you are asking, but if the problem is that
the files/line numbers don't show up in an exception's stack trace (for
instance) you need to make sure that the objects are being compiled
with debugging info. For instance, in javac, you need to make sure
that you are using the -g option (and not setting it to "none").

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

Reply via email to