Velocity Reviews

Velocity Reviews (http://www.velocityreviews.com/forums/index.php)
-   XML (http://www.velocityreviews.com/forums/f32-xml.html)
-   -   Re: Translate XML to C++ (http://www.velocityreviews.com/forums/t165433-re-translate-xml-to-c.html)

Andy Fish 08-18-2003 11:47 AM

Re: Translate XML to C++
 
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

<nelson@ece.curtin.edu.au> wrote in message
news:bhq9vl$5e7$1@yeppa.connect.com.au...
> 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
>
>




08-18-2003 01:13 PM

Re: Translate XML to C++
 
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" <ajfish@blueyonder.co.uk> wrote in message
news:C130b.249$dd4.2776213@news-text.cableinet.net...
> 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
>
> <nelson@ece.curtin.edu.au> wrote in message
> news:bhq9vl$5e7$1@yeppa.connect.com.au...
> > 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 08-18-2003 04:25 PM

Re: Translate XML to C++
 
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" <ajfish@blueyonder.co.uk> wrote in message
news:xn40b.304$7P4.3267714@news-text.cableinet.net...
> 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
>
>
> <nelson@ece.curtin.edu.au> wrote in message
> news:bhqjdg$98o$1@yeppa.connect.com.au...
> > 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" <ajfish@blueyonder.co.uk> wrote in message
> > news:C130b.249$dd4.2776213@news-text.cableinet.net...
> > > 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
> > >
> > > <nelson@ece.curtin.edu.au> wrote in message
> > > news:bhq9vl$5e7$1@yeppa.connect.com.au...
> > > > 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
> > > >
> > > >
> > >
> > >

> >
> >

>
>





All times are GMT. The time now is 09:18 PM.

Powered by vBulletin®. Copyright ©2000 - 2014, vBulletin Solutions, Inc.
SEO by vBSEO ©2010, Crawlability, Inc.