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 Wayne Johnson <wd...@yahoo.com> on 2004/03/03 23:20:49 UTC

How to reference the initial stream after parsing into DOM.

I'm using xerces-j to parse a large configuration file and am using the
DOMParser.  

I've got a .xsd file set up for verifying the XML, but there is further
error checking that I have to do while processing the file.

How can I generate an error message that can refer back to the original
xml file.  Something like "undefined topic defined on line 9232".

Do I need to go back and use the SAXParser?  I was hoping to use DOM
because its easier processing imbedded elements (no need for state
tables, etc.).

Thanks in advance.

=====
---
Wayne Johnson,             | There are two kinds of people: Those 
3943 Penn Ave. N.          | who say to God, "Thy will be done," 
Minneapolis, MN 55412-1908 | and those to whom God says, "All right, 
(612) 522-7003             | then,  have it your way." --C.S. Lewis

__________________________________
Do you Yahoo!?
Yahoo! Search - Find what you�re looking for faster
http://search.yahoo.com

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


Re: How to reference the initial stream after parsing into DOM.

Posted by Wayne Johnson <wd...@yahoo.com>.
Guess I answered my own question.  You can subclass DOMParser, adding
code to the StartDocument and StartElement methods to create a UserData
value for each element that contains location information.  I found this
in the example program DOMAddLines.java.


--- Wayne Johnson <wd...@yahoo.com> wrote:
> I'm using xerces-j to parse a large configuration file and am using the
> DOMParser.  
> 
> I've got a .xsd file set up for verifying the XML, but there is further
> error checking that I have to do while processing the file.
> 
> How can I generate an error message that can refer back to the original
> xml file.  Something like "undefined topic defined on line 9232".
> 
> Do I need to go back and use the SAXParser?  I was hoping to use DOM
> because its easier processing imbedded elements (no need for state
> tables, etc.).
> 
> Thanks in advance.
> 
> =====
> ---
> Wayne Johnson,             | There are two kinds of people: Those 
> 3943 Penn Ave. N.          | who say to God, "Thy will be done," 
> Minneapolis, MN 55412-1908 | and those to whom God says, "All right, 
> (612) 522-7003             | then,  have it your way." --C.S. Lewis
> 
> __________________________________
> Do you Yahoo!?
> Yahoo! Search - Find what you�re looking for faster
> http://search.yahoo.com
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: xerces-j-user-unsubscribe@xml.apache.org
> For additional commands, e-mail: xerces-j-user-help@xml.apache.org
> 


=====
---
Wayne Johnson,             | There are two kinds of people: Those 
3943 Penn Ave. N.          | who say to God, "Thy will be done," 
Minneapolis, MN 55412-1908 | and those to whom God says, "All right, 
(612) 522-7003             | then,  have it your way." --C.S. Lewis

__________________________________
Do you Yahoo!?
Yahoo! Search - Find what you�re looking for faster
http://search.yahoo.com

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