Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > XML > Re: Translate XML to C++

Reply
Thread Tools

Re: Translate XML to C++

 
 
Andy Fish
Guest
Posts: n/a
 
      08-18-2003
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

<(E-Mail Removed)> wrote in message
news:bhq9vl$5e7$(E-Mail Removed)...
> 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
>
>



 
Reply With Quote
 
 
 
 
Guest
Posts: n/a
 
      08-18-2003
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" <(E-Mail Removed)> wrote in message
news:C130b.249$(E-Mail Removed)...
> 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
>
> <(E-Mail Removed)> wrote in message
> news:bhq9vl$5e7$(E-Mail Removed)...
> > 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
> >
> >

>
>



 
Reply With Quote
 
 
 
 
Nelson Clemente
Guest
Posts: n/a
 
      08-18-2003
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" <(E-Mail Removed)> wrote in message
newsn40b.304$(E-Mail Removed)...
> 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
>
>
> <(E-Mail Removed)> wrote in message
> news:bhqjdg$98o$(E-Mail Removed)...
> > 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" <(E-Mail Removed)> wrote in message
> > news:C130b.249$(E-Mail Removed)...
> > > 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
> > >
> > > <(E-Mail Removed)> wrote in message
> > > news:bhq9vl$5e7$(E-Mail Removed)...
> > > > 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
> > > >
> > > >
> > >
> > >

> >
> >

>
>



 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Re: any (preferably open source) static analysis tool or methodologies/studiesto translate ANSI [C|C++] or java code to XML? Joe Kesselman XML 0 09-28-2011 04:55 AM
Re: DBMS versus XML APIs (was "any (preferably open source) staticanalysis tool or methodologies/studies to translate ANSI [C|C++] or javacode to XML?") Joe Kesselman XML 0 09-27-2011 12:52 PM
translate XML into HTML / PDF - prg needed A.Hanemann XML 4 08-23-2005 06:35 PM
how to translate an xml file Jheroen XML 0 07-13-2004 08:45 PM
Translate XML to C++ XML 0 08-18-2003 10:32 AM



Advertisments