You are viewing a plain text version of this content. The canonical link for it is here.
Posted to j-users@xerces.apache.org by Tom Elrod <te...@e2technologies.net> on 2004/03/29 06:32:47 UTC

resolving namespace url

Hi.  Anyone know how to find the namespace url for the following element?

<foo>bar:Hello</foo>

Is this even valid?  Will Xerces treat the bar as the namespace?

Thanks.


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


Re: finding the error tag during schema validation

Posted by purushotham <pu...@yahoo.com>.
Hi,
 
 I don't think there is any API which you can call directly to get your thing done. But there is way to get it done if you want this to be done by all means. 
 
First you have to handle SAXParseException. Couple of API's in it will give you the line number and column position where parser sees violation.
 
You can develope custom class which handles the XML using java.io classes. You can easily extract the tag with the line & column obtained from above step.
 
But I feel all this is not worthful as you can easily decipher what/where the violation as occurred by looking to Exception message. 
 
In addition if you want to look more about the cause of the exception you can look into  url   http://www.w3.org/TR/xmlschema-1/#outcomes


Purushotham

Nithya <ni...@india.hp.com> wrote:
Hi

I am doing schema validation of an xml. I need to find out the specific
element tag or attribute which did not pass the schema validation.
Please could somebody give pointers for this.

thanks
nithya


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


---------------------------------
Do you Yahoo!?
Yahoo! Finance Tax Center - File online. File on time.

finding the error tag during schema validation

Posted by Nithya <ni...@india.hp.com>.
Hi

I am doing schema  validation of an xml. I need to find out the specific
element tag or attribute which did not pass the schema validation.
Please  could somebody give pointers for this.

thanks
nithya


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


Re: resolving namespace url

Posted by Jacob Kjome <ho...@visi.com>.
At 11:32 PM 3/28/2004 -0500, you wrote:
>Hi.  Anyone know how to find the namespace url for the following element?
>
><foo>bar:Hello</foo>
>
>Is this even valid?  Will Xerces treat the bar as the namespace?
>
>Thanks.

No, the parser sees a <foo> element with a text node of "bar:Hello".  Try 
<bar:foo>Hello</bar:foo>.  Of, if you've declared the default namespace on 
a parent element, <foo> would fall into that defined namespace.


Jake 


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