Re: [xml] simple question with apologies



On Fri, Nov 09, 2001 at 05:36:17PM -0500, tlewis mindspring com wrote:
I'm using DOM.  Say I want to throw an application error related to an
xml node.  Is there any way to determine the location of that xml node in
the original file so that I can tell the user where to look for the error?

  The name of the resource is hosted by the document node.
So node->doc->URL usually carries it. You can also get the
line number in recent versions of libxml2 by calling:
  long xmlGetLineNo(xmlNodePtr node)

if you have switched line number gathering using
  xmlLineNumbersDefault(1);
before calling the parser (it's not enabled by default to avoid 
possible backward compatibility problems).

Daniel

-- 
Daniel Veillard      | Red Hat Network https://rhn.redhat.com/
veillard redhat com  | libxml Gnome XML XSLT toolkit  http://xmlsoft.org/
http://veillard.com/ | Rpmfind RPM search engine http://rpmfind.net/



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]