Like Tree4Likes
  • 1 Post By Malcolm McLean
  • 3 Post By iMalc

XML parsing without using a parser

This is a discussion on XML parsing without using a parser within the C Programming forums, part of the General Programming Boards category; hello i have some UML models given in the form of XMI files and i need to load these model ...

  1. #1
    Registered User
    Join Date
    Dec 2012
    Posts
    1

    XML parsing without using a parser

    hello

    i have some UML models given in the form of XMI files and i need to load these model in to memory to do some manipulations. so for this im planning on using C , without using a 3rd party parser.
    i would be grateful to you all if you can give me some pointers that can be helpful to achieve this task.

  2. #2
    Registered User
    Join Date
    May 2012
    Posts
    333
    Go onto my website and download the vanilla xml parser.
    It's not a complete parser, hence the "vanilla", but it will almost certainly do what you want.
    stahta01 likes this.
    I'm the author of MiniBasic: How to write a script interpreter and Basic Algorithms
    Visit my website for lots of associated C programming resources.
    http://www.malcolmmclean.site11.com/www

  3. #3
    Super Moderator
    Join Date
    Sep 2001
    Posts
    4,913
    If you do want to write your own, it isn't too complicated. Look up "recursive descent parser" and it should give you some ideas for a simple way to structure your algorithm. You should also be familiar with all the C functions for processing strings like strtok, etc.

    edit: What iMalc says below is true. Writing an XML parser can be a good learning exercise, but if this is for real work, the benefits of using a proven xml parser far outweigh any drawbacks.

  4. #4
    Algorithm Dissector iMalc's Avatar
    Join Date
    Dec 2005
    Location
    New Zealand
    Posts
    6,308
    Every time some project at work has been done without a proper XML parser, or any time the third party component didn't use a proper XML parser, it has gone badly wrong. I stongly urge you to not even think of going there.
    I'm sorry but all you'll get out of me on this endevaour will be an "I told you so".
    Salem, stahta01 and laserlight like this.
    My homepage
    Advice: Take only as directed - If symptoms persist, please see your debugger

    Linus Torvalds: "But it clearly is the only right way. The fact that everybody else does it some other way only means that they are wrong"

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. xml parser
    By holbond in forum C Programming
    Replies: 1
    Last Post: 10-10-2011, 07:01 AM
  2. Replies: 2
    Last Post: 03-11-2011, 04:45 AM
  3. String parsing(parsing comments out of HTML file)
    By slcjoey in forum C# Programming
    Replies: 0
    Last Post: 07-29-2006, 09:28 PM
  4. Parser - need help!
    By thelma in forum C Programming
    Replies: 2
    Last Post: 04-05-2004, 09:06 PM
  5. which parser to use?
    By Ruchikar in forum Windows Programming
    Replies: 0
    Last Post: 07-25-2002, 03:02 AM

Tags for this Thread


1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21