We need to do something. This code fails because there is no file
associated with the document.

            XmlDocument doc = new XmlDocument();
            XmlElement project = doc.CreateElement("project");
            XmlElement echo = doc.CreateElement("echo");
            echo.SetAttribute("message","Go Away!");
            project.AppendChild(echo);
            doc.AppendChild(project);

            Project p = new Project(doc);
                p.Run()

In my test env I've hacked the LocationMap so this doesn't generate
errors, er... at least so it runs. But having a LocationMap is a little
intrusive, IMHO.

Currently it means that we need to re-read the file to generate the
location.
 
My docs don't list XPathNavigator as implementing the IXmlLineInfo
interface. The object browser doesn't seem to show it either. Nor does
the IXmlLineInfo overview list any classes other than "XmlTextReader,
XmlValidatingReader" as implementers[1]. 

[1]
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/cpref/h
tml/frlrfSystemXmlIXmlLineInfoClassTopic.asp

> -----Original Message-----
> From: Ian MacLean [mailto:[EMAIL PROTECTED]]
> Sent: Tuesday, June 04, 2002 12:24 PM
> To: Gerry Shaw
> Cc: 'Scott Hernandez'; 'NantDev'
> Subject: Re: [nant-dev] XML Line Numbers
> 
> 
> 
> Gerry Shaw wrote:
> 
> >It does seem like a pretty good solution but what we have does work
and
> >has been tested and isn't causing any problems that I know of.  Its
also
> >a lot fewer files.
> >
> >Still it's a pretty good sample and I'll likely use it in other
> >projects.
> >
> >Thanks
> >
> >
> >
> >>A sample just (a few days ago) got released on gotdotnet that
> >>tracks line numbers for a DOM object. It extends the DOM
> >>objects, and tracks the information internally. I think this
> >>would be a good way of doing it, instead of the current way.
> >>Any comments?
> >>
> >>"Example showing how to extend the System.Xml DOM classes.
> >>The derived classes implement the IXmlLineInfo interface
> >>which allows users to return line information on the XML
> >>documents." -
http://www.gotdotnet.com/userfiles/XMLDom/extendDOM.zip
> >>
> >>
> >>
> >>
> In fact the XPathNvavigator already inplements the IXmlLineInfo
> interface so you don't need to write your own derived classes. However
I
> agree with Gerry that what we have works now o theres no need to
change
> it. Besides that was my first contribution to Nant :)
> 
> Ian



_______________________________________________________________

Don't miss the 2002 Sprint PCS Application Developer's Conference
August 25-28 in Las Vegas -- http://devcon.sprintpcs.com/adp/index.cfm

_______________________________________________
Nant-developers mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/nant-developers

Reply via email to