Thread: CPP file to XML & SVG Help

  1. #1
    Registered User
    Join Date
    Mar 2008
    Posts
    85

    Unhappy CPP file to XML & SVG Help

    Hi
    i have got a working program in a cpp file.
    But i need to show it with SVG and XML. which is animation graphic...
    anybody got an idea of how to create such thing?
    thanks thanks

  2. #2
    and the hat of int overfl Salem's Avatar
    Join Date
    Aug 2001
    Location
    The edge of the known universe
    Posts
    39,660
    Code:
    cout << "<svg>" << endl;
    // a bunch of other stuff
    cout << "</svg>" << endl;
    If you dance barefoot on the broken glass of undefined behaviour, you've got to expect the occasional cut.
    If at first you don't succeed, try writing your phone number on the exam paper.

  3. #3
    Registered User
    Join Date
    Mar 2008
    Posts
    85
    Sorry any further detail????
    thanks

  4. #4
    Jack of many languages Dino's Avatar
    Join Date
    Nov 2007
    Location
    Chappell Hill, Texas
    Posts
    2,332
    With the meager information you have provided, there's a lot of areas that could be guessed for what you want to know.

    It might be better for you to be a little more explicit than
    ...anybody got an idea of how to create such thing?...
    Mainframe assembler programmer by trade. C coder when I can.

  5. #5
    Registered User
    Join Date
    Mar 2008
    Posts
    85
    haha i am so sorry

    Here i hv a program here which is CPP file.
    I need to show it by SVG, i hv heard i need to convert to XML first and use XSLT
    Really duno

  6. #6
    Cat without Hat CornedBee's Avatar
    Join Date
    Apr 2003
    Posts
    8,895
    What do you mean, you have to show the CPP file in SVG? The source code or the graphical output?

    Eh, in both cases, it has very little to do with C++. It's a matter of generating SVG. It basically comes down to writing text, and you can do that, right? I mean, it's like a Hello World program. That's as far as the C++ part of it goes.

    Now, generating the right SVG is something else, but it has nothing to do with C++.
    All the buzzt!
    CornedBee

    "There is not now, nor has there ever been, nor will there ever be, any programming language in which it is the least bit difficult to write bad code."
    - Flon's Law

  7. #7
    and the hat of int overfl Salem's Avatar
    Join Date
    Aug 2001
    Location
    The edge of the known universe
    Posts
    39,660
    > I need to show it by SVG, i hv heard i need to convert to XML first and use XSLT
    Well you're already outputting plenty of XML, and certainly XSLT is ONE way of getting from the XML to SVG, but that's really off-topic for this forum.

    At the very least, you need to familiarise yourself with the SVG spec. I think a <defs> to define the shape of an ant, and lots of <use> to draw ants all over the map may be useful to you.
    If you dance barefoot on the broken glass of undefined behaviour, you've got to expect the occasional cut.
    If at first you don't succeed, try writing your phone number on the exam paper.

  8. #8
    Registered User
    Join Date
    Mar 2008
    Posts
    85
    i need to show the graphical output.

    I have read some tread about I can use the CPP2XML to convert CPP to XML
    And from XML to SVG

    Any1heard about this?
    thanks

  9. #9
    Cat without Hat CornedBee's Avatar
    Join Date
    Apr 2003
    Posts
    8,895
    It's not what you want. CPP2XML can only generate some representation of your program as XML. This has nothing at all to do with graphical output.
    All the buzzt!
    CornedBee

    "There is not now, nor has there ever been, nor will there ever be, any programming language in which it is the least bit difficult to write bad code."
    - Flon's Law

  10. #10
    Registered User
    Join Date
    Mar 2008
    Posts
    85
    o god
    so how much time you think I need to convert my file to XML and SVG?
    Coz the file is huge
    thanks

  11. #11
    Registered User
    Join Date
    Mar 2008
    Posts
    85
    so how do i start to convert them to XML and SVG?
    plz help
    this topic is very rare...
    thx

  12. #12
    Cat without Hat CornedBee's Avatar
    Join Date
    Apr 2003
    Posts
    8,895
    It appears that you're extremely confused over what you want. You also seem to be unclear on what XML and SVG are, exactly. And on how the C++ execution model works.

    So all in all, it's going to take you a long time, because you'll have to learn a lot of basics.
    All the buzzt!
    CornedBee

    "There is not now, nor has there ever been, nor will there ever be, any programming language in which it is the least bit difficult to write bad code."
    - Flon's Law

  13. #13
    Registered User
    Join Date
    Mar 2008
    Posts
    85
    but how do i start with ??
    now the code is complete, and the exe file is ready

    So what's the first thing i need to do to convert them plz??

    ---- really ---- running --- out ---- of --- time---
    ------------------thx-- ur--- great--- help======

  14. #14
    Cat without Hat CornedBee's Avatar
    Join Date
    Apr 2003
    Posts
    8,895
    The program already creates XML! All you need to do is write an XSLT to convert that XML to SVG.

    If you don't know XSLT and you're out of time, then I'd say you're out of luck as well. Next time, start your assignments earlier.

    XSLT is not the topic of this board. If you're feeling optimistic, you can ask questions about it on the Tech Board. However, you can't ask for someone to do this for you.
    All the buzzt!
    CornedBee

    "There is not now, nor has there ever been, nor will there ever be, any programming language in which it is the least bit difficult to write bad code."
    - Flon's Law

  15. #15
    Registered User
    Join Date
    Mar 2008
    Posts
    85
    i hv 30 days to hand in this work...
    I started the C too late as well

    can you tell me wt topic and book i need and I will lock myself up in the house for 30 days
    plz help

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Data Structure Eror
    By prominababy in forum C Programming
    Replies: 3
    Last Post: 01-06-2009, 09:35 AM
  2. Formatting a text file...
    By dagorsul in forum C Programming
    Replies: 12
    Last Post: 05-02-2008, 03:53 AM
  3. Formatting the contents of a text file
    By dagorsul in forum C++ Programming
    Replies: 2
    Last Post: 04-29-2008, 12:36 PM
  4. Can we have vector of vector?
    By ketu1 in forum C++ Programming
    Replies: 24
    Last Post: 01-03-2008, 05:02 AM
  5. Replies: 2
    Last Post: 04-09-2006, 07:20 PM