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 GEORG Gersende <ge...@free.fr> on 2002/05/10 09:09:00 UTC

Problem parsing with SAX

Hi,


    I'm just beginning to parse an XML document and I've never done this
before ... I tried to create an SAXParser and I used SetContentHandler
and Parse but it doesn't work. I forget something I think ....

    Can anybody help me to explain how can I parse an XML document with
java, the method ?? I think after create an SAXParser I should do
property but I don't know what else ....

Thanks


            Gersende


Excuse me for my english but I m french and I hope you understand what I
said ....


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


RE: Problem parsing with SAX

Posted by Gersende GEORG <Ge...@free.fr>.
It's OK ... I've found the solution of my problem ...
Thanks

	Gersende


-----Message d'origine-----
De : Gersende GEORG [mailto:Gersende.Georg@free.fr]
Envoye : dimanche 12 mai 2002 21:20
A : xerces-j-user@xml.apache.org
Objet : RE: Problem parsing with SAX



Hi,

Thanks for your interest and I've found my mistake ... when I want to parse
my XML document ... I thought that I should write the path like
"d:/toto.xml" and I saw an example where it's writing "file:///d:/toto.xml"
so its run ...
Thanks for help ...

I've just one question about the parsing :

In my DTD I have :

<!ELEMENT decision.variable.description (#PCDATA | %block;)*>
<!ATTLIST decision.variable.description
	source CDATA #IMPLIED
	id ID #IMPLIED
	id CDATA #IMPLIED
>

With the function : public void startElement (String uri, String name,String
qName, Attributes atts) where I have a boolean variable to become "true"
when I met "decision.variable" in my XML document .... I obtain so the
content of my "decision.variable" but it is possible to obtain the "id" of
my "decision.variable" ?

Thanks

	Gersende



> -----Original Message-----
> From: gge@biomath.jussieu.fr [mailto:gge@biomath.jussieu.fr]
> On Behalf Of GEORG Gersende
> Sent: Friday, May 10, 2002 3:09 AM
> To: xerces-j-user@xml.apache.org
> Subject: Problem parsing with SAX
>
>
> Hi,
>
>
>     I'm just beginning to parse an XML document and I've
> never done this before ... I tried to create an SAXParser and
> I used SetContentHandler and Parse but it doesn't work. I
> forget something I think ....
>
>     Can anybody help me to explain how can I parse an XML
> document with java, the method ?? I think after create an
> SAXParser I should do property but I don't know what else ....



---------------------------------------------------------------------
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



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


RE: Problem parsing with SAX

Posted by Gersende GEORG <Ge...@free.fr>.
Hi,

Thanks for your interest and I've found my mistake ... when I want to parse
my XML document ... I thought that I should write the path like
"d:/toto.xml" and I saw an example where it's writing "file:///d:/toto.xml"
so its run ...
Thanks for help ...

I've just one question about the parsing :

In my DTD I have :

<!ELEMENT decision.variable.description (#PCDATA | %block;)*>
<!ATTLIST decision.variable.description
	source CDATA #IMPLIED
	id ID #IMPLIED
	id CDATA #IMPLIED
>

With the function : public void startElement (String uri, String name,String
qName, Attributes atts) where I have a boolean variable to become "true"
when I met "decision.variable" in my XML document .... I obtain so the
content of my "decision.variable" but it is possible to obtain the "id" of
my "decision.variable" ?

Thanks

	Gersende



> -----Original Message-----
> From: gge@biomath.jussieu.fr [mailto:gge@biomath.jussieu.fr]
> On Behalf Of GEORG Gersende
> Sent: Friday, May 10, 2002 3:09 AM
> To: xerces-j-user@xml.apache.org
> Subject: Problem parsing with SAX
>
>
> Hi,
>
>
>     I'm just beginning to parse an XML document and I've
> never done this before ... I tried to create an SAXParser and
> I used SetContentHandler and Parse but it doesn't work. I
> forget something I think ....
>
>     Can anybody help me to explain how can I parse an XML
> document with java, the method ?? I think after create an
> SAXParser I should do property but I don't know what else ....



---------------------------------------------------------------------
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: Problem parsing with SAX

Posted by Scott Stirling <sc...@rcn.com>.
Bonjour Gersende,

Please post an example of your source and the stack trace from your
exception.  That will help us help you better.  Other than that, there
are plenty of examples of simple SAXParser usage on the Internet you
should be able to find.  Try the Xerces examples, search java.sun.com,
jguru.com or javaworld.com

Scott Stirling

> -----Original Message-----
> From: gge@biomath.jussieu.fr [mailto:gge@biomath.jussieu.fr] 
> On Behalf Of GEORG Gersende
> Sent: Friday, May 10, 2002 3:09 AM
> To: xerces-j-user@xml.apache.org
> Subject: Problem parsing with SAX
> 
> 
> Hi,
> 
> 
>     I'm just beginning to parse an XML document and I've 
> never done this before ... I tried to create an SAXParser and 
> I used SetContentHandler and Parse but it doesn't work. I 
> forget something I think ....
> 
>     Can anybody help me to explain how can I parse an XML 
> document with java, the method ?? I think after create an 
> SAXParser I should do property but I don't know what else ....



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