Mailing List Archive: 49091 messages
  • Home
  • Script library
  • AltME Archive
  • Mailing list
  • Articles Index
  • Site search
 

[REBOL] Re: Rebol and XML processing

From: al:bri:xtra at: 9-Sep-2002 12:12

One could use my ML dialect to generate the XML from Rebol values, for example: [ Rebol [] print ML [ Products [ Item [ Name "Apple" Description "Japan-import Big Red Apple" Unit-Price $5.70 Inventory 1200 Inventory-Safe-Level 1000 ] Item [ Name "Orange" Description "Juicy Sweet Orange" Unit-Price $0.45 Inventory 800 Inventory-Safe-Level 1000 ] Item [ Name "Watermelon" Description "Yellow-meat Juicy Melon" Unit-Price $2.05 Inventory 250 Inventory-Safe-Level 200 ] ] ] print ML [ <?xml version="1.0"?> INSTALL/script %install.gsl FILE/name/type %gslgen.exe "binary" FILE/name/type %gslgen.htm "doc" FILE/name/type %install.gsl "script" FILE/name/type %hello.gsl "script" ] halt ] <!-- Output Which produces (lines broken for clarity): <Products> <Item><Name>Apple</Name><Description>Japan-import Big Red Apple</Description> <Unit-Price>$5.70</Unit-Price><Inventory>1200</Inventory><Inventory-Safe-Level>1000</Inventory-Safe-Level></Item> <Item><Name>Orange</Name><Description>Juicy Sweet Orange</Description> <Unit-Price>$0.45</Unit-Price><Inventory>800</Inventory><Inventory-Safe-Level>1000</Inventory-Safe-Level></Item> <Item><Name>Watermelon</Name><Description>Yellow-meat Juicy Melon</Description> <Unit-Price>$2.05</Unit-Price><Inventory>250</Inventory><Inventory-Safe-Level>200</Inventory-Safe-Level></Item></Products> <?xml version="1.0"?> <INSTALL script="install.gsl" /> <FILE name="gslgen.exe" type="binary" /> <FILE name="gslgen.htm" type="doc" /> <FILE name="install.gsl" type="script" /> <FILE name="hello.gsl" type="script" /> --> Andrew Martin -><-
> From: [reffy--ulrich--net] > Date: 2002/09/09 Mon AM 05:58:15 GMT+12:00 > To: [rebol-list--rebol--com] > Subject: [REBOL] Rebol and XML processing > > What can Rebol do with XML? Is there a native type for XML in Rebol? > > The following snipped from the XPS language? It internalizes xml object as a vector of vectors on the assignment. > > data = <!--xml > <Products> > <Item> > <Name>Apple</Name> > <Description>Japan-import Big Red Apple</Description> > <Unit-Price>5.70</Unit-Price> > <Inventory>1200</Inventory> > <Inventory-Safe-Level>1000</Inventory-Safe-Level> > </Item> > <Item> > <Name>Orange</Name> > <Description>Juicy Sweet Orange</Description> > <Unit-Price>0.45</Unit-Price> > <Inventory>800</Inventory> > <Inventory-Safe-Level>1000</Inventory-Safe-Level> > </Item> > <Item> > <Name>Watermelon</Name> > <Description>Yellow-meat Juicy Melon</Description> > <Unit-Price>2.05</Unit-Price> > <Inventory>250</Inventory> > <Inventory-Safe-Level>200</Inventory-Safe-Level> > </Item> > </Products> > xml-->; > > Then this one from gslgen utility: > > <?xml version="1.0"?> > <INSTALL script="install.gsl"> > <FILE name="gslgen.exe" type="binary" /> > <FILE name="gslgen.htm" type="doc" /> > <FILE name="install.gsl" type="script" /> > <FILE name="hello.gsl" type="script" /> > </INSTALL> > > Notice in the second one that the values must be quoted. > > Dick > > Download NeoPlanet at http://www.neoplanet.com > > -- > To unsubscribe from this list, please send an email to > [rebol-request--rebol--com] with "unsubscribe" in the > subject, without the quotes. >
Andrew Martin