Creating XML file

classic Classic list List threaded Threaded
10 messages Options
Reply | Threaded
Open this post in threaded view
|

Creating XML file

detlef.hebbel
This is a 'first time XML for me. May I please ask to get some help:

I have a simple database with two fields:
'Last_Name'
'Location'

  I want Lasso to create an xml file called MyNames.xml.

This is what I have so far:

[Inline:
-Database='MyDatabase',
-Table='MyTable',
-KeyField='Internal Record ID',
'Location'='USA',
-Search]

<Names>
[Records]
<NameInfo>
<LastName>[Field: 'Last_Name']</LastName>
<Location>[Field: 'Location']</Location>
</NameInfo>
[/Records]
</Names>
[/Inline]


When I write the above code into a file "MyNames.lasso" I get an  
output with names and location, the resulting source code is ok and I  
can copy/paste it into and .xml file and use it. But what I need, is  
that Lasso creates (writes/saves) a ready to use file called  
"MyNames.xml".

Any help would be appreciated.

Cheers
Detlef

--
This list is a free service of LassoSoft: http://www.LassoSoft.com/
Search the list archives: http://www.ListSearch.com/Lasso/Browse/
Manage your subscription: http://www.ListSearch.com/Lasso/

Reply | Threaded
Open this post in threaded view
|

Re: Creating XML file

stevepiercy
Set a var and append it with the file contents, then write the contents to a file, like so:

var('my_file'   = '');

inline(...stuff...);
$my_file+='<Names>
';
Records;
$my_file+='<NameInfo>
<LastName>'Field('Last_Name')'</LastName>
<Location>'Field('Location')'</Location>
</NameInfo>
';
/Records;
$my_file+='</Names>';

file_write('MyNames.xml', $my_file, -fileoverwrite);

/inline;

If you need help with file permissions, see my guide:
<http://stevepiercy.com/lasso_stuff/file_perms.lasso>

--steve




On Wednesday, December 12, 2007, [hidden email] (Detlef Hebbel) pronounced:

>This is a 'first time XML for me. May I please ask to get some help:
>
>I have a simple database with two fields:
>'Last_Name'
>'Location'
>
>  I want Lasso to create an xml file called MyNames.xml.
>
>This is what I have so far:
>
>[Inline:
>-Database='MyDatabase',
>-Table='MyTable',
>-KeyField='Internal Record ID',
>'Location'='USA',
>-Search]
>
><Names>
>[Records]
><NameInfo>
><LastName>[Field: 'Last_Name']</LastName>
><Location>[Field: 'Location']</Location>
></NameInfo>
>[/Records]
></Names>
>[/Inline]
>
>
>When I write the above code into a file "MyNames.lasso" I get an  
>output with names and location, the resulting source code is ok and I  
>can copy/paste it into and .xml file and use it. But what I need, is  
>that Lasso creates (writes/saves) a ready to use file called  
>"MyNames.xml".
>
>Any help would be appreciated.
>
>Cheers
>Detlef
>

-- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
Steve Piercy               Web Site Builder               Soquel, CA
<[hidden email]>                  <http://www.StevePiercy.com/>

--
This list is a free service of LassoSoft: http://www.LassoSoft.com/
Search the list archives: http://www.ListSearch.com/Lasso/Browse/
Manage your subscription: http://www.ListSearch.com/Lasso/

Reply | Threaded
Open this post in threaded view
|

Re: Creating XML file

Laurent-40
In reply to this post by detlef.hebbel
you can also use :

[Variable: 'XMLData' = '<?xml version="1.0" encoding="iso-8859-1"?>
<rss version="2.0" ...>

     <channel>

  ...
     </channel>
</rss>
']
[XML_Serve: $XMLData]

Add a [cache]  tag to avoid server overload if necessary.


Laurent


On 11-Dec-07, at 8:57 PM, Detlef Hebbel wrote:

> This is a 'first time XML for me. May I please ask to get some help:
>
> I have a simple database with two fields:
> 'Last_Name'
> 'Location'
>
> I want Lasso to create an xml file called MyNames.xml.
>
> This is what I have so far:
>
> [Inline:
> -Database='MyDatabase',
> -Table='MyTable',
> -KeyField='Internal Record ID',
> 'Location'='USA',
> -Search]
>
> <Names>
> [Records]
> <NameInfo>
> <LastName>[Field: 'Last_Name']</LastName>
> <Location>[Field: 'Location']</Location>
> </NameInfo>
> [/Records]
> </Names>
> [/Inline]
>
>
> When I write the above code into a file "MyNames.lasso" I get an  
> output with names and location, the resulting source code is ok and  
> I can copy/paste it into and .xml file and use it. But what I need,  
> is that Lasso creates (writes/saves) a ready to use file called  
> "MyNames.xml".
>
> Any help would be appreciated.
>
> Cheers
> Detlef
>
> --
> This list is a free service of LassoSoft: http://www.LassoSoft.com/
> Search the list archives: http://www.ListSearch.com/Lasso/Browse/
> Manage your subscription: http://www.ListSearch.com/Lasso/
>


--
This list is a free service of LassoSoft: http://www.LassoSoft.com/
Search the list archives: http://www.ListSearch.com/Lasso/Browse/
Manage your subscription: http://www.ListSearch.com/Lasso/

Reply | Threaded
Open this post in threaded view
|

Re: Creating XML file

detlef.hebbel
In reply to this post by stevepiercy
Thank you very much, but I cannot find the error(s). Can you have a  
look at the total script. Thanks


<?LassoScript

var('my_file'   = 'MyNames.xml');

Inline:
-Database='Names';
-Table=ClientNames';
'Location'='USA';
-Search;


$my_file+='<Names>
';
Records;
$my_file+='<NameInfo>
<LastName>'Field('Last_Name')'</LastName>
<Location>'Field('Location')'</Location>
</NameInfo>
';
/Records;
$my_file+='</Names>';

file_write('MyNames.xml', $my_file, -fileoverwrite);

/inline;

?>



On Dec 12, 2007, at 3:23 PM, Steve Piercy - Web Site Builder wrote:

> Set a var and append it with the file contents, then write the  
> contents to a file, like so:
>
> var('my_file'   = '');
>
> inline(...stuff...);
> $my_file+='<Names>
> ';
> Records;
> $my_file+='<NameInfo>
> <LastName>'Field('Last_Name')'</LastName>
> <Location>'Field('Location')'</Location>
> </NameInfo>
> ';
> /Records;
> $my_file+='</Names>';
>
> file_write('MyNames.xml', $my_file, -fileoverwrite);
>
> /inline;
>
> If you need help with file permissions, see my guide:
> <http://stevepiercy.com/lasso_stuff/file_perms.lasso>
>
> --steve
>
>
>
>
> On Wednesday, December 12, 2007, [hidden email] (Detlef  
> Hebbel) pronounced:
>
>> This is a 'first time XML for me. May I please ask to get some help:
>>
>> I have a simple database with two fields:
>> 'Last_Name'
>> 'Location'
>>
>> I want Lasso to create an xml file called MyNames.xml.
>>
>> This is what I have so far:
>>
>> [Inline:
>> -Database='MyDatabase',
>> -Table='MyTable',
>> -KeyField='Internal Record ID',
>> 'Location'='USA',
>> -Search]
>>
>> <Names>
>> [Records]
>> <NameInfo>
>> <LastName>[Field: 'Last_Name']</LastName>
>> <Location>[Field: 'Location']</Location>
>> </NameInfo>
>> [/Records]
>> </Names>
>> [/Inline]
>>
>>
>> When I write the above code into a file "MyNames.lasso" I get an
>> output with names and location, the resulting source code is ok and I
>> can copy/paste it into and .xml file and use it. But what I need, is
>> that Lasso creates (writes/saves) a ready to use file called
>> "MyNames.xml".
>>
>> Any help would be appreciated.
>>
>> Cheers
>> Detlef
>>
>
> -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
> Steve Piercy               Web Site Builder               Soquel, CA
> <[hidden email]>                  <http://www.StevePiercy.com/>
>
> --
> This list is a free service of LassoSoft: http://www.LassoSoft.com/
> Search the list archives: http://www.ListSearch.com/Lasso/Browse/
> Manage your subscription: http://www.ListSearch.com/Lasso/
>


--
This list is a free service of LassoSoft: http://www.LassoSoft.com/
Search the list archives: http://www.ListSearch.com/Lasso/Browse/
Manage your subscription: http://www.ListSearch.com/Lasso/

Reply | Threaded
Open this post in threaded view
|

Re: Creating XML file

stevepiercy
You were missing a quote in your inline for the -Table parameter.

Inline:
-Database='Names';
-Table='ClientNames';
'Location'='USA';
-Search;

--steve


On Wednesday, December 12, 2007, [hidden email] (Detlef Hebbel) pronounced:

>Thank you very much, but I cannot find the error(s). Can you have a  
>look at the total script. Thanks
>
>
><?LassoScript
>
>var('my_file'   = 'MyNames.xml');
>
>Inline:
>-Database='Names';
>-Table=ClientNames';
>'Location'='USA';
>-Search;
>
>
>$my_file+='<Names>
>';
>Records;
>$my_file+='<NameInfo>
><LastName>'Field('Last_Name')'</LastName>
><Location>'Field('Location')'</Location>
></NameInfo>
>';
>/Records;
>$my_file+='</Names>';
>
>file_write('MyNames.xml', $my_file, -fileoverwrite);
>
>/inline;
>
>?>
>
>
>
>On Dec 12, 2007, at 3:23 PM, Steve Piercy - Web Site Builder wrote:
>
>> Set a var and append it with the file contents, then write the  
>> contents to a file, like so:
>>
>> var('my_file'   = '');
>>
>> inline(...stuff...);
>> $my_file+='<Names>
>> ';
>> Records;
>> $my_file+='<NameInfo>
>> <LastName>'Field('Last_Name')'</LastName>
>> <Location>'Field('Location')'</Location>
>> </NameInfo>
>> ';
>> /Records;
>> $my_file+='</Names>';
>>
>> file_write('MyNames.xml', $my_file, -fileoverwrite);
>>
>> /inline;
>>
>> If you need help with file permissions, see my guide:
>> <http://stevepiercy.com/lasso_stuff/file_perms.lasso>
>>
>> --steve
>>
>>
>>
>>
>> On Wednesday, December 12, 2007, [hidden email] (Detlef  
>> Hebbel) pronounced:
>>
>>> This is a 'first time XML for me. May I please ask to get some help:
>>>
>>> I have a simple database with two fields:
>>> 'Last_Name'
>>> 'Location'
>>>
>>> I want Lasso to create an xml file called MyNames.xml.
>>>
>>> This is what I have so far:
>>>
>>> [Inline:
>>> -Database='MyDatabase',
>>> -Table='MyTable',
>>> -KeyField='Internal Record ID',
>>> 'Location'='USA',
>>> -Search]
>>>
>>> <Names>
>>> [Records]
>>> <NameInfo>
>>> <LastName>[Field: 'Last_Name']</LastName>
>>> <Location>[Field: 'Location']</Location>
>>> </NameInfo>
>>> [/Records]
>>> </Names>
>>> [/Inline]
>>>
>>>
>>> When I write the above code into a file "MyNames.lasso" I get an
>>> output with names and location, the resulting source code is ok and I
>>> can copy/paste it into and .xml file and use it. But what I need, is
>>> that Lasso creates (writes/saves) a ready to use file called
>>> "MyNames.xml".
>>>
>>> Any help would be appreciated.
>>>
>>> Cheers
>>> Detlef
>>>
>>
>> -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
>> Steve Piercy               Web Site Builder               Soquel, CA
>> <[hidden email]>                  <http://www.StevePiercy.com/>
>>
>> --
>> This list is a free service of LassoSoft: http://www.LassoSoft.com/
>> Search the list archives: http://www.ListSearch.com/Lasso/Browse/
>> Manage your subscription: http://www.ListSearch.com/Lasso/
>>
>
>

-- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
Steve Piercy               Web Site Builder               Soquel, CA
<[hidden email]>                  <http://www.StevePiercy.com/>

--
This list is a free service of LassoSoft: http://www.LassoSoft.com/
Search the list archives: http://www.ListSearch.com/Lasso/Browse/
Manage your subscription: http://www.ListSearch.com/Lasso/

Reply | Threaded
Open this post in threaded view
|

Re: Creating XML file

stevepiercy
Ack!  And where did those extra ; come from?

Inline:
-Database='Names',
-Table='ClientNames',
'Location'='USA',
-Search;

--steve


On Tuesday, December 11, 2007, [hidden email] (Steve Piercy - Web Site Builder) pronounced:

>You were missing a quote in your inline for the -Table parameter.
>
>Inline:
>-Database='Names';
>-Table='ClientNames';
>'Location'='USA';
>-Search;
>
>--steve
>
>
>On Wednesday, December 12, 2007, [hidden email] (Detlef Hebbel) pronounced:
>
>>Thank you very much, but I cannot find the error(s). Can you have a  
>>look at the total script. Thanks
>>
>>
>><?LassoScript
>>
>>var('my_file'   = 'MyNames.xml');
>>
>>Inline:
>>-Database='Names';
>>-Table=ClientNames';
>>'Location'='USA';
>>-Search;
>>
>>
>>$my_file+='<Names>
>>';
>>Records;
>>$my_file+='<NameInfo>
>><LastName>'Field('Last_Name')'</LastName>
>><Location>'Field('Location')'</Location>
>></NameInfo>
>>';
>>/Records;
>>$my_file+='</Names>';
>>
>>file_write('MyNames.xml', $my_file, -fileoverwrite);
>>
>>/inline;
>>
>>?>
>>
>>
>>
>>On Dec 12, 2007, at 3:23 PM, Steve Piercy - Web Site Builder wrote:
>>
>>> Set a var and append it with the file contents, then write the  
>>> contents to a file, like so:
>>>
>>> var('my_file'   = '');
>>>
>>> inline(...stuff...);
>>> $my_file+='<Names>
>>> ';
>>> Records;
>>> $my_file+='<NameInfo>
>>> <LastName>'Field('Last_Name')'</LastName>
>>> <Location>'Field('Location')'</Location>
>>> </NameInfo>
>>> ';
>>> /Records;
>>> $my_file+='</Names>';
>>>
>>> file_write('MyNames.xml', $my_file, -fileoverwrite);
>>>
>>> /inline;
>>>
>>> If you need help with file permissions, see my guide:
>>> <http://stevepiercy.com/lasso_stuff/file_perms.lasso>
>>>
>>> --steve
>>>
>>>
>>>
>>>
>>> On Wednesday, December 12, 2007, [hidden email] (Detlef  
>>> Hebbel) pronounced:
>>>
>>>> This is a 'first time XML for me. May I please ask to get some help:
>>>>
>>>> I have a simple database with two fields:
>>>> 'Last_Name'
>>>> 'Location'
>>>>
>>>> I want Lasso to create an xml file called MyNames.xml.
>>>>
>>>> This is what I have so far:
>>>>
>>>> [Inline:
>>>> -Database='MyDatabase',
>>>> -Table='MyTable',
>>>> -KeyField='Internal Record ID',
>>>> 'Location'='USA',
>>>> -Search]
>>>>
>>>> <Names>
>>>> [Records]
>>>> <NameInfo>
>>>> <LastName>[Field: 'Last_Name']</LastName>
>>>> <Location>[Field: 'Location']</Location>
>>>> </NameInfo>
>>>> [/Records]
>>>> </Names>
>>>> [/Inline]
>>>>
>>>>
>>>> When I write the above code into a file "MyNames.lasso" I get an
>>>> output with names and location, the resulting source code is ok and I
>>>> can copy/paste it into and .xml file and use it. But what I need, is
>>>> that Lasso creates (writes/saves) a ready to use file called
>>>> "MyNames.xml".
>>>>
>>>> Any help would be appreciated.
>>>>
>>>> Cheers
>>>> Detlef
>>>>
>>>
>>> -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
>>> Steve Piercy               Web Site Builder               Soquel, CA
>>> <[hidden email]>                  <http://www.StevePiercy.com/>
>>>
>>> --
>>> This list is a free service of LassoSoft: http://www.LassoSoft.com/
>>> Search the list archives: http://www.ListSearch.com/Lasso/Browse/
>>> Manage your subscription: http://www.ListSearch.com/Lasso/
>>>
>>
>>
>
>-- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
>Steve Piercy               Web Site Builder               Soquel, CA
><[hidden email]>                  <http://www.StevePiercy.com/>
>

-- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
Steve Piercy               Web Site Builder               Soquel, CA
<[hidden email]>                  <http://www.StevePiercy.com/>

--
This list is a free service of LassoSoft: http://www.LassoSoft.com/
Search the list archives: http://www.ListSearch.com/Lasso/Browse/
Manage your subscription: http://www.ListSearch.com/Lasso/

Reply | Threaded
Open this post in threaded view
|

Re: Creating XML file

Steffan A. Cline
In reply to this post by detlef.hebbel
on 12/11/07 8:31 PM, Detlef Hebbel at [hidden email] wrote:

> Thank you very much, but I cannot find the error(s). Can you have a
> look at the total script. Thanks
>
>
> <?LassoScript
>
> var('my_file'   = 'MyNames.xml');
>
> Inline:
> -Database='Names';
> -Table=ClientNames';
> 'Location'='USA';
> -Search;
>
>
> $my_file+='<Names>
> ';
> Records;
> $my_file+='<NameInfo>
> <LastName>'Field('Last_Name')'</LastName>
> <Location>'Field('Location')'</Location>
> </NameInfo>
> ';
> /Records;
> $my_file+='</Names>';
>
> file_write('MyNames.xml', $my_file, -fileoverwrite);
>
> /inline;
>
> ?>
>
>
>
> On Dec 12, 2007, at 3:23 PM, Steve Piercy - Web Site Builder wrote:
>
>> Set a var and append it with the file contents, then write the
>> contents to a file, like so:
>>
>> var('my_file'   = '');
>>
>> inline(...stuff...);
>> $my_file+='<Names>
>> ';
>> Records;
>> $my_file+='<NameInfo>
>> <LastName>'Field('Last_Name')'</LastName>
>> <Location>'Field('Location')'</Location>
>> </NameInfo>
>> ';
>> /Records;
>> $my_file+='</Names>';
>>
>> file_write('MyNames.xml', $my_file, -fileoverwrite);
>>
>> /inline;
>>
>> If you need help with file permissions, see my guide:
>> <http://stevepiercy.com/lasso_stuff/file_perms.lasso>
>>
>> --steve
>>
>>
>>
>>
>> On Wednesday, December 12, 2007, [hidden email] (Detlef
>> Hebbel) pronounced:
>>
>>> This is a 'first time XML for me. May I please ask to get some help:
>>>
>>> I have a simple database with two fields:
>>> 'Last_Name'
>>> 'Location'
>>>
>>> I want Lasso to create an xml file called MyNames.xml.
>>>
>>> This is what I have so far:
>>>
>>> [Inline:
>>> -Database='MyDatabase',
>>> -Table='MyTable',
>>> -KeyField='Internal Record ID',
>>> 'Location'='USA',
>>> -Search]
>>>
>>> <Names>
>>> [Records]
>>> <NameInfo>
>>> <LastName>[Field: 'Last_Name']</LastName>
>>> <Location>[Field: 'Location']</Location>
>>> </NameInfo>
>>> [/Records]
>>> </Names>
>>> [/Inline]
>>>
>>>
>>> When I write the above code into a file "MyNames.lasso" I get an
>>> output with names and location, the resulting source code is ok and I
>>> can copy/paste it into and .xml file and use it. But what I need, is
>>> that Lasso creates (writes/saves) a ready to use file called
>>> "MyNames.xml".
>>>
>>> Any help would be appreciated.
>>>
>>> Cheers
>>> Detlef
>>>
>>
>> -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
>> Steve Piercy               Web Site Builder               Soquel, CA
>> <[hidden email]>                  <http://www.StevePiercy.com/>
>>
>> --
A few booboos that needed to be fixed. Try this

[

var('my_file'= string);

inline(
-database='Names',
-table='ClientNames',
'Location'='USA',
-search);


$my_file+='<Names>\r';
records;
    $my_file+='\t<NameInfo>\r';
    $my_file+='\t\t<LastName>' + field('Last_Name') + '</LastName>\r';
    $my_file+='\t\t<Location>' + field('Location')  + '</Location>\r';
    $my_file+='\t</NameInfo>\r';
/records;
$my_file+='</Names>\r';

file_write('MyNames.xml', $my_file, -fileoverwrite);

/inline;

]

Of course there are many other ways. This is just a fix of your code.


Thanks

Steffan

---------------------------------------------------------------
T E L  6 0 2 . 7 9 3 . 0 0 1 4 | F A X  6 0 2 . 9 7 1 . 1 6 9 4
Steffan A. Cline
[hidden email]                             Phoenix, Az
http://www.ExecuChoice.net                                  USA
AIM : SteffanC          ICQ : 57234309
YAHOO : Steffan_Cline   MSN : [hidden email]
GOOGLE: Steffan.Cline             Lasso Partner Alliance Member
---------------------------------------------------------------




--
This list is a free service of LassoSoft: http://www.LassoSoft.com/
Search the list archives: http://www.ListSearch.com/Lasso/Browse/
Manage your subscription: http://www.ListSearch.com/Lasso/

Reply | Threaded
Open this post in threaded view
|

Re: Creating XML file

detlef.hebbel
In reply to this post by stevepiercy
Yeah, I got it.
It took me long time to find out that it needs the [AuthUser] tag.  
Very good that Steve attached a link to his support site: <http://stevepiercy.com/lasso_stuff/file_perms.lasso 
 >

Thanks a lot, works great now.

Detlef


On Dec 12, 2007, at 4:41 PM, Steve Piercy - Web Site Builder wrote:

> Ack!  And where did those extra ; come from?
>
> Inline:
> -Database='Names',
> -Table='ClientNames',
> 'Location'='USA',
> -Search;
>
> --steve
>
>
> On Tuesday, December 11, 2007, [hidden email] (Steve Piercy -  
> Web Site Builder) pronounced:
>
>> You were missing a quote in your inline for the -Table parameter.
>>
>> Inline:
>> -Database='Names';
>> -Table='ClientNames';
>> 'Location'='USA';
>> -Search;
>>
>> --steve
>>
>>
>> On Wednesday, December 12, 2007, [hidden email] (Detlef  
>> Hebbel) pronounced:
>>
>>> Thank you very much, but I cannot find the error(s). Can you have a
>>> look at the total script. Thanks
>>>
>>>
>>> <?LassoScript
>>>
>>> var('my_file'   = 'MyNames.xml');
>>>
>>> Inline:
>>> -Database='Names';
>>> -Table=ClientNames';
>>> 'Location'='USA';
>>> -Search;
>>>
>>>
>>> $my_file+='<Names>
>>> ';
>>> Records;
>>> $my_file+='<NameInfo>
>>> <LastName>'Field('Last_Name')'</LastName>
>>> <Location>'Field('Location')'</Location>
>>> </NameInfo>
>>> ';
>>> /Records;
>>> $my_file+='</Names>';
>>>
>>> file_write('MyNames.xml', $my_file, -fileoverwrite);
>>>
>>> /inline;
>>>
>>> ?>
>>>
>>>
>>>
>>> On Dec 12, 2007, at 3:23 PM, Steve Piercy - Web Site Builder wrote:
>>>
>>>> Set a var and append it with the file contents, then write the
>>>> contents to a file, like so:
>>>>
>>>> var('my_file'   = '');
>>>>
>>>> inline(...stuff...);
>>>> $my_file+='<Names>
>>>> ';
>>>> Records;
>>>> $my_file+='<NameInfo>
>>>> <LastName>'Field('Last_Name')'</LastName>
>>>> <Location>'Field('Location')'</Location>
>>>> </NameInfo>
>>>> ';
>>>> /Records;
>>>> $my_file+='</Names>';
>>>>
>>>> file_write('MyNames.xml', $my_file, -fileoverwrite);
>>>>
>>>> /inline;
>>>>
>>>> If you need help with file permissions, see my guide:
>>>> <http://stevepiercy.com/lasso_stuff/file_perms.lasso>
>>>>
>>>> --steve
>>>>
>>>>
>>>>
>>>>
>>>> On Wednesday, December 12, 2007, [hidden email] (Detlef
>>>> Hebbel) pronounced:
>>>>
>>>>> This is a 'first time XML for me. May I please ask to get some  
>>>>> help:
>>>>>
>>>>> I have a simple database with two fields:
>>>>> 'Last_Name'
>>>>> 'Location'
>>>>>
>>>>> I want Lasso to create an xml file called MyNames.xml.
>>>>>
>>>>> This is what I have so far:
>>>>>
>>>>> [Inline:
>>>>> -Database='MyDatabase',
>>>>> -Table='MyTable',
>>>>> -KeyField='Internal Record ID',
>>>>> 'Location'='USA',
>>>>> -Search]
>>>>>
>>>>> <Names>
>>>>> [Records]
>>>>> <NameInfo>
>>>>> <LastName>[Field: 'Last_Name']</LastName>
>>>>> <Location>[Field: 'Location']</Location>
>>>>> </NameInfo>
>>>>> [/Records]
>>>>> </Names>
>>>>> [/Inline]
>>>>>
>>>>>
>>>>> When I write the above code into a file "MyNames.lasso" I get an
>>>>> output with names and location, the resulting source code is ok  
>>>>> and I
>>>>> can copy/paste it into and .xml file and use it. But what I  
>>>>> need, is
>>>>> that Lasso creates (writes/saves) a ready to use file called
>>>>> "MyNames.xml".
>>>>>
>>>>> Any help would be appreciated.
>>>>>
>>>>> Cheers
>>>>> Detlef
>>>>>
>>>>
>>>> -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --  
>>>> --
>>>> Steve Piercy               Web Site Builder               Soquel,  
>>>> CA
>>>> <[hidden email]>                  <http://
>>>> www.StevePiercy.com/>
>>>>
>>>> --
>>>> This list is a free service of LassoSoft: http://www.LassoSoft.com/
>>>> Search the list archives: http://www.ListSearch.com/Lasso/Browse/
>>>> Manage your subscription: http://www.ListSearch.com/Lasso/
>>>>
>>>
>>>
>>
>> -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
>> Steve Piercy               Web Site Builder               Soquel, CA
>> <[hidden email]>                  <http://www.StevePiercy.com/>
>>
>
> -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
> Steve Piercy               Web Site Builder               Soquel, CA
> <[hidden email]>                  <http://www.StevePiercy.com/>
>
> --
> This list is a free service of LassoSoft: http://www.LassoSoft.com/
> Search the list archives: http://www.ListSearch.com/Lasso/Browse/
> Manage your subscription: http://www.ListSearch.com/Lasso/
>


--
This list is a free service of LassoSoft: http://www.LassoSoft.com/
Search the list archives: http://www.ListSearch.com/Lasso/Browse/
Manage your subscription: http://www.ListSearch.com/Lasso/

Reply | Threaded
Open this post in threaded view
|

Re: Creating XML file

detlef.hebbel
In reply to this post by Steffan A. Cline
Thanks Steffan, Steve and Laurent.

I worked on the 'few booboos' and it works very well now.

I could also use it very well to construct a Google sitemap with the  
code

Cheers

Detlef




On Dec 12, 2007, at 5:31 PM, Steffan A. Cline wrote:

> on 12/11/07 8:31 PM, Detlef Hebbel at [hidden email] wrote:
>
>> Thank you very much, but I cannot find the error(s). Can you have a
>> look at the total script. Thanks
>>
>>
>> <?LassoScript
>>
>> var('my_file'   = 'MyNames.xml');
>>
>> Inline:
>> -Database='Names';
>> -Table=ClientNames';
>> 'Location'='USA';
>> -Search;
>>
>>
>> $my_file+='<Names>
>> ';
>> Records;
>> $my_file+='<NameInfo>
>> <LastName>'Field('Last_Name')'</LastName>
>> <Location>'Field('Location')'</Location>
>> </NameInfo>
>> ';
>> /Records;
>> $my_file+='</Names>';
>>
>> file_write('MyNames.xml', $my_file, -fileoverwrite);
>>
>> /inline;
>>
>> ?>
>>
>>
>>
>> On Dec 12, 2007, at 3:23 PM, Steve Piercy - Web Site Builder wrote:
>>
>>> Set a var and append it with the file contents, then write the
>>> contents to a file, like so:
>>>
>>> var('my_file'   = '');
>>>
>>> inline(...stuff...);
>>> $my_file+='<Names>
>>> ';
>>> Records;
>>> $my_file+='<NameInfo>
>>> <LastName>'Field('Last_Name')'</LastName>
>>> <Location>'Field('Location')'</Location>
>>> </NameInfo>
>>> ';
>>> /Records;
>>> $my_file+='</Names>';
>>>
>>> file_write('MyNames.xml', $my_file, -fileoverwrite);
>>>
>>> /inline;
>>>
>>> If you need help with file permissions, see my guide:
>>> <http://stevepiercy.com/lasso_stuff/file_perms.lasso>
>>>
>>> --steve
>>>
>>>
>>>
>>>
>>> On Wednesday, December 12, 2007, [hidden email] (Detlef
>>> Hebbel) pronounced:
>>>
>>>> This is a 'first time XML for me. May I please ask to get some  
>>>> help:
>>>>
>>>> I have a simple database with two fields:
>>>> 'Last_Name'
>>>> 'Location'
>>>>
>>>> I want Lasso to create an xml file called MyNames.xml.
>>>>
>>>> This is what I have so far:
>>>>
>>>> [Inline:
>>>> -Database='MyDatabase',
>>>> -Table='MyTable',
>>>> -KeyField='Internal Record ID',
>>>> 'Location'='USA',
>>>> -Search]
>>>>
>>>> <Names>
>>>> [Records]
>>>> <NameInfo>
>>>> <LastName>[Field: 'Last_Name']</LastName>
>>>> <Location>[Field: 'Location']</Location>
>>>> </NameInfo>
>>>> [/Records]
>>>> </Names>
>>>> [/Inline]
>>>>
>>>>
>>>> When I write the above code into a file "MyNames.lasso" I get an
>>>> output with names and location, the resulting source code is ok  
>>>> and I
>>>> can copy/paste it into and .xml file and use it. But what I need,  
>>>> is
>>>> that Lasso creates (writes/saves) a ready to use file called
>>>> "MyNames.xml".
>>>>
>>>> Any help would be appreciated.
>>>>
>>>> Cheers
>>>> Detlef
>>>>
>>>
>>> -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
>>> Steve Piercy               Web Site Builder               Soquel, CA
>>> <[hidden email]>                  <http://www.StevePiercy.com/>
>>>
>>> --
> A few booboos that needed to be fixed. Try this
>
> [
>
> var('my_file'= string);
>
> inline(
> -database='Names',
> -table='ClientNames',
> 'Location'='USA',
> -search);
>
>
> $my_file+='<Names>\r';
> records;
>    $my_file+='\t<NameInfo>\r';
>    $my_file+='\t\t<LastName>' + field('Last_Name') + '</LastName>\r';
>    $my_file+='\t\t<Location>' + field('Location')  + '</Location>\r';
>    $my_file+='\t</NameInfo>\r';
> /records;
> $my_file+='</Names>\r';
>
> file_write('MyNames.xml', $my_file, -fileoverwrite);
>
> /inline;
>
> ]
>
> Of course there are many other ways. This is just a fix of your code.
>
>
> Thanks
>
> Steffan
>
> ---------------------------------------------------------------
> T E L  6 0 2 . 7 9 3 . 0 0 1 4 | F A X  6 0 2 . 9 7 1 . 1 6 9 4
> Steffan A. Cline
> [hidden email]                             Phoenix, Az
> http://www.ExecuChoice.net                                  USA
> AIM : SteffanC          ICQ : 57234309
> YAHOO : Steffan_Cline   MSN : [hidden email]
> GOOGLE: Steffan.Cline             Lasso Partner Alliance Member
> ---------------------------------------------------------------
>
>
>
>
> --
> This list is a free service of LassoSoft: http://www.LassoSoft.com/
> Search the list archives: http://www.ListSearch.com/Lasso/Browse/
> Manage your subscription: http://www.ListSearch.com/Lasso/
>


--
This list is a free service of LassoSoft: http://www.LassoSoft.com/
Search the list archives: http://www.ListSearch.com/Lasso/Browse/
Manage your subscription: http://www.ListSearch.com/Lasso/

Reply | Threaded
Open this post in threaded view
|

Re: Creating XML file

Doug Gentry
Fletcher also did a specific Tip of the Week on Google Site Maps:

http://www.lassosoft.com/Documentation/TotW/index.lasso?9209

..Doug

On Dec 13, 2007, at 4:14 PM, Detlef Hebbel wrote:

> Thanks Steffan, Steve and Laurent.
>
> I worked on the 'few booboos' and it works very well now.
>
> I could also use it very well to construct a Google sitemap with  
> the code
>
> Cheers
>
> Detlef
>
>
>
>
> On Dec 12, 2007, at 5:31 PM, Steffan A. Cline wrote:
>
>> on 12/11/07 8:31 PM, Detlef Hebbel at [hidden email] wrote:
>>
>>> Thank you very much, but I cannot find the error(s). Can you have a
>>> look at the total script. Thanks
>>>
>>>
>>> <?LassoScript
>>>
>>> var('my_file'   = 'MyNames.xml');
>>>
>>> Inline:
>>> -Database='Names';
>>> -Table=ClientNames';
>>> 'Location'='USA';
>>> -Search;
>>>
>>>
>>> $my_file+='<Names>
>>> ';
>>> Records;
>>> $my_file+='<NameInfo>
>>> <LastName>'Field('Last_Name')'</LastName>
>>> <Location>'Field('Location')'</Location>
>>> </NameInfo>
>>> ';
>>> /Records;
>>> $my_file+='</Names>';
>>>
>>> file_write('MyNames.xml', $my_file, -fileoverwrite);
>>>
>>> /inline;
>>>
>>> ?>
>>>
>>>
>>>
>>> On Dec 12, 2007, at 3:23 PM, Steve Piercy - Web Site Builder wrote:
>>>
>>>> Set a var and append it with the file contents, then write the
>>>> contents to a file, like so:
>>>>
>>>> var('my_file'   = '');
>>>>
>>>> inline(...stuff...);
>>>> $my_file+='<Names>
>>>> ';
>>>> Records;
>>>> $my_file+='<NameInfo>
>>>> <LastName>'Field('Last_Name')'</LastName>
>>>> <Location>'Field('Location')'</Location>
>>>> </NameInfo>
>>>> ';
>>>> /Records;
>>>> $my_file+='</Names>';
>>>>
>>>> file_write('MyNames.xml', $my_file, -fileoverwrite);
>>>>
>>>> /inline;
>>>>
>>>> If you need help with file permissions, see my guide:
>>>> <http://stevepiercy.com/lasso_stuff/file_perms.lasso>
>>>>
>>>> --steve
>>>>
>>>>
>>>>
>>>>
>>>> On Wednesday, December 12, 2007, [hidden email] (Detlef
>>>> Hebbel) pronounced:
>>>>
>>>>> This is a 'first time XML for me. May I please ask to get some  
>>>>> help:
>>>>>
>>>>> I have a simple database with two fields:
>>>>> 'Last_Name'
>>>>> 'Location'
>>>>>
>>>>> I want Lasso to create an xml file called MyNames.xml.
>>>>>
>>>>> This is what I have so far:
>>>>>
>>>>> [Inline:
>>>>> -Database='MyDatabase',
>>>>> -Table='MyTable',
>>>>> -KeyField='Internal Record ID',
>>>>> 'Location'='USA',
>>>>> -Search]
>>>>>
>>>>> <Names>
>>>>> [Records]
>>>>> <NameInfo>
>>>>> <LastName>[Field: 'Last_Name']</LastName>
>>>>> <Location>[Field: 'Location']</Location>
>>>>> </NameInfo>
>>>>> [/Records]
>>>>> </Names>
>>>>> [/Inline]
>>>>>
>>>>>
>>>>> When I write the above code into a file "MyNames.lasso" I get an
>>>>> output with names and location, the resulting source code is ok  
>>>>> and I
>>>>> can copy/paste it into and .xml file and use it. But what I  
>>>>> need, is
>>>>> that Lasso creates (writes/saves) a ready to use file called
>>>>> "MyNames.xml".
>>>>>
>>>>> Any help would be appreciated.
>>>>>
>>>>> Cheers
>>>>> Detlef
>>>>>
>>>>
>>>> -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --  
>>>> -- --
>>>> Steve Piercy               Web Site Builder                
>>>> Soquel, CA
>>>> <[hidden email]>                  <http://
>>>> www.StevePiercy.com/>
>>>>
>>>> --
>> A few booboos that needed to be fixed. Try this
>>
>> [
>>
>> var('my_file'= string);
>>
>> inline(
>> -database='Names',
>> -table='ClientNames',
>> 'Location'='USA',
>> -search);
>>
>>
>> $my_file+='<Names>\r';
>> records;
>>    $my_file+='\t<NameInfo>\r';
>>    $my_file+='\t\t<LastName>' + field('Last_Name') + '</LastName>\r';
>>    $my_file+='\t\t<Location>' + field('Location')  + '</Location>\r';
>>    $my_file+='\t</NameInfo>\r';
>> /records;
>> $my_file+='</Names>\r';
>>
>> file_write('MyNames.xml', $my_file, -fileoverwrite);
>>
>> /inline;
>>
>> ]
>>
>> Of course there are many other ways. This is just a fix of your code.
>>
>>
>> Thanks
>>
>> Steffan
>>
>> ---------------------------------------------------------------
>> T E L  6 0 2 . 7 9 3 . 0 0 1 4 | F A X  6 0 2 . 9 7 1 . 1 6 9 4
>> Steffan A. Cline
>> [hidden email]                             Phoenix, Az
>> http://www.ExecuChoice.net                                  USA
>> AIM : SteffanC          ICQ : 57234309
>> YAHOO : Steffan_Cline   MSN : [hidden email]
>> GOOGLE: Steffan.Cline             Lasso Partner Alliance Member
>> ---------------------------------------------------------------
>>
>>
>>
>>
>> --
>> This list is a free service of LassoSoft: http://www.LassoSoft.com/
>> Search the list archives: http://www.ListSearch.com/Lasso/Browse/
>> Manage your subscription: http://www.ListSearch.com/Lasso/
>>
>
>
> --
> This list is a free service of LassoSoft: http://www.LassoSoft.com/
> Search the list archives: http://www.ListSearch.com/Lasso/Browse/
> Manage your subscription: http://www.ListSearch.com/Lasso/
>



---
Doug Gentry
Dynapolis & Southern Oregon University
p:  541-261-8501 / Toll Free: 866-890-6013
[hidden email]
www.dynapolis.com - blog: www.plain-sense.com



--
This list is a free service of LassoSoft: http://www.LassoSoft.com/
Search the list archives: http://www.ListSearch.com/Lasso/Browse/
Manage your subscription: http://www.ListSearch.com/Lasso/