You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@xmlbeans.apache.org by Radu Preotiuc-Pietro <ra...@bea.com> on 2008/03/14 00:54:10 UTC

Re: XMLError - Navigating CursorLocation to element when attribute missing

I haven't gotten the chance to reproduce this, but it looks very much
like an XMLBeans bug. If the cursor is not positioned in the right
place, I don't think that you, as the caller can do anything to position
it right. But you could look at the XMLBeans validation code and see why
is it not positioning the cursor properly...

Radu

On Tue, 2008-03-11 at 14:48 -0400, Costello, Robert wrote:
> I’m having trouble finding a way to navigate to a certain element when
> the error pertains to a missing attribute:
> 
>  
> 
> Something and somethingElse are attributes of nextElement.  The
> attribute ‘somethingElse’ has a restriction that it is required.  
> 
> When somethingElse is not populated, the XmlValidationError object
> cursor is pointed to the topElement.  
> 
>  
> 
> <topElement xmlns="top">
> 
> <nextElement row=”1” something=”foo” somethingElse=”bar”/>
> 
> <nextElement row=”2” something=”foo” />
> 
> <nextElement row=”3” something=”foo” somethingElse=”bar”/>
> 
> </ topElement >
> 
>  
> 
> For errors without required restrictions, I can use 
> 
>  
> 
> error.getCursorLocation().getDomNode().getAttributes().getNamedItem("row").getNodeValue();
> 
>  
> 
> but when an error occurs at the Parent level, I cannot find a way to
> know which row the error occurred in.  
> 
>  
> 
> getFirstChild brings me to the first ‘nextElement’  getLastChild
> brings me to the last ‘nextElement’.  How do I know which
> ‘nextElement’ had the error?
> 
>  
> 
> Can anyone point me in the right direction for this?
> 
>  
> 
> Thanks,
> 
>  
> 
> Robert Costello
> 
>  
> 
>  
> 
> 

Notice:  This email message, together with any attachments, may contain information  of  BEA Systems,  Inc.,  its subsidiaries  and  affiliated entities,  that may be confidential,  proprietary,  copyrighted  and/or legally privileged, and is intended solely for the use of the individual or entity named in this message. If you are not the intended recipient, and have received this message in error, please immediately return this by email and then delete it.

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@xmlbeans.apache.org
For additional commands, e-mail: user-help@xmlbeans.apache.org