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 ajay bhadauria <ab...@yahoo.com> on 2009/09/12 12:51:43 UTC

Missing PSVI after Validation.

Hi all,

I am trying to get PSVI info after JAXP validation of xml instance with schema but I am not getting PSVI info. It looks like I am missing very basic thing.

I provided DOMSource and DOMResult to the JAXP validator (validate(DOMSource,DOMResult). Both these sources are created from the DocumentBuilderFactory which has attribute(org.apache.xerces.dom.PSVIDocumentImpl") .

Please find the attached file if someone can pinpoint what I am missing that will great help for me.

Thanks
Ab


      

Re: Missing PSVI after Validation.

Posted by ajay bhadauria <ab...@yahoo.com>.
Hi Dick,

Thanks a lot for prompt response and support. I saw Michael response.

Regards
Ajay 

--- On Mon, 9/14/09, Dick Deneer <di...@donkeydevelopment.com> wrote:

> From: Dick Deneer <di...@donkeydevelopment.com>
> Subject: Re: Missing PSVI after Validation.
> To: j-users@xerces.apache.org
> Date: Monday, September 14, 2009, 12:05 PM
> Ajay,
> 
> You can also see here http://www.nabble.com/Missing-PSVI-after-Validation.-to25413412.html
> to see the thread.
> 
> Regards
> Dick
> Op 14-sep-2009, om 2:38 heeft ajay bhadauria het volgende
> geschreven:
> 
> > Hi Dick,
> > 
> > Thanks for your response. Due to some reason, I am not
> getting mail from Michael Glavassevich. I do not know why ?
> Could you please forward mail to me which Michael
> responded.
> > 
> > Regards
> > Ajay
> > --- On Mon, 9/14/09, Dick Deneer <di...@donkeydevelopment.com>
> wrote:
> > 
> >> From: Dick Deneer <di...@donkeydevelopment.com>
> >> Subject: Re: Missing PSVI after Validation.
> >> To: j-users@xerces.apache.org
> >> Date: Monday, September 14, 2009, 2:43 AM
> >> 
> >> Ajay,
> >> I saw the response from Michael Glavassevich
> >>  to your problem. As usual he pointed to the
> real problem.
> >> Forget the validationHandler and see the mail
> from
> >> Michael.
> >> regards,Dick
> >> Op 13-sep-2009, om 22:36 heeft ajay bhadauria het
> >> volgende geschreven:
> >> Hi
> >> Dick,
> >> Thanks
> >> a lot for response. Thanks also for given example
> to get the
> >> PSVI from dbf.
> >> I
> >> need to use Validator so in the attached file, I
> created
> >> validator object obtained from schema object.
> Could you
> >> please guide me how should I create seperate
> validator
> >> object ?. I am not aware of validationHandler
> class. Could
> >> you please also tell me how I can do that ?
> >> RegardsAjay
> >> ---
> >> On Sun, 9/13/09, Dick Deneer <di...@donkeydevelopment.com>
> >> wrote:
> >>  From:
> >> Dick Deneer <di...@donkeydevelopment.com>Subject:
> >> Re: Missing PSVI after Validation.To:
> >> j-users@xerces.apache.orgDate:
> >> Sunday, September 13, 2009, 4:25 PMWithout
> >> a  separate validator youcan
> >> just use:       
> DocumentBuilderFactory
> >> dbf=
> >>
> DocumentBuilderFactory.newInstance();   
>    
> dbf.setNamespaceAware(true);   
>    
> dbf.setValidating(true);   
>     dbf.setAttribute("http://apache.org/xml/features/validation/schema",   
>            
> Boolean.TRUE);       
> dbf.setAttribute(       
>         "http://apache.org/xml/properties/dom/document-class-name",   
>            
> "org.apache.xerces.dom.PSVIDocumentImpl");   
>     DocumentBuilder
> >> docBuilder=
> >> dbf.newDocumentBuilder();   
>     Document doc
> =docBuilder.parse("data/personal.xml");   
>     Element documentElement
> >> =doc.getDocumentElement();   
>    
> if(documentElement.isSupported("psvi","1.0"))   
>     {       
>     ElementPSVI psviElem
> >> =(ElementPSVI)
> >> doc.getDocumentElement();   
>         XSModel model
> =psviElem.getSchemaInformation();   
>         XSElementDeclaration
> decl
> >>
> =psviElem.getElementDeclaration();   
>        
> System.out.println(decl.getName());   
>     }Without
> >> aseparate
> >> JAXP validator I am not sure, but I think you
> haveto
> >> use a validitionHandler,
> >> RegardsDickDeneerOp
> >> 13-sep-2009, om 12:03heeft
> >> ajay bhadauria het volgende
> geschreven:Hiall,Cananyone
> >> point out in the attached file what I am
> missingbecause
> >> of which I am not getting PSVI info.
> aftervalidation
> >> ?Thanks AB.---On
> >> Sat, 9/12/09, ajay bhadauria <ab...@yahoo.com>wrote:
> From:ajay
> >> bhadauria <ab...@yahoo.com>Subject:Missing
> >> PSVI after Validation.To:j-users@xerces.apache.orgDate:Saturday,
> >> September 12, 2009, 4:21 PMHiall,Iam
> >> trying to get PSVI info after JAXP validation
> ofxmlinstancewith
> >> schema but I am not getting PSVI info.
> Itlookslike
> >> I am missing very basic thing.Iprovided
> >> DOMSource and DOMResult to the
> JAXPvalidator(validate(DOMSource,DOMResult).Both
> >> these sources arecreatedfrom
> >> the DocumentBuilderFactory which
> >>
> hasattribute(org.apache.xerces.dom.PSVIDocumentImpl").Pleasefind
> >> the attached file if someone can pinpointwhatIam
> >> missing that will great help for me.ThanksAb
> >> 
> >>
> ---------------------------------------------------------------------Tounsubscribe,
> >> e-mail: j-users-unsubscribe@xerces.apache.orgForadditional
> >> commands, e-mail: j-users-help@xerces.apache.org
> >> 
> >> 
> >> 
> >>
> ---------------------------------------------------------------------Tounsubscribe,
> >> e-mail: j-users-unsubscribe@xerces.apache.orgForadditional
> >> commands, e-mail: j-users-help@xerces.apache.org
> >> 
> >> 
> >> 
> >> 
> >> 
> >>
> ---------------------------------------------------------------------To
> >> unsubscribe, e-mail: j-users-unsubscribe@xerces.apache.orgFor
> >> additional commands, e-mail: j-users-help@xerces.apache.org
> >> 
> >> 
> > 
> > 
> > 
> > 
> >
> ---------------------------------------------------------------------
> > To unsubscribe, e-mail: j-users-unsubscribe@xerces.apache.org
> > For additional commands, e-mail: j-users-help@xerces.apache.org
> > 
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: j-users-unsubscribe@xerces.apache.org
> For additional commands, e-mail: j-users-help@xerces.apache.org
> 
> 


      

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


Re: Missing PSVI after Validation.

Posted by Dick Deneer <di...@donkeydevelopment.com>.
Ajay,

You can also see here http://www.nabble.com/Missing-PSVI-after- 
Validation.-to25413412.html to see the thread.

Regards
Dick
Op 14-sep-2009, om 2:38 heeft ajay bhadauria het volgende geschreven:

> Hi Dick,
>
> Thanks for your response. Due to some reason, I am not getting mail  
> from Michael Glavassevich. I do not know why ? Could you please  
> forward mail to me which Michael responded.
>
> Regards
> Ajay
> --- On Mon, 9/14/09, Dick Deneer  
> <di...@donkeydevelopment.com> wrote:
>
>> From: Dick Deneer <di...@donkeydevelopment.com>
>> Subject: Re: Missing PSVI after Validation.
>> To: j-users@xerces.apache.org
>> Date: Monday, September 14, 2009, 2:43 AM
>>
>> Ajay,
>> I saw the response from Michael Glavassevich
>>  to your problem. As usual he pointed to the real problem.
>> Forget the validationHandler and see the mail from
>> Michael.
>> regards,Dick
>> Op 13-sep-2009, om 22:36 heeft ajay bhadauria het
>> volgende geschreven:
>> Hi
>> Dick,
>> Thanks
>> a lot for response. Thanks also for given example to get the
>> PSVI from dbf.
>> I
>> need to use Validator so in the attached file, I created
>> validator object obtained from schema object. Could you
>> please guide me how should I create seperate validator
>> object ?. I am not aware of validationHandler class. Could
>> you please also tell me how I can do that ?
>> RegardsAjay
>> ---
>> On Sun, 9/13/09, Dick Deneer <di...@donkeydevelopment.com>
>> wrote:
>>  From:
>> Dick Deneer <di...@donkeydevelopment.com>Subject:
>> Re: Missing PSVI after Validation.To:
>> j-users@xerces.apache.orgDate:
>> Sunday, September 13, 2009, 4:25 PMWithout
>> a  separate validator youcan
>> just use:		DocumentBuilderFactory
>> dbf=
>> DocumentBuilderFactory.newInstance();		dbf.setNamespaceAware 
>> (true);		dbf.setValidating(true);		dbf.setAttribute("http:// 
>> apache.org/xml/features/validation/schema",				Boolean.TRUE);		 
>> dbf.setAttribute(				"http://apache.org/xml/properties/dom/ 
>> document-class- 
>> name",				"org.apache.xerces.dom.PSVIDocumentImpl");		DocumentBuilder
>> docBuilder=
>> dbf.newDocumentBuilder();		Document doc =docBuilder.parse("data/ 
>> personal.xml");		Element documentElement
>> =doc.getDocumentElement();		if(documentElement.isSupported 
>> ("psvi","1.0"))		{			ElementPSVI psviElem
>> =(ElementPSVI)
>> doc.getDocumentElement();			XSModel model  
>> =psviElem.getSchemaInformation();			XSElementDeclaration decl
>> =psviElem.getElementDeclaration();			System.out.println 
>> (decl.getName());		}Without
>> aseparate
>> JAXP validator I am not sure, but I think you haveto
>> use a validitionHandler,
>> RegardsDickDeneerOp
>> 13-sep-2009, om 12:03heeft
>> ajay bhadauria het volgende geschreven:Hiall,Cananyone
>> point out in the attached file what I am missingbecause
>> of which I am not getting PSVI info. aftervalidation
>> ?Thanks AB.---On
>> Sat, 9/12/09, ajay bhadauria <ab...@yahoo.com>wrote: From:ajay
>> bhadauria <ab...@yahoo.com>Subject:Missing
>> PSVI after Validation.To:j-users@xerces.apache.orgDate:Saturday,
>> September 12, 2009, 4:21 PMHiall,Iam
>> trying to get PSVI info after JAXP validation ofxmlinstancewith
>> schema but I am not getting PSVI info. Itlookslike
>> I am missing very basic thing.Iprovided
>> DOMSource and DOMResult to the JAXPvalidator(validate 
>> (DOMSource,DOMResult).Both
>> these sources arecreatedfrom
>> the DocumentBuilderFactory which
>> hasattribute(org.apache.xerces.dom.PSVIDocumentImpl").Pleasefind
>> the attached file if someone can pinpointwhatIam
>> missing that will great help for me.ThanksAb
>>
>> --------------------------------------------------------------------- 
>> Tounsubscribe,
>> e-mail: j-users-unsubscribe@xerces.apache.orgForadditional
>> commands, e-mail: j-users-help@xerces.apache.org
>>
>>
>>
>> --------------------------------------------------------------------- 
>> Tounsubscribe,
>> e-mail: j-users-unsubscribe@xerces.apache.orgForadditional
>> commands, e-mail: j-users-help@xerces.apache.org
>>
>>
>>
>>
>>
>> --------------------------------------------------------------------- 
>> To
>> unsubscribe, e-mail: j-users-unsubscribe@xerces.apache.orgFor
>> additional commands, e-mail: j-users-help@xerces.apache.org
>>
>>
>
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: j-users-unsubscribe@xerces.apache.org
> For additional commands, e-mail: j-users-help@xerces.apache.org
>


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


Re: Missing PSVI after Validation.

Posted by ajay bhadauria <ab...@yahoo.com>.
Hi Dick,

Thanks for your response. Due to some reason, I am not getting mail from Michael Glavassevich. I do not know why ? Could you please forward mail to me which Michael responded.

Regards
Ajay
--- On Mon, 9/14/09, Dick Deneer <di...@donkeydevelopment.com> wrote:

> From: Dick Deneer <di...@donkeydevelopment.com>
> Subject: Re: Missing PSVI after Validation.
> To: j-users@xerces.apache.org
> Date: Monday, September 14, 2009, 2:43 AM
> 
> Ajay,
> I saw the response from Michael Glavassevich
>  to your problem. As usual he pointed to the real problem.
> Forget the validationHandler and see the mail from
> Michael.
> regards,Dick
> Op 13-sep-2009, om 22:36 heeft ajay bhadauria het
> volgende geschreven:
> Hi
> Dick,
> Thanks
> a lot for response. Thanks also for given example to get the
> PSVI from dbf.
> I
> need to use Validator so in the attached file, I created
> validator object obtained from schema object. Could you
> please guide me how should I create seperate validator
> object ?. I am not aware of validationHandler class. Could
> you please also tell me how I can do that ?
> RegardsAjay 
> ---
> On Sun, 9/13/09, Dick Deneer <di...@donkeydevelopment.com>
> wrote:
>  From:
> Dick Deneer <di...@donkeydevelopment.com>Subject:
> Re: Missing PSVI after Validation.To:
> j-users@xerces.apache.orgDate:
> Sunday, September 13, 2009, 4:25 PMWithout
> a  separate validator youcan
> just use:		DocumentBuilderFactory
> dbf=
> DocumentBuilderFactory.newInstance();		dbf.setNamespaceAware(true);		dbf.setValidating(true);		dbf.setAttribute("http://apache.org/xml/features/validation/schema",				Boolean.TRUE);		dbf.setAttribute(				"http://apache.org/xml/properties/dom/document-class-name",				"org.apache.xerces.dom.PSVIDocumentImpl");		DocumentBuilder
> docBuilder=
> dbf.newDocumentBuilder();		Document doc =docBuilder.parse("data/personal.xml");		Element documentElement
> =doc.getDocumentElement();		if(documentElement.isSupported("psvi","1.0"))		{			ElementPSVI psviElem
> =(ElementPSVI)
> doc.getDocumentElement();			XSModel model =psviElem.getSchemaInformation();			XSElementDeclaration decl
> =psviElem.getElementDeclaration();			System.out.println(decl.getName());		}Without
> aseparate
> JAXP validator I am not sure, but I think you haveto
> use a validitionHandler,
> RegardsDickDeneerOp
> 13-sep-2009, om 12:03heeft
> ajay bhadauria het volgende geschreven:Hiall,Cananyone
> point out in the attached file what I am missingbecause
> of which I am not getting PSVI info. aftervalidation
> ?Thanks AB.---On
> Sat, 9/12/09, ajay bhadauria <ab...@yahoo.com>wrote: From:ajay
> bhadauria <ab...@yahoo.com>Subject:Missing
> PSVI after Validation.To:j-users@xerces.apache.orgDate:Saturday,
> September 12, 2009, 4:21 PMHiall,Iam
> trying to get PSVI info after JAXP validation ofxmlinstancewith
> schema but I am not getting PSVI info. Itlookslike
> I am missing very basic thing.Iprovided
> DOMSource and DOMResult to the JAXPvalidator(validate(DOMSource,DOMResult).Both
> these sources arecreatedfrom
> the DocumentBuilderFactory which
> hasattribute(org.apache.xerces.dom.PSVIDocumentImpl").Pleasefind
> the attached file if someone can pinpointwhatIam
> missing that will great help for me.ThanksAb
> 
> ---------------------------------------------------------------------Tounsubscribe,
> e-mail: j-users-unsubscribe@xerces.apache.orgForadditional
> commands, e-mail: j-users-help@xerces.apache.org
> 
> 
> 
> ---------------------------------------------------------------------Tounsubscribe,
> e-mail: j-users-unsubscribe@xerces.apache.orgForadditional
> commands, e-mail: j-users-help@xerces.apache.org
> 
>  
> 
> 
> 
> ---------------------------------------------------------------------To
> unsubscribe, e-mail: j-users-unsubscribe@xerces.apache.orgFor
> additional commands, e-mail: j-users-help@xerces.apache.org
>  
> 


      

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


Re: Missing PSVI after Validation.

Posted by Dick Deneer <di...@donkeydevelopment.com>.
Ajay,

I saw the response from Michael Glavassevich  to your problem. As  
usual he pointed to the real problem. Forget the validationHandler  
and see the mail from Michael.

regards,
Dick
Op 13-sep-2009, om 22:36 heeft ajay bhadauria het volgende geschreven:

> Hi Dick,
>
> Thanks a lot for response. Thanks also for given example to get the  
> PSVI from dbf.
>
> I need to use Validator so in the attached file, I created  
> validator object obtained from schema object. Could you please  
> guide me how should I create seperate validator object ?. I am not  
> aware of validationHandler class. Could you please also tell me how  
> I can do that ?
>
> Regards
> Ajay
>
> --- On Sun, 9/13/09, Dick Deneer  
> <di...@donkeydevelopment.com> wrote:
>
>> From: Dick Deneer <di...@donkeydevelopment.com>
>> Subject: Re: Missing PSVI after Validation.
>> To: j-users@xerces.apache.org
>> Date: Sunday, September 13, 2009, 4:25 PM
>> Without a  separate validator you
>> can just use:
>> 		DocumentBuilderFactory dbf
>> = DocumentBuilderFactory.newInstance();
>> 		dbf.setNamespaceAware(true);		dbf.setValidating(true);		 
>> dbf.setAttribute("http://apache.org/xml/features/validation/ 
>> schema",				Boolean.TRUE);
>> 		dbf.setAttribute(				"http://apache.org/xml/properties/dom/ 
>> document-class-name",				"org.apache.xerces.dom.PSVIDocumentImpl");
>> 		DocumentBuilder docBuilder
>> = dbf.newDocumentBuilder();		Document doc =
>> docBuilder.parse("data/personal.xml");		Element documentElement =
>> doc.getDocumentElement();		if
>> (documentElement.isSupported("psvi",
>> "1.0"))		{			ElementPSVI psviElem =
>> (ElementPSVI) doc.getDocumentElement();			XSModel model =
>> psviElem.getSchemaInformation();			XSElementDeclaration decl =
>> psviElem.getElementDeclaration();			System.out.println(decl.getName 
>> ());		}
>> Without a
>> separate JAXP validator I am not sure, but I think you have
>> to use a validitionHandler,
>>
>> RegardsDick
>> Deneer
>> Op 13-sep-2009, om 12:03
>> heeft ajay bhadauria het volgende geschreven:
>> Hi
>> all,
>> Can
>> anyone point out in the attached file what I am missing
>> because of which I am not getting PSVI info. after
>> validation ?
>> Thanks
>>  AB.
>> ---
>> On Sat, 9/12/09, ajay bhadauria <ab...@yahoo.com>
>> wrote:
>>  From:
>> ajay bhadauria <ab...@yahoo.com>Subject:
>> Missing PSVI after Validation.To:
>> j-users@xerces.apache.orgDate:
>> Saturday, September 12, 2009, 4:21 PMHi
>> all,
>> I
>> am trying to get PSVI info after JAXP validation of
>> xmlinstance
>> with schema but I am not getting PSVI info. Itlooks
>> like I am missing very basic thing.
>> I
>> provided DOMSource and DOMResult to the JAXP
>> validator(validate(DOMSource,DOMResult).
>> Both these sources arecreated
>> from the DocumentBuilderFactory which hasattribute 
>> (org.apache.xerces.dom.PSVIDocumentImpl")
>> .
>> Please
>> find the attached file if someone can pinpoint
>> whatI
>> am missing that will great help for me.
>> ThanksAb
>>
>>
>> --------------------------------------------------------------------- 
>> To
>> unsubscribe, e-mail: j-users-unsubscribe@xerces.apache.orgFor
>> additional commands, e-mail: j-users-help@xerces.apache.org
>>
>>
>>
>>
>> --------------------------------------------------------------------- 
>> To
>> unsubscribe, e-mail: j-users-unsubscribe@xerces.apache.orgFor
>> additional commands, e-mail: j-users-help@xerces.apache.org
>>
>>
>
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: j-users-unsubscribe@xerces.apache.org
> For additional commands, e-mail: j-users-help@xerces.apache.org
>


Re: Missing PSVI after Validation.

Posted by ajay bhadauria <ab...@yahoo.com>.
Hi Dick,

Thanks a lot for response. Thanks also for given example to get the PSVI from dbf.

I need to use Validator so in the attached file, I created validator object obtained from schema object. Could you please guide me how should I create seperate validator object ?. I am not aware of validationHandler class. Could you please also tell me how I can do that ?

Regards
Ajay 

--- On Sun, 9/13/09, Dick Deneer <di...@donkeydevelopment.com> wrote:

> From: Dick Deneer <di...@donkeydevelopment.com>
> Subject: Re: Missing PSVI after Validation.
> To: j-users@xerces.apache.org
> Date: Sunday, September 13, 2009, 4:25 PM
> Without a  separate validator you
> can just use:
> 		DocumentBuilderFactory dbf
> = DocumentBuilderFactory.newInstance();
> 		dbf.setNamespaceAware(true);		dbf.setValidating(true);		dbf.setAttribute("http://apache.org/xml/features/validation/schema",				Boolean.TRUE);
> 		dbf.setAttribute(				"http://apache.org/xml/properties/dom/document-class-name",				"org.apache.xerces.dom.PSVIDocumentImpl");
> 		DocumentBuilder docBuilder
> = dbf.newDocumentBuilder();		Document doc =
> docBuilder.parse("data/personal.xml");		Element documentElement =
> doc.getDocumentElement();		if
> (documentElement.isSupported("psvi",
> "1.0"))		{			ElementPSVI psviElem =
> (ElementPSVI) doc.getDocumentElement();			XSModel model =
> psviElem.getSchemaInformation();			XSElementDeclaration decl =
> psviElem.getElementDeclaration();			System.out.println(decl.getName());		}
> Without a
> separate JAXP validator I am not sure, but I think you have
> to use a validitionHandler,
> 
> RegardsDick
> Deneer
> Op 13-sep-2009, om 12:03
> heeft ajay bhadauria het volgende geschreven:
> Hi
> all,
> Can
> anyone point out in the attached file what I am missing
> because of which I am not getting PSVI info. after
> validation ?
> Thanks
>  AB.
> ---
> On Sat, 9/12/09, ajay bhadauria <ab...@yahoo.com>
> wrote:
>  From:
> ajay bhadauria <ab...@yahoo.com>Subject:
> Missing PSVI after Validation.To:
> j-users@xerces.apache.orgDate:
> Saturday, September 12, 2009, 4:21 PMHi
> all,
> I
> am trying to get PSVI info after JAXP validation of
> xmlinstance
> with schema but I am not getting PSVI info. Itlooks
> like I am missing very basic thing.
> I
> provided DOMSource and DOMResult to the JAXP
> validator(validate(DOMSource,DOMResult).
> Both these sources arecreated
> from the DocumentBuilderFactory which hasattribute(org.apache.xerces.dom.PSVIDocumentImpl")
> .
> Please
> find the attached file if someone can pinpoint
> whatI
> am missing that will great help for me.
> ThanksAb
> 
> 
> ---------------------------------------------------------------------To
> unsubscribe, e-mail: j-users-unsubscribe@xerces.apache.orgFor
> additional commands, e-mail: j-users-help@xerces.apache.org
> 
> 
> 
> 
> ---------------------------------------------------------------------To
> unsubscribe, e-mail: j-users-unsubscribe@xerces.apache.orgFor
> additional commands, e-mail: j-users-help@xerces.apache.org
>  
> 


      

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


Re: Missing PSVI after Validation.

Posted by Dick Deneer <di...@donkeydevelopment.com>.
Without a  separate validator you can just use:

		DocumentBuilderFactory dbf = DocumentBuilderFactory.newInstance();

		dbf.setNamespaceAware(true);
		dbf.setValidating(true);
		dbf.setAttribute("http://apache.org/xml/features/validation/schema",
				Boolean.TRUE);

		dbf.setAttribute(
				"http://apache.org/xml/properties/dom/document-class-name",
				"org.apache.xerces.dom.PSVIDocumentImpl");

		DocumentBuilder docBuilder = dbf.newDocumentBuilder();
		Document doc = docBuilder.parse("data/personal.xml");
		Element documentElement = doc.getDocumentElement();
		if (documentElement.isSupported("psvi", "1.0"))
		{
			ElementPSVI psviElem = (ElementPSVI) doc.getDocumentElement();
			XSModel model = psviElem.getSchemaInformation();
			XSElementDeclaration decl = psviElem.getElementDeclaration();
			System.out.println(decl.getName());
		}

Without a separate JAXP validator I am not sure, but I think you have  
to use a validitionHandler,


Regards
Dick Deneer

Op 13-sep-2009, om 12:03 heeft ajay bhadauria het volgende geschreven:

> Hi all,
>
> Can anyone point out in the attached file what I am missing because  
> of which I am not getting PSVI info. after validation ?
>
> Thanks
> AB.
>
> --- On Sat, 9/12/09, ajay bhadauria <ab...@yahoo.com> wrote:
>
>> From: ajay bhadauria <ab...@yahoo.com>
>> Subject: Missing PSVI after Validation.
>> To: j-users@xerces.apache.org
>> Date: Saturday, September 12, 2009, 4:21 PM
>> Hi all,
>>
>> I am trying to get PSVI info after JAXP validation of xml
>> instance with schema but I am not getting PSVI info. It
>> looks like I am missing very basic thing.
>>
>> I provided DOMSource and DOMResult to the JAXP validator
>> (validate(DOMSource,DOMResult). Both these sources are
>> created from the DocumentBuilderFactory which has
>> attribute(org.apache.xerces.dom.PSVIDocumentImpl") .
>>
>> Please find the attached file if someone can pinpoint what
>> I am missing that will great help for me.
>>
>> Thanks
>> Ab
>>
>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: j-users-unsubscribe@xerces.apache.org
>> For additional commands, e-mail: j-users-help@xerces.apache.org
>
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: j-users-unsubscribe@xerces.apache.org
> For additional commands, e-mail: j-users-help@xerces.apache.org
>


Re: Missing PSVI after Validation.

Posted by Michael Glavassevich <mr...@ca.ibm.com>.
Ajay,

You're creating two Documents, the 2nd of which isn't PSVI aware. Get rid
of the 2nd one (i.e. the one you create with DocumentBuilder.newDocument())
and make the 1st one both the DOMSource and DOMResult:

document = dBuilder.parse(new FileInputStream(xmlFile));
...
DOMSource source = new DOMSource(document);
DOMResult result = new DOMResult(document);
...
validator.validate(source,result);
...

This will augment the DOM with PSVI and also perform better since it
doesn't require that nodes be copied to the result since the source and
result DOMs are the same instances. You could have also set the Schema
object on the DocumentBuilderFactory instead of doing this separate
validate step after parsing.

Thanks.

Michael Glavassevich
XML Parser Development
IBM Toronto Lab
E-mail: mrglavas@ca.ibm.com
E-mail: mrglavas@apache.org

ajay bhadauria <ab...@yahoo.com> wrote on 09/13/2009 06:03:03 AM:

> Hi all,
>
> Can anyone point out in the attached file what I am missing because
> of which I am not getting PSVI info. after validation ?
>
> Thanks
> AB.
>
> --- On Sat, 9/12/09, ajay bhadauria <ab...@yahoo.com> wrote:
>
> > From: ajay bhadauria <ab...@yahoo.com>
> > Subject: Missing PSVI after Validation.
> > To: j-users@xerces.apache.org
> > Date: Saturday, September 12, 2009, 4:21 PM
> > Hi all,
> >
> > I am trying to get PSVI info after JAXP validation of xml
> > instance with schema but I am not getting PSVI info. It
> > looks like I am missing very basic thing.
> >
> > I provided DOMSource and DOMResult to the JAXP validator
> > (validate(DOMSource,DOMResult). Both these sources are
> > created from the DocumentBuilderFactory which has
> > attribute(org.apache.xerces.dom.PSVIDocumentImpl") .
> >
> > Please find the attached file if someone can pinpoint what
> > I am missing that will great help for me.
> >
> > Thanks
> > Ab
> >
> >
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: j-users-unsubscribe@xerces.apache.org
> > For additional commands, e-mail: j-users-help@xerces.apache.org
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: j-users-unsubscribe@xerces.apache.org
> For additional commands, e-mail: j-users-help@xerces.apache.org

Re: Missing PSVI after Validation.

Posted by ajay bhadauria <ab...@yahoo.com>.
Hi all,

Can anyone point out in the attached file what I am missing because of which I am not getting PSVI info. after validation ?

Thanks  
AB.

--- On Sat, 9/12/09, ajay bhadauria <ab...@yahoo.com> wrote:

> From: ajay bhadauria <ab...@yahoo.com>
> Subject: Missing PSVI after Validation.
> To: j-users@xerces.apache.org
> Date: Saturday, September 12, 2009, 4:21 PM
> Hi all,
> 
> I am trying to get PSVI info after JAXP validation of xml
> instance with schema but I am not getting PSVI info. It
> looks like I am missing very basic thing.
> 
> I provided DOMSource and DOMResult to the JAXP validator
> (validate(DOMSource,DOMResult). Both these sources are
> created from the DocumentBuilderFactory which has
> attribute(org.apache.xerces.dom.PSVIDocumentImpl") .
> 
> Please find the attached file if someone can pinpoint what
> I am missing that will great help for me.
> 
> Thanks
> Ab
> 
> 
>       
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: j-users-unsubscribe@xerces.apache.org
> For additional commands, e-mail: j-users-help@xerces.apache.org


      

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