[Expat-discuss] attribute line numbers?

Fred L. Drake, Jr. fdrake@acm.org
Mon Oct 15 06:27:05 2001


Carlos Pereira writes:
 > When I find a wrong attribute (detected by my own app code), 
 > is there a way to know the file line where that attribute 
 > actually was?

  XML_GetCurrentLineNumber() is as close as you can get; sorry.  Even
if Expat gave you the line number for the name= portion of the
attribute, that could be many (albiet blank) lines from the problem as
well, so I think it unlikely that the problem is really solved with
just the line number.  If the source uses an encoding your application
understands, the start of the element is really enough to locate the
attribute value (if using namespaces, make sure you hook the namespace
callback so you can track prefixes for proper decoding).


  -Fred

-- 
Fred L. Drake, Jr.  <fdrake at acm.org>
PythonLabs at Zope Corporation