fortran-foss-programmers / foxy Goto Github PK
View Code? Open in Web Editor NEWFortran XML parser for poor people
Fortran XML parser for poor people
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
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?
Develop the emitter facility. Tag class must be improved.
xml_file%add_tag
method;xml_file%del_tag
method;xml_tag
class;create
method (maybe an overloaded-by-name creator function);
set
methods:
del
methods:
Take inspiraton by the great yattag.
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
Adopt StringiFor for strings manipulaiton: a new class string
is now ready to be used to boost FoXy (and others). Adopt it.
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!
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.
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…
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.