For the parser I am creating, it is would be VERY helpful if I could easily get the character position within the entire HTML of the value of an attribute, but, this information doesn't seem to be on the Attribute object. Such as
some text<img src="x.gif" alt="other text">blah
With my visitor I can easily determine that I am in an IMG start tag, find the ALT attribute, and determine it has the text (other text) but I need to know that is at character 31 within the file. I am able to guess it is this position because I know that the img tag node is at position 10 and I can do an indexOf of (other text) within the text of the img node, but, of "other text" appeared earlier somewhere in the tag, I wouldn't be getting form the alt attribute.
Log in to post a comment.