Git Product home page Git Product logo

foxy's Introduction

FoXy

License License License License

Status Build Status Coverage Status

FoXy, Fortran XML parser for poor people

A KISS pure Fortran Library for parsing XML files

  • FoXy is a pure Fortran (KISS) library for modern Fortran projects;
  • FoXy is Fortran 2008+ standard compliant;
  • FoXy is OOP designed;
  • FoXy is a Free, Open Source Project.

Compiler Support

Compiler Compiler Compiler Compiler Compiler Compiler


What is FoXy? | Aims | Status | Documentation | Copyrights


What is FoXy?

Modern Fortran standards (2003+) have introduced better support for strings manipulations. Exploiting such new Fortran capabilities, FoXy is aimed to provide an easy to use module library to parse and emit XML files and or tags.

Aims

Other programming languages have many libraries for XML parsing, Fortran has less options, but some there are:

  • xml-fortran of Arjen Markus;
  • xml-f90 of Alberto Garcia;
  • fox of Andrew Walker that is an improved fork of xml-f90 of Alberto Garcia;
  • tixi from DLR Simulation and Software Technology (C-binding).

All of the above are great codes, but lack in some points that we would like to have:

  • actively maintained;
  • designed for modern Fortran:
    • OOP designed;
    • exploiting new features of Fortran (e.g. deferred length allocatable characters);
    • recreate a pure Fortran representation of the XML data (e.g. tree structure exploiting);
  • parallel architectures supported (threads/processes safety ensured);
  • extensively tested (strong unit-test regression);
  • comprehensively documented;
  • pure Fortran:
    • no wrapper;
    • no bindings, no ISO_C_BINDING;
  • be FOSS.

In some sense or other, the afore-mentioned Fortran libraries miss somethings.

Go to Top

Status

Status Build Status Coverage Status

Done

  • lint baseline code:
    • purge doxygen, format docstrings for FORD;
    • adopt best practice of Rouson;
    • clean the API: two modules, one main XML file object;
  • parse input string:
    • autoparse tags:
      • autoparse tag's name;
      • autoparse tag's value;
      • autoparse tag's attributes names;
      • autoparse tag's attributes values;
  • lazy find tag value into file (once provided a tag name);
  • parse input file;
  • fix bug on tag's attributes name parsing.

Doing

  • implement nested tags delete;
  • implement lazy find tag's value attribute into file (once provided a tag name and attribute name).

Todo

  • create team of collaborators;
  • profile the parser:
    • almost surely there are performance penalties;

Go to Top

Documentation

Besides this README file the FoXy documentation is contained into its own wiki. Detailed documentation of the API is contained into the GitHub Pages that can also be created locally by means of ford tool.

Go to Top

Copyrights

FoXy is an open source project, it is distributed under a multi-licensing system:

Anyone is interest to use, to develop or to contribute to FoXy is welcome, feel free to select the license that best matches your soul!

Go to Top

foxy's People

Contributors

jeblohe avatar marcogrossi92 avatar szaghi avatar zoziha avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

foxy's Issues

Accessing the contents of xml_tags depends on their position in the xml file.

I am trying to parse a simple xml file, based on the one you use in the "parse_file_simple" test case.

It seems to me that calling xml_file%parse gives satisfying results only when you're trying to acces the content of the first tag.

To demonstrate this, I have created 3 simple xml files (input_light_1/2/3.xml), that contain only 3 tags, "first", "second", "third", but placed in different orders.
I also wrote a minimal fortran code (parse_file_simple_LIGHT.f90), that takes a single xml file as an argument, and attends to access the content of tags "first", "second", and "third" and prints result.

You can find every file in the enclosed archive.

Any help would be greatly appreciated.
FOXY_TEST_CASE.tar.gz

File extension of foxy_xml_tag.F90

Why is the extension of "foxy_xml_tag.F90" capital?
An error was occurred on compiling VTKFortran with makefile.

I'm sorry if I'm not to the point.

GPL & MIT

I may be mistaken, but I’m pretty sure that since GPL is “copy left” you are violating the GPL license by also licensing it under the other more permissive licenses… I’m not an expert but it might be safer to just use MIT/BSD…

it's posible to hard code one XML file with FoXy?

I've seen that FoXy is ready to parse XML files, but now I need to create a new XML file from the code, is it possible?

If it is possible, Can someone post a small piece of code doing that?

Thanks!

Emitter facility

Develop the emitter facility. Tag class must be improved.

  • expose xml_file%add_tag method;
  • add xml_file%del_tag method;
  • expose xml_tag class;
  • add create method (maybe an overloaded-by-name creator function);
    • support self closing tag;
  • add set methods:
    • for name;
    • for attributes;
    • for value;
  • add del methods:
    • for attributes;
    • fof value.

Take inspiraton by the great yattag.

desiderata API

Something similar to

type(xml_tag) :: a_tag
type(xml_file) :: a_file

a_tag = xml_tag('div') ! create `<div></div>`
! add/modify/delete attributes
call a_tag%set(attributes=[['id', 'photo'], ['num', '5']]) ! become `<div id="photo" num="5"></div>`
call a_tag%set(attribute=['num', '9']) ! become `<div id="photo" num="9"></div>`
call a_tag%set(attributes=[['src', 'bar.png'], ['num', '5']]) ! become `<div id="photo" num="5" src="bar.png"></div>`
call a_tag%del(attributes=['src', 'num']) ! become `<div id="photo"></div>`
! add/modify/delete value
call a_tag%set(value='lorem ipsum'//new_line('a')//'dolor sit amet')
! become
!<div id="photo">
!lorem ipsum
!dolor sit amet
!</div>
call a_tag%set(indent=3) ! indent value
! become
!<div id="photo">
!   lorem ipsum
!   dolor sit amet
!</div>
call a_tag%del_value ! become `<div id="photo"></div>`
! add to file
call a_file%add_tag(tag=a_tag)
call a_file%add_tag(tag=a_tag)
! delete from file
call a_file%del_tag(tag=a_tag) ! by tag handler
call a_file%del_tag(tag_name='div') ! by tag name

How to build, is there a wiki

Hello,

I included the lib/ in my Fortran Project, but all the third_party dependencies are missing.

Is there an easy way to kind of install it to my system, so I automatically get all third_party dependencies and do not have to manually include lib/ files in my CMakeLists.txt?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.