Re: Translate XML to C++

Discussion in 'XML' started by Andy Fish, Aug 18, 2003.

  1. Andy Fish

    Andy Fish Guest

    it depends what you mean by translating an XML document into C++

    if you want to generate a C++ source file with declarations for variables
    and structures generated from an XML file, then XSLT may be an appropriate
    way to do it

    if you have a piece of XML and you just want to write a C++ program that
    manipulates it, you don't need XSLT - you need a C++ DOM parser

    <> wrote in message
    news:bhq9vl$5e7$...
    > Hi I am new to XML.
    >
    > I want to build a translator that would turn an XML document into C++

    syntax
    > and visa versa.
    >
    > Do I do this through XSLT?? I'm not sure where to start as I have just
    > started to learn about technologies related to XML.
    >
    > Thankyou!
    >
    > -Nelson
    >
    >
     
    Andy Fish, Aug 18, 2003
    #1
    1. Advertising

  2. Andy Fish

    Guest Guest

    Hi Andy

    I need to be able to write code in XML... for a simple example consider an
    imaginary language that does this...

    new terminator() = $T1, $T2;
    $T1.label = "start";
    $T2.label = "finish";

    It could be automatically translated into something like this...

    <terminator ID="T1" label="start" />
    <terminator ID="T2" label="finish" />

    If you do it originally in XML... it can be translated back to the
    programming language's grammar.

    The idea behind this is to allow someone to quickly write a program without
    any knowledge of XML that can be converted to XML and interpreted somewhere
    else. So I guess XSLT is the way to go to do this?

    Thanks!

    -Nelson Clemente

    "Andy Fish" <> wrote in message
    news:C130b.249$...
    > it depends what you mean by translating an XML document into C++
    >
    > if you want to generate a C++ source file with declarations for variables
    > and structures generated from an XML file, then XSLT may be an appropriate
    > way to do it
    >
    > if you have a piece of XML and you just want to write a C++ program that
    > manipulates it, you don't need XSLT - you need a C++ DOM parser
    >
    > <> wrote in message
    > news:bhq9vl$5e7$...
    > > Hi I am new to XML.
    > >
    > > I want to build a translator that would turn an XML document into C++

    > syntax
    > > and visa versa.
    > >
    > > Do I do this through XSLT?? I'm not sure where to start as I have just
    > > started to learn about technologies related to XML.
    > >
    > > Thankyou!
    > >
    > > -Nelson
    > >
    > >

    >
    >
     
    Guest, Aug 18, 2003
    #2
    1. Advertising

  3. I am developing a scripting language for the blind for a masters project
    using XML & SVG that would allow them to draw objects in an interactive
    manner. Are you aware of one that already fits this description?

    -Nelson Clemente

    "Andy Fish" <> wrote in message
    news:xn40b.304$...
    > well, you can certainly use XSLT to generate source code from XML. whether
    > that is the best solution depends partly on how you intend to interpret or
    > compile that source code.
    >
    > However, If you're about to invent a new scripting language, be it XML

    based
    > or otherwise, I would strongly suggest that you first look around to see
    > whether an existing language meets your requrements. The world is overrun
    > with scripting languages and many of the best are very extensible
    >
    >
    > <> wrote in message
    > news:bhqjdg$98o$...
    > > Hi Andy
    > >
    > > I need to be able to write code in XML... for a simple example consider

    an
    > > imaginary language that does this...
    > >
    > > new terminator() = $T1, $T2;
    > > $T1.label = "start";
    > > $T2.label = "finish";
    > >
    > > It could be automatically translated into something like this...
    > >
    > > <terminator ID="T1" label="start" />
    > > <terminator ID="T2" label="finish" />
    > >
    > > If you do it originally in XML... it can be translated back to the
    > > programming language's grammar.
    > >
    > > The idea behind this is to allow someone to quickly write a program

    > without
    > > any knowledge of XML that can be converted to XML and interpreted

    > somewhere
    > > else. So I guess XSLT is the way to go to do this?
    > >
    > > Thanks!
    > >
    > > -Nelson Clemente
    > >
    > > "Andy Fish" <> wrote in message
    > > news:C130b.249$...
    > > > it depends what you mean by translating an XML document into C++
    > > >
    > > > if you want to generate a C++ source file with declarations for

    > variables
    > > > and structures generated from an XML file, then XSLT may be an

    > appropriate
    > > > way to do it
    > > >
    > > > if you have a piece of XML and you just want to write a C++ program

    that
    > > > manipulates it, you don't need XSLT - you need a C++ DOM parser
    > > >
    > > > <> wrote in message
    > > > news:bhq9vl$5e7$...
    > > > > Hi I am new to XML.
    > > > >
    > > > > I want to build a translator that would turn an XML document into

    C++
    > > > syntax
    > > > > and visa versa.
    > > > >
    > > > > Do I do this through XSLT?? I'm not sure where to start as I have

    > just
    > > > > started to learn about technologies related to XML.
    > > > >
    > > > > Thankyou!
    > > > >
    > > > > -Nelson
    > > > >
    > > > >
    > > >
    > > >

    > >
    > >

    >
    >
     
    Nelson Clemente, Aug 18, 2003
    #3
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Sridhar Hegde
    Replies:
    2
    Views:
    2,531
    Ajeetha Kumari
    Sep 13, 2004
  2. Guest

    Translate XML to C++

    Guest, Aug 18, 2003, in forum: XML
    Replies:
    0
    Views:
    606
    Guest
    Aug 18, 2003
  3. Jheroen

    how to translate an xml file

    Jheroen, Jul 13, 2004, in forum: XML
    Replies:
    0
    Views:
    391
    Jheroen
    Jul 13, 2004
  4. A.Hanemann
    Replies:
    4
    Views:
    508
    Gerald Aichholzer
    Aug 23, 2005
  5. Erik Wasser
    Replies:
    5
    Views:
    465
    Peter J. Holzer
    Mar 5, 2006
Loading...

Share This Page