#2282 xml files

lean Sun 11 May 2014

Hey,

We want to use the class XParser (for example.. (all the xml classes don't work)_ but, their is a compilation error because the class is not declared..

Their is an using to add?!

Thank you very much!!!

SlimerDude Sun 11 May 2014

Hi Lean,

Sorry, but I don't understand your question. What doesn't work? What class? Is there a stack trace?

To get you started, the following works okay:

using xml

class Example {
  Void main() {
    xml := "<hello/>"
    doc := XParser(xml.in).parseDoc
    echo(doc.root)
  }
}

lean Sun 11 May 2014

Thank you!

No, it's not working..

The error is with the "using": "using xml which is not declared dependency for myProject"

Do you know what should I do?

Thanks very much..

SlimerDude Sun 11 May 2014

You need to add a dependency on the xml pod to your project. Do this by altering your build.fan file so that depends looks like:

depends = ["sys 1.0", "xml 1.0"]

See Pods and How To Setup a Fantom Project for more details.

lean Sun 11 May 2014

Thanks a lot!!!!! Your are awesome!! :)

Login or Signup to reply.