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 Huzefa Hakimi <ha...@yahoo.com> on 2003/11/07 00:08:44 UTC

Parsing XML Schema

Hello everybody,

Sorry if this has been covered in previous threads.

I am trying to gather information about all element
ans its type for XML Schema against which XML Document
is validated. I am using SAX parser to parse XML
documents as have to walk to large documents. Xerces
documentation says that you can use PSVI for this, but
was not getting how to proceed further having this
PSVIParser instance;  

import org.apache.xerces.impl.xs.psvi.PSVIProvider;
import javax.xml.parsers.SAXParser;
import javax.xml.parsers.SAXParserFactory;

...

SAXParserFactory factory =
SAXParserFactory.newInstance();
SAXParser parser = factory.newSAXParser();
PSVIProvider psviProvider = (PSVIProvider)parser;

In above where do we really point that which XML
document its going to parse. 


Can you please help in getting proceeded from this
step.

Thanks in advance

Huzefa

__________________________________
Do you Yahoo!?
Protect your identity with Yahoo! Mail AddressGuard
http://antispam.yahoo.com/whatsnewfree

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


Re: Parsing XML Schema

Posted by Bob Schloss <rs...@us.ibm.com>.



[I believe that much can be done with XSModel, although it was initially
designed mostly in support of PSVI types of information.

There is a non-Apache open source library which does provide somewhat
higher level functions to navigate relationships between schema infoset
components.  For info, see http://www.eclipse.org/xsd ].





                                                                                                                                
                      Huzefa Hakimi                                                                                             
                      <hakimi_dev@yahoo        To:       xerces-j-user@xml.apache.org                                           
                      .com>                    cc:                                                                              
                                               Subject:  Re: Parsing XML Schema                                                 
                      11/09/2003 08:21                                                                                          
                      PM                                                                                                        
                      Please respond to                                                                                         
                      xerces-j-user                                                                                             
                                                                                                                                




Things seems to be working after following the notes
given by Michael. Thanks

At present I am not able to figure out, If I get the
schemainformation() and obtain XSModel from
ElementPSVI, one can get
1. Elements, attributes, defined
2. Types of corresponding elements and attributes

But if one has also to capture the relationship
between the types, attributes and elements defined in
Schema, does at xsmodel defines a way for it i.e.
given an element one can find its descendands and
ancestors.

Thanks for the co-operation provided.

-Huzefa

--- Huzefa Hakimi <ha...@yahoo.com> wrote:
> Thanks Michael.
>
> It works that ways but as far as I can infer I am
> not using any other JAXP version other than provided
> by Xerces 2.5. And at present am using some of JAXP
> 1.1 methods to use functionality of SAX 2.0 and this
> is embedded within xerces 2.5. Than what can the
> problem be.
>
> Thank you once again.
> -Huzefa
>
> Michael Glavassevich <mr...@apache.org> wrote:
> Hi Huzefa,
>
> You seem to be trying to cast the JAXP [1] SAXParser
> to a PSVIProvider. If
> you're using JAXP, you need to retrieve the
> underlying XMLReader and cast
> this object to a PSVIProvider. To answer your other
> question. If you want
> to get PSVI information you need to keep a reference
> to a PSVIProvider
> (this is also the parser) so that it's accessible
> during the relevant
> callbacks.
>
> [1]
>
http://xml.apache.org/xerces2-j/javadocs/api/javax/xml/parsers/SAXParser.html

>
> On Sat, 8 Nov 2003, Huzefa Hakimi wrote:
>
> > Thanks.
> > I have some related to it problems
> >
> > 1.
> >
> > .....
> > SAXParser saxParser = factory.newSAXParser();
> > PSVIProvider psvi = (PSVIProvider)saxParser;
> > .....
> >
> > this code snipet gives me ClassCastException?
> >
> > At this moment how is it related to
> AbstractSaxParser provided by Xerces which
> implements PSVIProvider
> >
> > 2. All the SAXHandlers implemented callback
> methods reside in different class Handlers so do we
> have to pass around this instance of PSVIProvider to
> the handler class implementation to take action.
> Sorry am in dual state of mind.
>
> ---------------------------
> Michael Glavassevich
> XML Parser Development
> IBM Toronto Lab
> E-mail: mrglavas@ca.ibm.com
> E-mail: mrglavas@apache.org
>
>
---------------------------------------------------------------------
> 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!?
> Protect your identity with Yahoo! Mail AddressGuard


__________________________________
Do you Yahoo!?
Protect your identity with Yahoo! Mail AddressGuard
http://antispam.yahoo.com/whatsnewfree

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




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


Re: Parsing XML Schema

Posted by Huzefa Hakimi <ha...@yahoo.com>.
Things seems to be working after following the notes
given by Michael. Thanks

At present I am not able to figure out, If I get the
schemainformation() and obtain XSModel from
ElementPSVI, one can get 
1. Elements, attributes, defined
2. Types of corresponding elements and attributes 

But if one has also to capture the relationship
between the types, attributes and elements defined in
Schema, does at xsmodel defines a way for it i.e.
given an element one can find its descendands and
ancestors. 

Thanks for the co-operation provided.

-Huzefa

--- Huzefa Hakimi <ha...@yahoo.com> wrote:
> Thanks Michael.
>  
> It works that ways but as far as I can infer I am
> not using any other JAXP version other than provided
> by Xerces 2.5. And at present am using some of JAXP
> 1.1 methods to use functionality of SAX 2.0 and this
> is embedded within xerces 2.5. Than what can the
> problem be. 
>  
> Thank you once again.
> -Huzefa 
> 
> Michael Glavassevich <mr...@apache.org> wrote:
> Hi Huzefa,
> 
> You seem to be trying to cast the JAXP [1] SAXParser
> to a PSVIProvider. If
> you're using JAXP, you need to retrieve the
> underlying XMLReader and cast
> this object to a PSVIProvider. To answer your other
> question. If you want
> to get PSVI information you need to keep a reference
> to a PSVIProvider
> (this is also the parser) so that it's accessible
> during the relevant
> callbacks.
> 
> [1]
>
http://xml.apache.org/xerces2-j/javadocs/api/javax/xml/parsers/SAXParser.html
> 
> On Sat, 8 Nov 2003, Huzefa Hakimi wrote:
> 
> > Thanks.
> > I have some related to it problems
> >
> > 1.
> >
> > .....
> > SAXParser saxParser = factory.newSAXParser();
> > PSVIProvider psvi = (PSVIProvider)saxParser;
> > .....
> >
> > this code snipet gives me ClassCastException?
> >
> > At this moment how is it related to
> AbstractSaxParser provided by Xerces which
> implements PSVIProvider
> >
> > 2. All the SAXHandlers implemented callback
> methods reside in different class Handlers so do we
> have to pass around this instance of PSVIProvider to
> the handler class implementation to take action.
> Sorry am in dual state of mind.
> 
> ---------------------------
> Michael Glavassevich
> XML Parser Development
> IBM Toronto Lab
> E-mail: mrglavas@ca.ibm.com
> E-mail: mrglavas@apache.org
> 
>
---------------------------------------------------------------------
> 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!?
> Protect your identity with Yahoo! Mail AddressGuard


__________________________________
Do you Yahoo!?
Protect your identity with Yahoo! Mail AddressGuard
http://antispam.yahoo.com/whatsnewfree

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


Re: Parsing XML Schema

Posted by Huzefa Hakimi <ha...@yahoo.com>.
Thanks Michael.
 
It works that ways but as far as I can infer I am not using any other JAXP version other than provided by Xerces 2.5. And at present am using some of JAXP 1.1 methods to use functionality of SAX 2.0 and this is embedded within xerces 2.5. Than what can the problem be. 
 
Thank you once again.
-Huzefa 

Michael Glavassevich <mr...@apache.org> wrote:
Hi Huzefa,

You seem to be trying to cast the JAXP [1] SAXParser to a PSVIProvider. If
you're using JAXP, you need to retrieve the underlying XMLReader and cast
this object to a PSVIProvider. To answer your other question. If you want
to get PSVI information you need to keep a reference to a PSVIProvider
(this is also the parser) so that it's accessible during the relevant
callbacks.

[1]
http://xml.apache.org/xerces2-j/javadocs/api/javax/xml/parsers/SAXParser.html

On Sat, 8 Nov 2003, Huzefa Hakimi wrote:

> Thanks.
> I have some related to it problems
>
> 1.
>
> .....
> SAXParser saxParser = factory.newSAXParser();
> PSVIProvider psvi = (PSVIProvider)saxParser;
> .....
>
> this code snipet gives me ClassCastException?
>
> At this moment how is it related to AbstractSaxParser provided by Xerces which implements PSVIProvider
>
> 2. All the SAXHandlers implemented callback methods reside in different class Handlers so do we have to pass around this instance of PSVIProvider to the handler class implementation to take action. Sorry am in dual state of mind.

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

---------------------------------------------------------------------
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!?
Protect your identity with Yahoo! Mail AddressGuard

Re: Parsing XML Schema

Posted by Michael Glavassevich <mr...@apache.org>.
Hi Huzefa,

You seem to be trying to cast the JAXP [1] SAXParser to a PSVIProvider. If
you're using JAXP, you need to retrieve the underlying XMLReader and cast
this object to a PSVIProvider. To answer your other question. If you want
to get PSVI information you need to keep a reference to a PSVIProvider
(this is also the parser) so that it's accessible during the relevant
callbacks.

[1]
http://xml.apache.org/xerces2-j/javadocs/api/javax/xml/parsers/SAXParser.html

On Sat, 8 Nov 2003, Huzefa Hakimi wrote:

> Thanks.
> I have some related to it problems
>
> 1.
>
> .....
> SAXParser saxParser = factory.newSAXParser();
> PSVIProvider psvi = (PSVIProvider)saxParser;
> .....
>
> this code snipet gives me ClassCastException?
>
> At this moment how is it related to AbstractSaxParser provided by Xerces which implements PSVIProvider
>
> 2. All the SAXHandlers implemented callback methods reside in different class Handlers so do we have to pass around this instance of PSVIProvider to the handler class implementation to take action. Sorry am in dual state of mind.

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

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


Re: Parsing XML Schema

Posted by Huzefa Hakimi <ha...@yahoo.com>.
Thanks.
I have some related to it problems

1.

.....
SAXParser saxParser = factory.newSAXParser();    
PSVIProvider psvi = (PSVIProvider)saxParser;
.....

this code snipet gives me ClassCastException? 

At this moment how is it related to AbstractSaxParser provided by Xerces which implements PSVIProvider 

2. All the SAXHandlers implemented callback methods reside in different class Handlers so do we have to pass around this instance of PSVIProvider to the handler class implementation to take action. Sorry am in dual state of mind. 

 
Maksym Kovalenko <mk...@marketswitch.com> wrote:
You forgot that parser casted to PSVIProvider is still a parser, so you it for parsing first of all :-)

http://xml.apache.org/xerces2-j/faq-xs.html#faq-6
Here's excerpt
Within the scope of the methods handling the start and end of an element, i.e. org.xml.sax.ContentHandler.startElement (..), an application can use the PSVIProvider to retrieve the PSVI related to that element and its attributes.

You should use parser for parsing, and within content handler methods use parser casted to PSVIProvider to extract PSVI info (as xni faq #6 says)


Huzefa Hakimi wrote:

This faq page does not tell how to proceed further. Asin there it says that you get PSVIProvider instance(by casting SAXParser) but than how do tell after thatwhich is the document to be parsed. Lets for exampleprv. if one uses this code to parse the Documentvalidated against a schema: reader =XMLReaderFactory.createXMLReader(vendorClass);            // register content handler           reader.setContentHandler(contentHandler);            // register error handlerreader.setErrorHandler(errHandler);            // set the corresponding features of the SAX parserreader.setFeature("http://xml.org/sax/features/namespaces",true);           reader.setFeature("http://xml.org/sax/features/namespace-prefixes",true);                       reader.setFeature("http://xml.org/sax/features/validation",true);           reader.setFeature("http://apache.org/xml/features/validation/schema",true);// create input source from xml documentInputSource inputSource = new
 InputSource(xmlURI);reader.parse(inputSource);......Later for this code if one tries to retrieve SchemaInformation than would be using PSVI to get handler toXSModel. Right? So for this he would have somethingsimilar to: ....SAXParserFactory factory = neworg.apache.xerces.jaxp.SAXParserFactoryImpl();       factory.setFeature("http://xml.org/sax/features/namespaces",true);       factory.setFeature("http://xml.org/sax/features/namespace-prefixes",true);       factory.setFeature("http://xml.org/sax/features/validation",true);        factory.setFeature("http://apache.org/xml/features/validation/schema",true);        SAXParser parser = factory.newSAXParser();PSVIProvider psvi = (PSVIProvider)parser;But ones he cast parser to PSVIProvider how to proceedfrom here to next stage so that he can specify thedocument to be parsed and correspondingly get  theSchema Information too. Sorry for this niche queries.Huzefa--- Maksym Kovalenko <mk...@marketswitch.com>wrote:  

http://xml.apache.org/xerces2-j/faq-xs.htmlHuzefa Hakimi wrote:    

Hello everybody,Sorry if this has been covered in previous threads.I am trying to gather information about all elementans its type for XML Schema against which XML      

Document    

is validated. I am using SAX parser to parse XMLdocuments as have to walk to large documents.      

Xerces    

documentation says that you can use PSVI for this,      

but    

was not getting how to proceed further having thisPSVIParser instance;  import org.apache.xerces.impl.xs.psvi.PSVIProvider;import javax.xml.parsers.SAXParser;import javax.xml.parsers.SAXParserFactory;...SAXParserFactory factory =SAXParserFactory.newInstance();SAXParser parser = factory.newSAXParser();PSVIProvider psviProvider = (PSVIProvider)parser;In above where do we really point that which XMLdocument its going to parse. Can you please help in getting proceeded from thisstep.Thanks in advanceHuzefa__________________________________Do you Yahoo!?Protect your identity with Yahoo! Mail AddressGuardhttp://antispam.yahoo.com/whatsnewfree      

---------------------------------------------------------------------    

To unsubscribe, e-mail:      

xerces-j-user-unsubscribe@xml.apache.org    

For additional commands, e-mail:      

xerces-j-user-help@xml.apache.org    

       

--     

------------------------------------------------------------------------  

Maksym KovalenkoSoftware EngineerMarketswitch Corporationhttp://www.marketswitch.com<http://www.marketswitch.com/>108 Powers Court, Suite 225Dulles, VA 20166Phone: +1 (703) 444-6750 ext. 302Fax: +1 (703) 444-6812    

__________________________________Do you Yahoo!?Protect your identity with Yahoo! Mail AddressGuardhttp://antispam.yahoo.com/whatsnewfree---------------------------------------------------------------------To unsubscribe, e-mail: xerces-j-user-unsubscribe@xml.apache.orgFor additional commands, e-mail: xerces-j-user-help@xml.apache.org  

-- 


v\:* {behavior:url(#default#VML);}o\:* {behavior:url(#default#VML);}w\:* {behavior:url(#default#VML);}.shape {behavior:url(#default#VML);}
---------------------------------


Maksym Kovalenko
Software Engineer
Marketswitch Corporation
http://www.marketswitch.com
108 Powers Court, Suite 225
Dulles, VA 20166
Phone: +1 (703) 444-6750 ext. 302
Fax: +1 (703) 444-6812




---------------------------------
Do you Yahoo!?
Protect your identity with Yahoo! Mail AddressGuard

Re: Parsing XML Schema

Posted by Maksym Kovalenko <mk...@marketswitch.com>.
You forgot that parser casted to PSVIProvider is still a parser, so you 
it for parsing first of all :-)

http://xml.apache.org/xerces2-j/faq-xs.html#faq-6
Here's excerpt
Within the scope of the methods handling the start and end of an 
element, i.e. org.xml.sax.ContentHandler.startElement (..), an 
application can use the PSVIProvider to retrieve the PSVI related to 
that element and its attributes.

You should use parser for parsing, and within content handler methods 
use parser casted to PSVIProvider to extract PSVI info (as xni faq #6 says)


Huzefa Hakimi wrote:

>This faq page does not tell how to proceed further. As
>in there it says that you get PSVIProvider instance
>(by casting SAXParser) but than how do tell after that
>which is the document to be parsed. Lets for example
>prv. if one uses this code to parse the Document
>validated against a schema: 
>
>reader =
>XMLReaderFactory.createXMLReader(vendorClass);
>            
>// register content handler           
>reader.setContentHandler(contentHandler);
>            
>// register error handler
>reader.setErrorHandler(errHandler);
>            
>// set the corresponding features of the SAX parser
>reader.setFeature("http://xml.org/sax/features/namespaces",
>true);
>           
>reader.setFeature("http://xml.org/sax/features/namespace-prefixes",
>true);
>            
>           
>reader.setFeature("http://xml.org/sax/features/validation",
>true);
>           
>reader.setFeature("http://apache.org/xml/features/validation/schema",
>true);
>
>// create input source from xml document
>InputSource inputSource = new InputSource(xmlURI);
>reader.parse(inputSource);
>
>......
>
>Later for this code if one tries to retrieve Schema
>Information than would be using PSVI to get handler to
>XSModel. Right? So for this he would have something
>similar to: 
>
>....
>
>SAXParserFactory factory = new
>org.apache.xerces.jaxp.SAXParserFactoryImpl();
>       
>factory.setFeature("http://xml.org/sax/features/namespaces",
>true);
>       
>factory.setFeature("http://xml.org/sax/features/namespace-prefixes",
>true);
>       
>factory.setFeature("http://xml.org/sax/features/validation",
>true); 
>       
>factory.setFeature("http://apache.org/xml/features/validation/schema",
>true);
>        
>SAXParser parser = factory.newSAXParser();
>PSVIProvider psvi = (PSVIProvider)parser;
>
>But ones he cast parser to PSVIProvider how to proceed
>from here to next stage so that he can specify the
>document to be parsed and correspondingly get  the
>Schema Information too. 
>
>Sorry for this niche queries.
>
>Huzefa
>--- Maksym Kovalenko <mk...@marketswitch.com>
>wrote:
>  
>
>>http://xml.apache.org/xerces2-j/faq-xs.html
>>
>>Huzefa Hakimi wrote:
>>
>>    
>>
>>>Hello everybody,
>>>
>>>Sorry if this has been covered in previous threads.
>>>
>>>I am trying to gather information about all element
>>>ans its type for XML Schema against which XML
>>>      
>>>
>>Document
>>    
>>
>>>is validated. I am using SAX parser to parse XML
>>>documents as have to walk to large documents.
>>>      
>>>
>>Xerces
>>    
>>
>>>documentation says that you can use PSVI for this,
>>>      
>>>
>>but
>>    
>>
>>>was not getting how to proceed further having this
>>>PSVIParser instance;  
>>>
>>>import org.apache.xerces.impl.xs.psvi.PSVIProvider;
>>>import javax.xml.parsers.SAXParser;
>>>import javax.xml.parsers.SAXParserFactory;
>>>
>>>...
>>>
>>>SAXParserFactory factory =
>>>SAXParserFactory.newInstance();
>>>SAXParser parser = factory.newSAXParser();
>>>PSVIProvider psviProvider = (PSVIProvider)parser;
>>>
>>>In above where do we really point that which XML
>>>document its going to parse. 
>>>
>>>
>>>Can you please help in getting proceeded from this
>>>step.
>>>
>>>Thanks in advance
>>>
>>>Huzefa
>>>
>>>__________________________________
>>>Do you Yahoo!?
>>>Protect your identity with Yahoo! Mail AddressGuard
>>>http://antispam.yahoo.com/whatsnewfree
>>>
>>>      
>>>
>>---------------------------------------------------------------------
>>    
>>
>>>To unsubscribe, e-mail:
>>>      
>>>
>>xerces-j-user-unsubscribe@xml.apache.org
>>    
>>
>>>For additional commands, e-mail:
>>>      
>>>
>>xerces-j-user-help@xml.apache.org
>>    
>>
>>> 
>>>
>>>      
>>>
>>-- 
>>
>>    
>>
>------------------------------------------------------------------------
>  
>
>>Maksym Kovalenko
>>Software Engineer
>>Marketswitch Corporation
>>http://www.marketswitch.com
>><http://www.marketswitch.com/>
>>108 Powers Court, Suite 225
>>Dulles, VA 20166
>>Phone: +1 (703) 444-6750 ext. 302
>>Fax: +1 (703) 444-6812
>>
>>
>>    
>>
>
>
>__________________________________
>Do you Yahoo!?
>Protect your identity with Yahoo! Mail AddressGuard
>http://antispam.yahoo.com/whatsnewfree
>
>---------------------------------------------------------------------
>To unsubscribe, e-mail: xerces-j-user-unsubscribe@xml.apache.org
>For additional commands, e-mail: xerces-j-user-help@xml.apache.org
>
>  
>

-- 
------------------------------------------------------------------------

Maksym Kovalenko
Software Engineer
Marketswitch Corporation
http://www.marketswitch.com <http://www.marketswitch.com/>
108 Powers Court, Suite 225
Dulles, VA 20166
Phone: +1 (703) 444-6750 ext. 302
Fax: +1 (703) 444-6812


Re: Parsing XML Schema

Posted by Huzefa Hakimi <ha...@yahoo.com>.
This faq page does not tell how to proceed further. As
in there it says that you get PSVIProvider instance
(by casting SAXParser) but than how do tell after that
which is the document to be parsed. Lets for example
prv. if one uses this code to parse the Document
validated against a schema: 

reader =
XMLReaderFactory.createXMLReader(vendorClass);
            
// register content handler           
reader.setContentHandler(contentHandler);
            
// register error handler
reader.setErrorHandler(errHandler);
            
// set the corresponding features of the SAX parser
reader.setFeature("http://xml.org/sax/features/namespaces",
true);
           
reader.setFeature("http://xml.org/sax/features/namespace-prefixes",
true);
            
           
reader.setFeature("http://xml.org/sax/features/validation",
true);
           
reader.setFeature("http://apache.org/xml/features/validation/schema",
true);

// create input source from xml document
InputSource inputSource = new InputSource(xmlURI);
reader.parse(inputSource);

......

Later for this code if one tries to retrieve Schema
Information than would be using PSVI to get handler to
XSModel. Right? So for this he would have something
similar to: 

....

SAXParserFactory factory = new
org.apache.xerces.jaxp.SAXParserFactoryImpl();
       
factory.setFeature("http://xml.org/sax/features/namespaces",
true);
       
factory.setFeature("http://xml.org/sax/features/namespace-prefixes",
true);
       
factory.setFeature("http://xml.org/sax/features/validation",
true); 
       
factory.setFeature("http://apache.org/xml/features/validation/schema",
true);
        
SAXParser parser = factory.newSAXParser();
PSVIProvider psvi = (PSVIProvider)parser;

But ones he cast parser to PSVIProvider how to proceed
from here to next stage so that he can specify the
document to be parsed and correspondingly get  the
Schema Information too. 

Sorry for this niche queries.

Huzefa
--- Maksym Kovalenko <mk...@marketswitch.com>
wrote:
> http://xml.apache.org/xerces2-j/faq-xs.html
> 
> Huzefa Hakimi wrote:
> 
> >Hello everybody,
> >
> >Sorry if this has been covered in previous threads.
> >
> >I am trying to gather information about all element
> >ans its type for XML Schema against which XML
> Document
> >is validated. I am using SAX parser to parse XML
> >documents as have to walk to large documents.
> Xerces
> >documentation says that you can use PSVI for this,
> but
> >was not getting how to proceed further having this
> >PSVIParser instance;  
> >
> >import org.apache.xerces.impl.xs.psvi.PSVIProvider;
> >import javax.xml.parsers.SAXParser;
> >import javax.xml.parsers.SAXParserFactory;
> >
> >...
> >
> >SAXParserFactory factory =
> >SAXParserFactory.newInstance();
> >SAXParser parser = factory.newSAXParser();
> >PSVIProvider psviProvider = (PSVIProvider)parser;
> >
> >In above where do we really point that which XML
> >document its going to parse. 
> >
> >
> >Can you please help in getting proceeded from this
> >step.
> >
> >Thanks in advance
> >
> >Huzefa
> >
> >__________________________________
> >Do you Yahoo!?
> >Protect your identity with Yahoo! Mail AddressGuard
> >http://antispam.yahoo.com/whatsnewfree
> >
>
>---------------------------------------------------------------------
> >To unsubscribe, e-mail:
> xerces-j-user-unsubscribe@xml.apache.org
> >For additional commands, e-mail:
> xerces-j-user-help@xml.apache.org
> >
> >  
> >
> 
> -- 
>
------------------------------------------------------------------------
> 
> Maksym Kovalenko
> Software Engineer
> Marketswitch Corporation
> http://www.marketswitch.com
> <http://www.marketswitch.com/>
> 108 Powers Court, Suite 225
> Dulles, VA 20166
> Phone: +1 (703) 444-6750 ext. 302
> Fax: +1 (703) 444-6812
> 
> 


__________________________________
Do you Yahoo!?
Protect your identity with Yahoo! Mail AddressGuard
http://antispam.yahoo.com/whatsnewfree

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


Re: Parsing XML Schema

Posted by Maksym Kovalenko <mk...@marketswitch.com>.
http://xml.apache.org/xerces2-j/faq-xs.html

Huzefa Hakimi wrote:

>Hello everybody,
>
>Sorry if this has been covered in previous threads.
>
>I am trying to gather information about all element
>ans its type for XML Schema against which XML Document
>is validated. I am using SAX parser to parse XML
>documents as have to walk to large documents. Xerces
>documentation says that you can use PSVI for this, but
>was not getting how to proceed further having this
>PSVIParser instance;  
>
>import org.apache.xerces.impl.xs.psvi.PSVIProvider;
>import javax.xml.parsers.SAXParser;
>import javax.xml.parsers.SAXParserFactory;
>
>...
>
>SAXParserFactory factory =
>SAXParserFactory.newInstance();
>SAXParser parser = factory.newSAXParser();
>PSVIProvider psviProvider = (PSVIProvider)parser;
>
>In above where do we really point that which XML
>document its going to parse. 
>
>
>Can you please help in getting proceeded from this
>step.
>
>Thanks in advance
>
>Huzefa
>
>__________________________________
>Do you Yahoo!?
>Protect your identity with Yahoo! Mail AddressGuard
>http://antispam.yahoo.com/whatsnewfree
>
>---------------------------------------------------------------------
>To unsubscribe, e-mail: xerces-j-user-unsubscribe@xml.apache.org
>For additional commands, e-mail: xerces-j-user-help@xml.apache.org
>
>  
>

-- 
------------------------------------------------------------------------

Maksym Kovalenko
Software Engineer
Marketswitch Corporation
http://www.marketswitch.com <http://www.marketswitch.com/>
108 Powers Court, Suite 225
Dulles, VA 20166
Phone: +1 (703) 444-6750 ext. 302
Fax: +1 (703) 444-6812