Automatic indentation

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
6 messages Options
Reply | Threaded
Open this post in threaded view
|

Automatic indentation

Hatice
Hello,
 
I would like to know if there is any way to automatically indent a XML stream in Squeak ?
 
Thanks by advance for your responses,
 
Hatice Oktay

Reply | Threaded
Open this post in threaded view
|

Re: Automatic indentation

stéphane ducasse-2
I did not checked but this should be a stream so tab and cr and  
friends should work.

aStream tab :)
aStream cr

Try Transcript show: 'helloo' ; cr; tab; tab; 'show: 'world'



On 12 mai 06, at 09:05, Hatice wrote:

> Hello,
>
> I would like to know if there is any way to automatically indent a  
> XML stream in Squeak ?
>
> Thanks by advance for your responses,
>
> Hatice Oktay
>


Reply | Threaded
Open this post in threaded view
|

Re: Automatic indentation

Nicolas Cellier-3
Le Vendredi 12 Mai 2006 09:17, stéphane ducasse a écrit :

> I did not checked but this should be a stream so tab and cr and
> friends should work.
>
> aStream tab :)
> aStream cr
>
> Try Transcript show: 'helloo' ; cr; tab; tab; 'show: 'world'
>
> On 12 mai 06, at 09:05, Hatice wrote:
> > Hello,
> >
> > I would like to know if there is any way to automatically indent a
> > XML stream in Squeak ?
> >
> > Thanks by advance for your responses,
> >
> > Hatice Oktay

There is also:

    aStream crtab: n.

Short cut for:

  aStream cr. n timesRepeat: [aStream tab].

But what do you mean automatically indent ?
Parse any xml input and produce indented output ?
Then you have to figure where to insert the crtab: and how to handle
indentation level...

Nicolas


Reply | Threaded
Open this post in threaded view
|

Re: Automatic indentation

Bert Freudenberg-3
>> On 12 mai 06, at 09:05, Hatice wrote:
>>> Hello,
>>>
>>> I would like to know if there is any way to automatically indent a
>>> XML stream in Squeak ?
>>>
>>> Thanks by advance for your responses,

There is an XMLWriter for Squeak in the XML-Parser package at

        http://www.squeaksource.com/XMLSupport.html

This one does not indent, but in Tweak, there is a simple indenting  
subclass of that XMLWriter (attached for your convenience).

- Bert -




XMLWriterIndenting.st.gz (690 bytes) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: Automatic indentation

stéphane ducasse-2
Bert

may be we could move it into YAXO?

Stef

On 15 mai 06, at 12:04, Bert Freudenberg wrote:

>>> On 12 mai 06, at 09:05, Hatice wrote:
>>>> Hello,
>>>>
>>>> I would like to know if there is any way to automatically indent a
>>>> XML stream in Squeak ?
>>>>
>>>> Thanks by advance for your responses,
>
> There is an XMLWriter for Squeak in the XML-Parser package at
>
> http://www.squeaksource.com/XMLSupport.html
>
> This one does not indent, but in Tweak, there is a simple indenting  
> subclass of that XMLWriter (attached for your convenience).
>
> - Bert -
>
> <XMLWriterIndenting.st.gz>
>


Reply | Threaded
Open this post in threaded view
|

Re: Automatic indentation

Bert Freudenberg-3
Why not, sure - provided Michael likes it :)

- Bert -

Am 15.05.2006 um 21:13 schrieb stéphane ducasse:

> Bert
>
> may be we could move it into YAXO?
>
> Stef
>
> On 15 mai 06, at 12:04, Bert Freudenberg wrote:
>
>>>> On 12 mai 06, at 09:05, Hatice wrote:
>>>>> Hello,
>>>>>
>>>>> I would like to know if there is any way to automatically indent a
>>>>> XML stream in Squeak ?
>>>>>
>>>>> Thanks by advance for your responses,
>>
>> There is an XMLWriter for Squeak in the XML-Parser package at
>>
>> http://www.squeaksource.com/XMLSupport.html
>>
>> This one does not indent, but in Tweak, there is a simple  
>> indenting subclass of that XMLWriter (attached for your convenience).
>>
>> - Bert -
>>
>> <XMLWriterIndenting.st.gz>
>>
>