Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7616225
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 31, 20262026-05-31T02:50:23+00:00 2026-05-31T02:50:23+00:00

My setting: Compiler: DMD 1.056 Library: Tango 0.99.9 OS: Windows 7 What I have

  • 0

My setting:

  • Compiler: DMD 1.056
  • Library: Tango 0.99.9
  • OS: Windows 7

What I have done so far:

I have managed to build via API a GPX file and know how to format it and display it on the console.


My code:

module SwathGen;

import 
  tango.io.Stdout,
  tango.text.xml.Document,
  tango.text.xml.DocPrinter;

void main(char[][] args)
{   
    auto gpxdoc = new Document!(char);

    gpxdoc.header;

    gpxdoc.tree 
        .element(null,"gpx")
      .attribute (null,"xmlns","http://www.topografix.com/GPX/1/1")
      .attribute (null,"version","1.1")
            .attribute (null,"creator","SwathGen")
      .attribute (null,"xmlns:xsi","http://www.w3.org/2001/XMLSchema-instance")
      .attribute (null,"xsi:schemaLocation","http://www.topografix.com/GPX/1/1 http://www.topografix.com/GPX/1/1/gpx.xsd http://www.topografix.com/GPX/gpx_style/0/2 http://www.topografix.com/GPX/gpx_style/0/2/gpx_style.xsd http://www.topografix.com/GPX/gpx_overlay/0/3 http://www.topografix.com/GPX/gpx_overlay/0/3/gpx_overlay.xsd")
  ;

  gpxdoc.elements
        .element (null,"metadata")
      .element(null,"name","JobDef.gpx")

      .parent
      .element(null,"desc","Spray Job")

      .parent
      .element(null,"author")
        .element (null,"name","izylay")

        .parent
        .element (null,"email")
          .attribute (null,"id","izylay")
          .attribute (null,"domain","ary.com")

        .parent

      .parent
      .element(null,"copyright")
        .attribute (null,"author","izylay")
        .element (null,"year","2011")

        .parent

      .parent
      .element(null,"time","2011-10-10T08:19:50Z")

      .parent
      .element(null,"keywords","ULM, J300, Aerial Spraying, Locust")

      .parent
            .element (null,"bounds")
        .attribute (null,"minlat","-18.85522622")
                .attribute (null,"minlon","47.37275913")
                .attribute (null,"maxlat","-18.82044444")
                .attribute (null,"maxlon","47.39838002")
    ;

    gpxdoc.elements     
        .element(null,"wpt")
      .attribute (null,"lat","-18.85522622")
      .attribute (null,"lon","47.39173757")

      .element (null,"name","A000")

      .parent
      .element (null,"sym","Waypoint")
  ;

    gpxdoc.elements     
        .element(null,"rte")
      .element (null,"name","Spray Job")
      //
      .parent
      .element(null,"rtept")
        .attribute (null,"lat","-18.85522610")
        .attribute (null,"lon","47.39838002")
        .element (null,"name","Entry point")
        .parent
        .element (null,"sym","Dot")
        .parent

      .parent
      .element(null,"rtept")
        .attribute (null,"lat","-18.85522525")
        .attribute (null,"lon","47.37275913")
        .element (null,"name","B000")
        .parent
        .element (null,"sym","Dot")
        .parent

      .parent
      .element(null,"rtept")
        .attribute (null,"lat","-18.85387012")
        .attribute (null,"lon","47.37275913")
        .element (null,"name","B001")
        .parent
        .element (null,"sym","Dot")
        .parent


      .parent
      .element(null,"rtept")
        .attribute (null,"lat","-18.85387109")
        .attribute (null,"lon","47.39173757")
        .element (null,"name","A001")
        .parent
        .element (null,"sym","Dot")
        .parent

      .parent
      .element(null,"rtept")
        .attribute (null,"lat","-18.85251596")
        .attribute (null,"lon","47.39173757")
        .element (null,"name","A002")
        .parent
        .element (null,"sym","Dot")
        .parent

      .parent
      .element(null,"rtept")
        .attribute (null,"lat","-18.85251499")
        .attribute (null,"lon","47.37275913")
        .element (null,"name","B002")
        .parent
        .element (null,"sym","Dot")
        .parent

      .parent
      .element(null,"rtept")
        .attribute (null,"lat","-18.85115986")
        .attribute (null,"lon","47.37275913")
        .element (null,"name","B003")
        .parent
        .element (null,"sym","Dot")
        .parent

      .parent
      .element(null,"rtept")
        .attribute (null,"lat","-18.85116082")
        .attribute (null,"lon","47.39173757")
        .element (null,"name","A003")
        .parent
        .element (null,"sym","Dot")
        .parent

      .parent
      .element(null,"rtept")
        .attribute (null,"lat","-18.84980569")
        .attribute (null,"lon","47.39173757")
        .element (null,"name","A004")
        .parent
        .element (null,"sym","Dot")
        .parent

      .parent
      .element(null,"rtept")
        .attribute (null,"lat","-18.84980472")
        .attribute (null,"lon","47.37275913")
        .element (null,"name","B004")
        .parent
        .element (null,"sym","Dot")
        .parent

      .parent
      .element(null,"rtept")
        .attribute (null,"lat","-18.84844959")
        .attribute (null,"lon","47.37275913")
        .element (null,"name","B005")
        .parent
        .element (null,"sym","Dot")
        .parent

      .parent
      .element(null,"rtept")
        .attribute (null,"lat","-18.84845056")
        .attribute (null,"lon","47.39173757")
        .element (null,"name","A005")
        .parent
        .element (null,"sym","Dot")
        .parent

      .parent
      .element(null,"rtept")
        .attribute (null,"lat","-18.84709543")
        .attribute (null,"lon","47.39173757")
        .element (null,"name","A006")
        .parent
        .element (null,"sym","Dot")
        .parent

      .parent
      .element(null,"rtept")
        .attribute (null,"lat","-18.84709446")
        .attribute (null,"lon","47.37275913")
        .element (null,"name","B006")
        .parent
        .element (null,"sym","Dot")
        .parent

      .parent
      .element(null,"rtept")
        .attribute (null,"lat","-18.84573933")
        .attribute (null,"lon","47.37275913")
        .element (null,"name","B007")
        .parent
        .element (null,"sym","Dot")
        .parent

      .parent
      .element(null,"rtept")
        .attribute (null,"lat","-18.84574029")
        .attribute (null,"lon","47.39173757")
        .element (null,"name","A007")
        .parent
        .element (null,"sym","Dot")
        .parent

      .parent
      .element(null,"rtept")
        .attribute (null,"lat","-18.84438516")
        .attribute (null,"lon","47.39173757")
        .element (null,"name","A008")
        .parent
        .element (null,"sym","Dot")
        .parent

      .parent
      .element(null,"rtept")
        .attribute (null,"lat","-18.84438419")
        .attribute (null,"lon","47.37275913")
        .element (null,"name","B008")
        .parent
        .element (null,"sym","Dot")
        .parent

      .parent
      .element(null,"rtept")
        .attribute (null,"lat","-18.84302906")
        .attribute (null,"lon","47.37275913")
        .element (null,"name","B009")
        .parent
        .element (null,"sym","Dot")
        .parent

      .parent
      .element(null,"rtept")
        .attribute (null,"lat","-18.84303003")
        .attribute (null,"lon","47.39173757")
        .element (null,"name","A009")
        .parent
        .element (null,"sym","Dot")
        .parent

      .parent
      .element(null,"rtept")
        .attribute (null,"lat","-18.84167489")
        .attribute (null,"lon","47.39173757")
        .element (null,"name","A010")
        .parent
        .element (null,"sym","Dot")
        .parent

      .parent
      .element(null,"rtept")
        .attribute (null,"lat","-18.84167393")
        .attribute (null,"lon","47.37275913")
        .element (null,"name","B010")
        .parent
        .element (null,"sym","Dot")
        .parent

      .parent
      .element(null,"rtept")
        .attribute (null,"lat","-18.84031879")
        .attribute (null,"lon","47.37275913")
        .element (null,"name","B011")
        .parent
        .element (null,"sym","Dot")
        .parent

      .parent
      .element(null,"rtept")
        .attribute (null,"lat","-18.84031976")
        .attribute (null,"lon","47.39173757")
        .element (null,"name","A011")
        .parent
        .element (null,"sym","Dot")
        .parent

      .parent
      .element(null,"rtept")
        .attribute (null,"lat","-18.83896463")
        .attribute (null,"lon","47.39173757")
        .element (null,"name","A012")
        .parent
        .element (null,"sym","Dot")
        .parent

      .parent
      .element(null,"rtept")
        .attribute (null,"lat","-18.83896366")
        .attribute (null,"lon","47.37275913")
        .element (null,"name","B012")
        .parent
        .element (null,"sym","Dot")
        .parent

      .parent
      .element(null,"rtept")
        .attribute (null,"lat","-18.83760852")
        .attribute (null,"lon","47.37275913")
        .element (null,"name","B013")
        .parent
        .element (null,"sym","Dot")
        .parent

      .parent
      .element(null,"rtept")
        .attribute (null,"lat","-18.83760949")
        .attribute (null,"lon","47.39173757")
        .element (null,"name","A013")
        .parent
        .element (null,"sym","Dot")
        .parent

      .parent
      .element(null,"rtept")
        .attribute (null,"lat","-18.83625436")
        .attribute (null,"lon","47.39173757")
        .element (null,"name","A014")
        .parent
        .element (null,"sym","Dot")
        .parent

      .parent
      .element(null,"rtept")
        .attribute (null,"lat","-18.83625339")
        .attribute (null,"lon","47.37275913")
        .element (null,"name","B014")
        .parent
        .element (null,"sym","Dot")
        .parent

      .parent
      .element(null,"rtept")
        .attribute (null,"lat","-18.83489825")
        .attribute (null,"lon","47.37275913")
        .element (null,"name","B015")
        .parent
        .element (null,"sym","Dot")
        .parent

      .parent
      .element(null,"rtept")
        .attribute (null,"lat","-18.83489922")
        .attribute (null,"lon","47.39173757")
        .element (null,"name","A015")
        .parent
        .element (null,"sym","Dot")
        .parent

      .parent
      .element(null,"rtept")
        .attribute (null,"lat","-18.83354409")
        .attribute (null,"lon","47.39173757")
        .element (null,"name","A016")
        .parent
        .element (null,"sym","Dot")
        .parent

      .parent
      .element(null,"rtept")
        .attribute (null,"lat","-18.83354312")
        .attribute (null,"lon","47.37275913")
        .element (null,"name","B016")
        .parent
        .element (null,"sym","Dot")
        .parent

      .parent
      .element(null,"rtept")
        .attribute (null,"lat","-18.83218798")
        .attribute (null,"lon","47.37275913")
        .element (null,"name","B017")
        .parent
        .element (null,"sym","Dot")
        .parent

      .parent
      .element(null,"rtept")
        .attribute (null,"lat","-18.83218895")
        .attribute (null,"lon","47.39173757")
        .element (null,"name","A017")
        .parent
        .element (null,"sym","Dot")
        .parent

      .parent
      .element(null,"rtept")
        .attribute (null,"lat","-18.83083382")
        .attribute (null,"lon","47.39173757")
        .element (null,"name","A018")
        .parent
        .element (null,"sym","Dot")
        .parent

      .parent
      .element(null,"rtept")
        .attribute (null,"lat","-18.83083285")
        .attribute (null,"lon","47.37275913")
        .element (null,"name","B018")
        .parent
        .element (null,"sym","Dot")
        .parent

      .parent
      .element(null,"rtept")
        .attribute (null,"lat","-18.82947771")
        .attribute (null,"lon","47.37275913")
        .element (null,"name","B019")
        .parent
        .element (null,"sym","Dot")
        .parent

      .parent
      .element(null,"rtept")
        .attribute (null,"lat","-18.82947868")
        .attribute (null,"lon","47.39173757")
        .element (null,"name","A019")
        .parent
        .element (null,"sym","Dot")
        .parent

      .parent
      .element(null,"rtept")
        .attribute (null,"lat","-18.82812355")
        .attribute (null,"lon","47.39173757")
        .element (null,"name","A020")
        .parent
        .element (null,"sym","Dot")
        .parent

      .parent
      .element(null,"rtept")
        .attribute (null,"lat","-18.82812258")
        .attribute (null,"lon","47.37275913")
        .element (null,"name","B020")
        .parent
        .element (null,"sym","Dot")
        .parent

      .parent
      .element(null,"rtept")
        .attribute (null,"lat","-18.82676744")
        .attribute (null,"lon","47.37275913")
        .element (null,"name","B021")
        .parent
        .element (null,"sym","Dot")
        .parent

      .parent
      .element(null,"rtept")
        .attribute (null,"lat","-18.82676841")
        .attribute (null,"lon","47.39173757")
        .element (null,"name","A021")
        .parent
        .element (null,"sym","Dot")
        .parent

      .parent
      .element(null,"rtept")
        .attribute (null,"lat","-18.82044444")
        .attribute (null,"lon","47.39173757")
        .element (null,"name","Exit point")
        .parent
        .element (null,"sym","Dot")
        .parent
    ;

    gpxdoc.elements     
        .element(null,"extensions") 
      .element(null,"polyline")
        .attribute(null,"xmlns","http://www.topografix.com/GPX/gpx_overlay/0/3")

        .element(null,"points")
          //
          .element(null,"pt")   
            .attribute (null,"lat","-18.85522622")
            .attribute (null,"lon","47.37275913")

          .parent
          .element(null,"pt")   
            .attribute (null,"lat","-18.85522622")
            .attribute (null,"lon","47.39838002")

          .parent
          .element(null,"pt")   
            .attribute (null,"lat","-18.82044444")
            .attribute (null,"lon","47.39838002")

          .parent
          .element(null,"pt")   
            .attribute (null,"lat","-18.82044444")
            .attribute (null,"lon","47.37275913")

          .parent
          .element(null,"pt")   
            .attribute (null,"lat","-18.85522622")
            .attribute (null,"lon","47.37275913")
          //
    ;
    auto print = new DocPrinter!(char);

    Stdout(print(gpxdoc)).newline;  
}

Question:

How to persist the GPX (XML) document to a file ?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-31T02:50:24+00:00Added an answer on May 31, 2026 at 2:50 am
    auto to = new File ("copy.txt", File.WriteCreate);
    
    to.write(print(gpxdoc));
    to.close;
    

    open file and write to it

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Setting up new git installations. On one Windows laptop, I'm running (under cygwin): git
Is it possible to use the Bindable compiler setting when using mxml? I've got
I have the Intel compiler platform install on my development machine, when using Cmake
I am trying to build a cross compiler to target the processor running on
Is there a compiler setting that can warn about these? Currently I'm reviewing code
From the Eclipse Java compiler setting: Method does not override package visible method A
Can compiler reorder variable setting and throw() op in C++? Or, does standard C++
In respect to the maven-compiler-plugin. There is a setting added to my project's POM
OS: Windows 7 Compiler: MinGW IDE: Code::Blocks I just installed Gtkmm on my computer
Is there any compiler setting or other way to force an int to be

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.