> The startElement has information about both element and its attributes.
> After execution of the startElement method in AbstractDOMParser, element
> and its attributes are created and are part of the DOM tree.

Yes, I saw this in the attributes parameter of the startElement() method.
The thing is that I need to get the column number for each attribute. I do
this for lines by using an XMLlocator which I register in the startDocument
() method. So if I access the attributes in the startDocument method, the
locator is already at the end of the element so I'll get the column number
of the end of the element.


Thanks,

Ron.



|---------+---------------------------->
|         |           Elena            |
|         |           Litani/Toronto/IB|
|         |           [EMAIL PROTECTED]          |
|         |                            |
|         |           30/04/2003 18:46 |
|         |           Please respond to|
|         |           xerces-j-user    |
|---------+---------------------------->
  
>--------------------------------------------------------------------------------------------------------------|
  |                                                                             
                                 |
  |       To:       [EMAIL PROTECTED]                                           
                      |
  |       cc:                                                                   
                                 |
  |       Subject:  Re: accessing attributes                                    
                                 |
  
>--------------------------------------------------------------------------------------------------------------|




Ron Rothblum wrote:
> A while ago I posted a question asking how to save element information
> (specifically a line number) during the DOM parsing. The method I used
was
> overriding the startElement method and saving a mapping between the
element
> and it's line number. Turns out that isn't enough and I need to save
> information for each attribute of every element, is there some method I
can
> override to access an element's attribute while it is being parsed
> (startAttribute in analogy to startElement)? or possibly some other way
of
> doing this?

The startElement has information about both element and its attributes.
After execution of the startElement method in AbstractDOMParser, element
and its attributes are created and are part of the DOM tree.

Recently we've implemented DOMBuilderFilter (Load and Save, DOM L3)
which allows you to register a filter that will be called by the parser
to notify your application of different node types. So instead of
overwriting startElement you can use the filter to receive notification
on each element/attributes creation and make modifications you need.

Hope it helps,
--
Elena Litani / IBM Toronto

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]





---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to