Pharo-dev
By thread
pharo-dev@lists.pharo.org
By month
Messages by month
- ----- 2026 -----
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2025 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2024 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2023 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2022 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2021 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2020 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2019 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2018 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2017 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2016 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2015 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2014 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2013 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2012 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2011 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2010 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2009 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2008 -----
- December
- November
- October
- September
- August
- July
- June
- May
July 2010
- 103 participants
- 1290 messages
Re: [Pharo-project] Fwd: [squeak-dev] Re: Debug-it and external calls
by Nicolas Cellier
hemiscient ?
2010/7/20 Stéphane Ducasse <stephane.ducasse(a)inria.fr>
> enough half omniscient are enough :)
>
> On Jul 20, 2010, at 3:49 AM, Henrik Johansen wrote:
>
> >
> >
> > Den 19. juli 2010 kl. 23:04 skrev Stéphane Ducasse <
> stephane.ducasse(a)inria.fr>:
> >
> >> should this be integrated into pharo?
> >> ifTrue: open a ticket please.
> >>
> >> Sorry but I'm not omniscient yet even if I work hard on it
> >>
> >> Stef
> >
> > That's ok, I am! ;)
> > The change to use large frames for methods doing performs was integrated
> in Pharo shortly after Igor initially raised the issue.
> > I can't remember off-hand if they are part of 1.1 though.
> > Darn, guess I'm not omnipotent after all.
> >
> > Cheers,
> > Henry
> > _______________________________________________
> > Pharo-project mailing list
> > Pharo-project(a)lists.gforge.inria.fr
> > http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project
>
>
> _______________________________________________
> Pharo-project mailing list
> Pharo-project(a)lists.gforge.inria.fr
> http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project
>
July 20, 2010
Re: [Pharo-project] Markup Builder in Smalltalk (XMLWriter)
by Stéphane Ducasse
done :)
On Jul 20, 2010, at 7:25 PM, Miguel Enrique Cobá MartÃnez wrote:
> This good summary should go directly to the collaboractive book.
>
>
> El mar, 20-07-2010 a las 14:11 -0300, Hernán Morales Durand escribió:
>> A XML parser just creates a representation of a XML document according
>> to a parsing model. Ideally you should choose a XML parser
>> specifically for your needs. You have different parsing models:
>>
>> -Tree Parser: This is what you will read everywhere as the "DOM parser"
>> -Event Parser: This is denoted by S*X and could be
>> --SAX Parser: Known as the "Push parser"
>> --StAX Parser: Known also too as the "Pull parser"
>> -VTD Parser : This is known as "Virtual Token Descriptor"
>>
>> Now there are several classifications depending of the parser
>> characteristics and what you want to do or how. You may be interested
>> in:
>>
>> Making modifications or just processing?
>> -For modifications: The parser creates long-lived representations from
>> the XML document (necessary for modifications): You should choose DOM
>> or VTD
>> --Do you *need* to query or modify the objects (parser creates nodes): DOM
>> --You do not need the objects (parser creates integers and locations
>> caches): VTD
>> -For processing: The parser doesn't creates long-lived objects: SAX or StAX.
>>
>> Type of Access
>> -Back-and-forth: Access the data after the parsing is complete: DOM or VTD
>> --Massive or very frequent access: Choose DOM
>> --Rare or simple access: Choose VTD
>> -Sequential: Access the data while you're processing the document: SAX or StAX
>> --Processing all tokens: SAX
>> --Processing interested tokens (allows skipping forward): StAX
>>
>> Briefly
>> -Streaming applications (very large documents): SAX or StAX
>> -Database applications: DOM or VTD
>> -Hardware acceleration?: VTD
>>
>> For the S*X parsers you need to know the XML token types because, for
>> example in the case of XMLParser in Pharo/Squeak, you probably would
>> subclass SAXHandler and override one or several methods in the content
>> category to do your own processing. See GTNCBIBlastParser in
>> http://www.squeaksource.com/GenomeTools.html for an example of a SAX
>> Parser.
>>
>> XML token types:
>> Start element: <Hit>....
>> End element: ...</Hit>
>> Text: <...>Text value</...>
>> etc.
>>
>> For DOM usage examples you may see
>> http://community.ofset.org/index.php/Les_bases_de_XML_dans_Squeak (it
>> is in french but is a good document)
>>
>> What we have in Pharo/Squeak
>>
>> Parsers:
>> 1) XMLParser : Supports SAX and DOM. http://www.squeaksource.com/XMLSupport.html
>> 2) VWXML Parser : Supports SAX and DOM (AFAIK)
>> http://www.squeaksource.com/VWXML.html
>> 3) XMLPullParser : Supports StAX. http://www.squeaksource.com/XMLPullParser.html
>>
>> XML Query tools
>> 1) Pastell : Supports X-Path like queries. Requires XMLParser.
>> http://www.squeaksource.com/Pastell.html
>> 2) XPath library : Supports XPath partially. Requires XMLParser.
>> http://www.squeaksource.com/XPath.html
>>
>> There are several additional tools in SqueakSource but I haven't reviewed yet.
>> A VTD parser would be ideal for Smalltalk because it uses integer
>> arrays reducing the object allocation overhead in memory. I haven't
>> found implementations of a XML VTD parser in Smalltalk as of today.
>> Cheers,
>>
>> Hernán
>>
>> 2010/7/20 Stéphane Ducasse <stephane.ducasse(a)inria.fr>:
>>> could the people with a bit of knowledge try to write a map of all the possible and working solutions?
>>>
>>> People are telling me that python doc is good so may be we should also consider that arranging knowledge
>>> on maps is the first step
>>>
>>> Please take 15 mins because in 15 min you can get a real impact!
>>>
>>>
>>>> http://www.squeaksource.com/XMLPullParser.html
>>>>
>>>> If I would going to write a XML parser, I'd go for a VTD parser instead.
>>>> Cheers,
>>>>
>>>> Hernán
>>>>
>>>> 2010/7/19 Norbert Hartl <norbert(a)hartl.name>:
>>>>>
>>>>> On 06.07.2010, at 23:04, jaayer wrote:
>>>>>
>>>>>>
>>>>>>
>>>>>> ---- On Tue, 06 Jul 2010 03:19:48 -0700 Torsten Bergmann wrote ----
>>>>>>
>>>>>>> Just check "XMLWriter-tbn.5" which can be found in "http://squeaksource.com/PharoGoodies/"
>>>>>>>
>>>>>>> ------------------------------------------------------
>>>>>>> |writer|
>>>>>>> writer := XMLTagWriter xml.
>>>>>>> writer comment: 'A new xml file'.
>>>>>>> writer tag: 'package' with: [
>>>>>>> writer cData: 'name' with: 'XMLWriter'.
>>>>>>> ].
>>>>>>> writer contents
>>>>>>>
>>>>>>> returns
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>> ------------------------------------------------------
>>>>>>>
>>>>>>> You can also access the stream (writer stream).
>>>>>>> Indenting is not yet working fully but at least
>>>>>>> it should give you idea. Check out the test cases for
>>>>>>> more.
>>>>>>>
>>>>>>> I once saw such an XMLWriter written by Ernest Micklei
>>>>>>> in VAST (credits for the idea) and rebuilt it in Pharo.
>>>>>>>
>>>>>>> Bye
>>>>>>> T.
>>>>>>> --
>>>>>>> GMX DSL: Internet-, Telefon- und Handy-Flat ab 19,99 EUR/mtl.
>>>>>>> Bis zu 150 EUR Startguthaben inklusive! http://portal.gmx.net/de/go/dsl
>>>>>>>
>>>>>>> _______________________________________________
>>>>>>> Pharo-project mailing list
>>>>>>> Pharo-project(a)lists.gforge.inria.fr
>>>>>>> http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project
>>>>>>>
>>>>>>
>>>>>> The next version of XMLSupport will feature an XMLWriter with an API similar to XMLTagWriter. I had decided a few weeks that any API using explicit start/end methods was unsmalltalk-like and should be replaced with one based on execute-around methods, though I was unaware of XMLTagWriter and instead modeled the API loosely on Seaside's HTML generation. You now send XMLWriter messages that create markup-writing objects for the parts of a document. These objects can then be configured using messages like #attributeAt:put: and written to the document explicitly with a serialization message (which typically accepts content) or implicitly by creating another markup writer after it. The new API looks like this:
>>>>>>
>>>>>> | writer |
>>>>>> ((writer := XMLWriter new)
>>>>>> enablePrettyPrinting;
>>>>>> xmlDeclaration;
>>>>>> tag: 'foo')
>>>>>> xmlnsAt: 'foo' put: 'http://foo';
>>>>>> attributeAt: 'a' put: 'one';
>>>>>> attributeAt: 'b' put: 'two';
>>>>>> content: [
>>>>>> writer tag: 'bar' content: [
>>>>>> (writer
>>>>>> string: 'test';
>>>>>> tag: 'baz';
>>>>>> tag: 'foobar')
>>>>>> content: 'test']]
>>>>>> which produces:
>>>>>> <?xml version="1.0" encoding="UTF-8"?>
>>>>>> <foo xmlns:foo="http://foo" a="one" b="two">
>>>>>> <bar>test<baz />
>>>>>> <foobar>test</foobar>
>>>>>> </bar>
>>>>>> </foo>
>>>>>>
>>>>> Could you elaborate on the usage of xmlns? The one you defined does nothing. The foo in the xml is just the element name. I would like to know
>>>>>
>>>>> - how to define a namespace prefix for an element
>>>>> - how to define a default namespace for an element
>>>>>
>>>>> I think I need another look in the xml parser since last time :) Thanks for putting effort into xml parser. Is there a pull parser available or planned?
>>>>>
>>>>> thanks,
>>>>>
>>>>> Norbert
>>>>>
>>>>>
>>>>> _______________________________________________
>>>>> Pharo-project mailing list
>>>>> Pharo-project(a)lists.gforge.inria.fr
>>>>> http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project
>>>>>
>>>>
>>>> _______________________________________________
>>>> Pharo-project mailing list
>>>> Pharo-project(a)lists.gforge.inria.fr
>>>> http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project
>>>
>>>
>>> _______________________________________________
>>> Pharo-project mailing list
>>> Pharo-project(a)lists.gforge.inria.fr
>>> http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project
>>>
>>
>> _______________________________________________
>> Pharo-project mailing list
>> Pharo-project(a)lists.gforge.inria.fr
>> http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project
>
> --
> Miguel Cobá
> http://miguel.leugim.com.mx
>
>
> _______________________________________________
> Pharo-project mailing list
> Pharo-project(a)lists.gforge.inria.fr
> http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project
July 20, 2010
Re: [Pharo-project] Markup Builder in Smalltalk (XMLWriter)
by Stéphane Ducasse
We need more of these :)
http://book.pharo-project.org/book/XML
Thanks a lot hernan
On Jul 20, 2010, at 7:11 PM, Hernán Morales Durand wrote:
> A XML parser just creates a representation of a XML document according
> to a parsing model. Ideally you should choose a XML parser
> specifically for your needs. You have different parsing models:
>
> -Tree Parser: This is what you will read everywhere as the "DOM parser"
> -Event Parser: This is denoted by S*X and could be
> --SAX Parser: Known as the "Push parser"
> --StAX Parser: Known also too as the "Pull parser"
> -VTD Parser : This is known as "Virtual Token Descriptor"
>
> Now there are several classifications depending of the parser
> characteristics and what you want to do or how. You may be interested
> in:
>
> Making modifications or just processing?
> -For modifications: The parser creates long-lived representations from
> the XML document (necessary for modifications): You should choose DOM
> or VTD
> --Do you *need* to query or modify the objects (parser creates nodes): DOM
> --You do not need the objects (parser creates integers and locations
> caches): VTD
> -For processing: The parser doesn't creates long-lived objects: SAX or StAX.
>
> Type of Access
> -Back-and-forth: Access the data after the parsing is complete: DOM or VTD
> --Massive or very frequent access: Choose DOM
> --Rare or simple access: Choose VTD
> -Sequential: Access the data while you're processing the document: SAX or StAX
> --Processing all tokens: SAX
> --Processing interested tokens (allows skipping forward): StAX
>
> Briefly
> -Streaming applications (very large documents): SAX or StAX
> -Database applications: DOM or VTD
> -Hardware acceleration?: VTD
>
> For the S*X parsers you need to know the XML token types because, for
> example in the case of XMLParser in Pharo/Squeak, you probably would
> subclass SAXHandler and override one or several methods in the content
> category to do your own processing. See GTNCBIBlastParser in
> http://www.squeaksource.com/GenomeTools.html for an example of a SAX
> Parser.
>
> XML token types:
> Start element: <Hit>....
> End element: ...</Hit>
> Text: <...>Text value</...>
> etc.
>
> For DOM usage examples you may see
> http://community.ofset.org/index.php/Les_bases_de_XML_dans_Squeak (it
> is in french but is a good document)
>
> What we have in Pharo/Squeak
>
> Parsers:
> 1) XMLParser : Supports SAX and DOM. http://www.squeaksource.com/XMLSupport.html
> 2) VWXML Parser : Supports SAX and DOM (AFAIK)
> http://www.squeaksource.com/VWXML.html
> 3) XMLPullParser : Supports StAX. http://www.squeaksource.com/XMLPullParser.html
>
> XML Query tools
> 1) Pastell : Supports X-Path like queries. Requires XMLParser.
> http://www.squeaksource.com/Pastell.html
> 2) XPath library : Supports XPath partially. Requires XMLParser.
> http://www.squeaksource.com/XPath.html
>
> There are several additional tools in SqueakSource but I haven't reviewed yet.
> A VTD parser would be ideal for Smalltalk because it uses integer
> arrays reducing the object allocation overhead in memory. I haven't
> found implementations of a XML VTD parser in Smalltalk as of today.
> Cheers,
>
> Hernán
>
> 2010/7/20 Stéphane Ducasse <stephane.ducasse(a)inria.fr>:
>> could the people with a bit of knowledge try to write a map of all the possible and working solutions?
>>
>> People are telling me that python doc is good so may be we should also consider that arranging knowledge
>> on maps is the first step
>>
>> Please take 15 mins because in 15 min you can get a real impact!
>>
>>
>>> http://www.squeaksource.com/XMLPullParser.html
>>>
>>> If I would going to write a XML parser, I'd go for a VTD parser instead.
>>> Cheers,
>>>
>>> Hernán
>>>
>>> 2010/7/19 Norbert Hartl <norbert(a)hartl.name>:
>>>>
>>>> On 06.07.2010, at 23:04, jaayer wrote:
>>>>
>>>>>
>>>>>
>>>>> ---- On Tue, 06 Jul 2010 03:19:48 -0700 Torsten Bergmann wrote ----
>>>>>
>>>>>> Just check "XMLWriter-tbn.5" which can be found in "http://squeaksource.com/PharoGoodies/"
>>>>>>
>>>>>> ------------------------------------------------------
>>>>>> |writer|
>>>>>> writer := XMLTagWriter xml.
>>>>>> writer comment: 'A new xml file'.
>>>>>> writer tag: 'package' with: [
>>>>>> writer cData: 'name' with: 'XMLWriter'.
>>>>>> ].
>>>>>> writer contents
>>>>>>
>>>>>> returns
>>>>>>
>>>>>>
>>>>>>
>>>>>>
>>>>>>
>>>>>>
>>>>>> ------------------------------------------------------
>>>>>>
>>>>>> You can also access the stream (writer stream).
>>>>>> Indenting is not yet working fully but at least
>>>>>> it should give you idea. Check out the test cases for
>>>>>> more.
>>>>>>
>>>>>> I once saw such an XMLWriter written by Ernest Micklei
>>>>>> in VAST (credits for the idea) and rebuilt it in Pharo.
>>>>>>
>>>>>> Bye
>>>>>> T.
>>>>>> --
>>>>>> GMX DSL: Internet-, Telefon- und Handy-Flat ab 19,99 EUR/mtl.
>>>>>> Bis zu 150 EUR Startguthaben inklusive! http://portal.gmx.net/de/go/dsl
>>>>>>
>>>>>> _______________________________________________
>>>>>> Pharo-project mailing list
>>>>>> Pharo-project(a)lists.gforge.inria.fr
>>>>>> http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project
>>>>>>
>>>>>
>>>>> The next version of XMLSupport will feature an XMLWriter with an API similar to XMLTagWriter. I had decided a few weeks that any API using explicit start/end methods was unsmalltalk-like and should be replaced with one based on execute-around methods, though I was unaware of XMLTagWriter and instead modeled the API loosely on Seaside's HTML generation. You now send XMLWriter messages that create markup-writing objects for the parts of a document. These objects can then be configured using messages like #attributeAt:put: and written to the document explicitly with a serialization message (which typically accepts content) or implicitly by creating another markup writer after it. The new API looks like this:
>>>>>
>>>>> | writer |
>>>>> ((writer := XMLWriter new)
>>>>> enablePrettyPrinting;
>>>>> xmlDeclaration;
>>>>> tag: 'foo')
>>>>> xmlnsAt: 'foo' put: 'http://foo';
>>>>> attributeAt: 'a' put: 'one';
>>>>> attributeAt: 'b' put: 'two';
>>>>> content: [
>>>>> writer tag: 'bar' content: [
>>>>> (writer
>>>>> string: 'test';
>>>>> tag: 'baz';
>>>>> tag: 'foobar')
>>>>> content: 'test']]
>>>>> which produces:
>>>>> <?xml version="1.0" encoding="UTF-8"?>
>>>>> <foo xmlns:foo="http://foo" a="one" b="two">
>>>>> <bar>test<baz />
>>>>> <foobar>test</foobar>
>>>>> </bar>
>>>>> </foo>
>>>>>
>>>> Could you elaborate on the usage of xmlns? The one you defined does nothing. The foo in the xml is just the element name. I would like to know
>>>>
>>>> - how to define a namespace prefix for an element
>>>> - how to define a default namespace for an element
>>>>
>>>> I think I need another look in the xml parser since last time :) Thanks for putting effort into xml parser. Is there a pull parser available or planned?
>>>>
>>>> thanks,
>>>>
>>>> Norbert
>>>>
>>>>
>>>> _______________________________________________
>>>> Pharo-project mailing list
>>>> Pharo-project(a)lists.gforge.inria.fr
>>>> http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project
>>>>
>>>
>>> _______________________________________________
>>> Pharo-project mailing list
>>> Pharo-project(a)lists.gforge.inria.fr
>>> http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project
>>
>>
>> _______________________________________________
>> Pharo-project mailing list
>> Pharo-project(a)lists.gforge.inria.fr
>> http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project
>>
>
> _______________________________________________
> Pharo-project mailing list
> Pharo-project(a)lists.gforge.inria.fr
> http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project
July 20, 2010
Re: [Pharo-project] Markup Builder in Smalltalk (XMLWriter)
by Miguel Enrique Cobá MartÃnez
This good summary should go directly to the collaboractive book.
El mar, 20-07-2010 a las 14:11 -0300, Hernán Morales Durand escribió:
> A XML parser just creates a representation of a XML document according
> to a parsing model. Ideally you should choose a XML parser
> specifically for your needs. You have different parsing models:
>
> -Tree Parser: This is what you will read everywhere as the "DOM parser"
> -Event Parser: This is denoted by S*X and could be
> --SAX Parser: Known as the "Push parser"
> --StAX Parser: Known also too as the "Pull parser"
> -VTD Parser : This is known as "Virtual Token Descriptor"
>
> Now there are several classifications depending of the parser
> characteristics and what you want to do or how. You may be interested
> in:
>
> Making modifications or just processing?
> -For modifications: The parser creates long-lived representations from
> the XML document (necessary for modifications): You should choose DOM
> or VTD
> --Do you *need* to query or modify the objects (parser creates nodes): DOM
> --You do not need the objects (parser creates integers and locations
> caches): VTD
> -For processing: The parser doesn't creates long-lived objects: SAX or StAX.
>
> Type of Access
> -Back-and-forth: Access the data after the parsing is complete: DOM or VTD
> --Massive or very frequent access: Choose DOM
> --Rare or simple access: Choose VTD
> -Sequential: Access the data while you're processing the document: SAX or StAX
> --Processing all tokens: SAX
> --Processing interested tokens (allows skipping forward): StAX
>
> Briefly
> -Streaming applications (very large documents): SAX or StAX
> -Database applications: DOM or VTD
> -Hardware acceleration?: VTD
>
> For the S*X parsers you need to know the XML token types because, for
> example in the case of XMLParser in Pharo/Squeak, you probably would
> subclass SAXHandler and override one or several methods in the content
> category to do your own processing. See GTNCBIBlastParser in
> http://www.squeaksource.com/GenomeTools.html for an example of a SAX
> Parser.
>
> XML token types:
> Start element: <Hit>....
> End element: ...</Hit>
> Text: <...>Text value</...>
> etc.
>
> For DOM usage examples you may see
> http://community.ofset.org/index.php/Les_bases_de_XML_dans_Squeak (it
> is in french but is a good document)
>
> What we have in Pharo/Squeak
>
> Parsers:
> 1) XMLParser : Supports SAX and DOM. http://www.squeaksource.com/XMLSupport.html
> 2) VWXML Parser : Supports SAX and DOM (AFAIK)
> http://www.squeaksource.com/VWXML.html
> 3) XMLPullParser : Supports StAX. http://www.squeaksource.com/XMLPullParser.html
>
> XML Query tools
> 1) Pastell : Supports X-Path like queries. Requires XMLParser.
> http://www.squeaksource.com/Pastell.html
> 2) XPath library : Supports XPath partially. Requires XMLParser.
> http://www.squeaksource.com/XPath.html
>
> There are several additional tools in SqueakSource but I haven't reviewed yet.
> A VTD parser would be ideal for Smalltalk because it uses integer
> arrays reducing the object allocation overhead in memory. I haven't
> found implementations of a XML VTD parser in Smalltalk as of today.
> Cheers,
>
> Hernán
>
> 2010/7/20 Stéphane Ducasse <stephane.ducasse(a)inria.fr>:
> > could the people with a bit of knowledge try to write a map of all the possible and working solutions?
> >
> > People are telling me that python doc is good so may be we should also consider that arranging knowledge
> > on maps is the first step
> >
> > Please take 15 mins because in 15 min you can get a real impact!
> >
> >
> >> http://www.squeaksource.com/XMLPullParser.html
> >>
> >> If I would going to write a XML parser, I'd go for a VTD parser instead.
> >> Cheers,
> >>
> >> Hernán
> >>
> >> 2010/7/19 Norbert Hartl <norbert(a)hartl.name>:
> >>>
> >>> On 06.07.2010, at 23:04, jaayer wrote:
> >>>
> >>>>
> >>>>
> >>>> ---- On Tue, 06 Jul 2010 03:19:48 -0700 Torsten Bergmann wrote ----
> >>>>
> >>>>> Just check "XMLWriter-tbn.5" which can be found in "http://squeaksource.com/PharoGoodies/"
> >>>>>
> >>>>> ------------------------------------------------------
> >>>>> |writer|
> >>>>> writer := XMLTagWriter xml.
> >>>>> writer comment: 'A new xml file'.
> >>>>> writer tag: 'package' with: [
> >>>>> writer cData: 'name' with: 'XMLWriter'.
> >>>>> ].
> >>>>> writer contents
> >>>>>
> >>>>> returns
> >>>>>
> >>>>>
> >>>>>
> >>>>>
> >>>>>
> >>>>>
> >>>>> ------------------------------------------------------
> >>>>>
> >>>>> You can also access the stream (writer stream).
> >>>>> Indenting is not yet working fully but at least
> >>>>> it should give you idea. Check out the test cases for
> >>>>> more.
> >>>>>
> >>>>> I once saw such an XMLWriter written by Ernest Micklei
> >>>>> in VAST (credits for the idea) and rebuilt it in Pharo.
> >>>>>
> >>>>> Bye
> >>>>> T.
> >>>>> --
> >>>>> GMX DSL: Internet-, Telefon- und Handy-Flat ab 19,99 EUR/mtl.
> >>>>> Bis zu 150 EUR Startguthaben inklusive! http://portal.gmx.net/de/go/dsl
> >>>>>
> >>>>> _______________________________________________
> >>>>> Pharo-project mailing list
> >>>>> Pharo-project(a)lists.gforge.inria.fr
> >>>>> http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project
> >>>>>
> >>>>
> >>>> The next version of XMLSupport will feature an XMLWriter with an API similar to XMLTagWriter. I had decided a few weeks that any API using explicit start/end methods was unsmalltalk-like and should be replaced with one based on execute-around methods, though I was unaware of XMLTagWriter and instead modeled the API loosely on Seaside's HTML generation. You now send XMLWriter messages that create markup-writing objects for the parts of a document. These objects can then be configured using messages like #attributeAt:put: and written to the document explicitly with a serialization message (which typically accepts content) or implicitly by creating another markup writer after it. The new API looks like this:
> >>>>
> >>>> | writer |
> >>>> ((writer := XMLWriter new)
> >>>> enablePrettyPrinting;
> >>>> xmlDeclaration;
> >>>> tag: 'foo')
> >>>> xmlnsAt: 'foo' put: 'http://foo';
> >>>> attributeAt: 'a' put: 'one';
> >>>> attributeAt: 'b' put: 'two';
> >>>> content: [
> >>>> writer tag: 'bar' content: [
> >>>> (writer
> >>>> string: 'test';
> >>>> tag: 'baz';
> >>>> tag: 'foobar')
> >>>> content: 'test']]
> >>>> which produces:
> >>>> <?xml version="1.0" encoding="UTF-8"?>
> >>>> <foo xmlns:foo="http://foo" a="one" b="two">
> >>>> <bar>test<baz />
> >>>> <foobar>test</foobar>
> >>>> </bar>
> >>>> </foo>
> >>>>
> >>> Could you elaborate on the usage of xmlns? The one you defined does nothing. The foo in the xml is just the element name. I would like to know
> >>>
> >>> - how to define a namespace prefix for an element
> >>> - how to define a default namespace for an element
> >>>
> >>> I think I need another look in the xml parser since last time :) Thanks for putting effort into xml parser. Is there a pull parser available or planned?
> >>>
> >>> thanks,
> >>>
> >>> Norbert
> >>>
> >>>
> >>> _______________________________________________
> >>> Pharo-project mailing list
> >>> Pharo-project(a)lists.gforge.inria.fr
> >>> http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project
> >>>
> >>
> >> _______________________________________________
> >> Pharo-project mailing list
> >> Pharo-project(a)lists.gforge.inria.fr
> >> http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project
> >
> >
> > _______________________________________________
> > Pharo-project mailing list
> > Pharo-project(a)lists.gforge.inria.fr
> > http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project
> >
>
> _______________________________________________
> Pharo-project mailing list
> Pharo-project(a)lists.gforge.inria.fr
> http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project
--
Miguel Cobá
http://miguel.leugim.com.mx
July 20, 2010
Re: [Pharo-project] Pharo-project Digest, Vol 27, Issue 118
by Larry Gadallah
On 19 July 2010 12:16, <pharo-project-request(a)lists.gforge.inria.fr> wrote:
> Message: 6
> Date: Mon, 19 Jul 2010 21:15:54 +0200
> From: Norbert Hartl <norbert(a)hartl.name>
> Subject: Re: [Pharo-project] XML Demarshalling
> To: Pharo-project(a)lists.gforge.inria.fr
> Message-ID: <6BCBFCA9-367D-4848-8D4C-9EA724017B99(a)hartl.name>
> Content-Type: text/plain; charset=us-ascii
>
>
> On 16.07.2010, at 18:46, Larry Gadallah wrote:
>
>> Hi all:
>>
>> I am a noob searching for an example of how to demarshall a set of
>> simple and complex XML nodes into an object using Pastell or something
>> similar. I have found many examples of how to pick out all of the
>> elements of a certain type into a collection, but I'm trying to grab
>> the data from a mixed collection of (~20) elements that are children
>> of a particular element type and unpack them into an object.
>>
>> Does anyone know of some good examples of how to do this using Pastell
>> or something similar?
>>
> Can you give more detailled information about how the XML maps onto the data model? I mean if you have childr elements will that map to objects that are referenced similar? Do attributes map to variables and such? Or do you want to freely define how the structure of the XML resembles into your objects?
>
> Norbert
Hi Norbert:
Alas, I am laboring under the burden of being a newbie to both Pharo
and XML. It seems to me that it would be better to be able to
dynamically pick up all of the child elements of an element of
interest, however, I can't imagine how to define an object that
doesn't know it's own contents until run-time. In addition, in my
case, some of the child elements are complex (i.e. they also contain
children) which complicates the traversal a little bit. I'm assuming
for now that I will have to read the source XML, define the instance
variables of my object based on them, and simply populate them at run
time by traversing the XML tree. If the XML model changes, the object
definition will have to change too.
Thanks,
--
Larry Gadallah, VE6VQ/W7Â Â Â Â Â Â Â Â Â Â Â Â Â lgadallah AT gmail DOT com
PGP Sig: 917E DDB7 C911 9EC1 0CD9Â C06B 06C4 835F 0BB8 7336
July 20, 2010
Re: [Pharo-project] about hex
by Levente Uzonyi
On Tue, 20 Jul 2010, Yanni Chiu wrote:
> Originally, the NATIVE postgresql driver was (somewhat?) ANSI ST
> incompatible. I had it working in VAST. Along the way, the Cryptography
> package was added as a dependency to support MD5 passwords.
>
> If #hex is not ANSI ST, then the postgres native driver is likely unaffected
> by changes to #hex, other than its effect on MD5. I can verify this later
> today.
It's a totally different #hex. The original issue is about Integer >>
#hex. PostgresV2 uses ByteArray >> #hex which is in the Cryptography
package and is independent of Integer >> #hex.
Levente
>
> --
> Yanni
>
>
> Mariano Martinez Peck wrote:
>>
>>
>> On Tue, Jul 20, 2010 at 2:46 AM, Henrik Johansen
>> <henrik.s.johansen(a)veloxit.no <mailto:henrik.s.johansen@veloxit.no>> wrote:
>>
>> Iirc, it was reintroduced in Pharo in relation to SqueakDBX, might
>> want to check with Mariano that changes will be compatible/SqueakDBX
>> is updated.
>>
>>
>> Hi Henrik. Indeed, it was included for SqueakDBX. Actually, not for itself,
>> but the NATIVE postgresql driver used to depends in the chripto package.
>> Then, the MD5 class was put in PharoCore so it didn't depend anymore. But
>> the hex was missing.
>> Now...if you ask me if this change will affect the postgres native driver,
>> I HAVE NO IDEA. The only thing I can do is to run the tests. But for that I
>> need a postgres with encrypthion running handly.
>>
>> Do you know Yanni?
>>
>> Cheers
>>
>> Mariano
>
> _______________________________________________
> Pharo-project mailing list
> Pharo-project(a)lists.gforge.inria.fr
> http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project
>
July 20, 2010
Re: [Pharo-project] Markup Builder in Smalltalk (XMLWriter)
by Hernán Morales Durand
A XML parser just creates a representation of a XML document according
to a parsing model. Ideally you should choose a XML parser
specifically for your needs. You have different parsing models:
-Tree Parser: This is what you will read everywhere as the "DOM parser"
-Event Parser: This is denoted by S*X and could be
--SAX Parser: Known as the "Push parser"
--StAX Parser: Known also too as the "Pull parser"
-VTD Parser : This is known as "Virtual Token Descriptor"
Now there are several classifications depending of the parser
characteristics and what you want to do or how. You may be interested
in:
Making modifications or just processing?
-For modifications: The parser creates long-lived representations from
the XML document (necessary for modifications): You should choose DOM
or VTD
--Do you *need* to query or modify the objects (parser creates nodes): DOM
--You do not need the objects (parser creates integers and locations
caches): VTD
-For processing: The parser doesn't creates long-lived objects: SAX or StAX.
Type of Access
-Back-and-forth: Access the data after the parsing is complete: DOM or VTD
--Massive or very frequent access: Choose DOM
--Rare or simple access: Choose VTD
-Sequential: Access the data while you're processing the document: SAX or StAX
--Processing all tokens: SAX
--Processing interested tokens (allows skipping forward): StAX
Briefly
-Streaming applications (very large documents): SAX or StAX
-Database applications: DOM or VTD
-Hardware acceleration?: VTD
For the S*X parsers you need to know the XML token types because, for
example in the case of XMLParser in Pharo/Squeak, you probably would
subclass SAXHandler and override one or several methods in the content
category to do your own processing. See GTNCBIBlastParser in
http://www.squeaksource.com/GenomeTools.html for an example of a SAX
Parser.
XML token types:
Start element: <Hit>....
End element: ...</Hit>
Text: <...>Text value</...>
etc.
For DOM usage examples you may see
http://community.ofset.org/index.php/Les_bases_de_XML_dans_Squeak (it
is in french but is a good document)
What we have in Pharo/Squeak
Parsers:
1) XMLParser : Supports SAX and DOM. http://www.squeaksource.com/XMLSupport.html
2) VWXML Parser : Supports SAX and DOM (AFAIK)
http://www.squeaksource.com/VWXML.html
3) XMLPullParser : Supports StAX. http://www.squeaksource.com/XMLPullParser.html
XML Query tools
1) Pastell : Supports X-Path like queries. Requires XMLParser.
http://www.squeaksource.com/Pastell.html
2) XPath library : Supports XPath partially. Requires XMLParser.
http://www.squeaksource.com/XPath.html
There are several additional tools in SqueakSource but I haven't reviewed yet.
A VTD parser would be ideal for Smalltalk because it uses integer
arrays reducing the object allocation overhead in memory. I haven't
found implementations of a XML VTD parser in Smalltalk as of today.
Cheers,
Hernán
2010/7/20 Stéphane Ducasse <stephane.ducasse(a)inria.fr>:
> could the people with a bit of knowledge try to write a map of all the possible and working solutions?
>
> People are telling me that python doc is good so may be we should also consider that arranging knowledge
> on maps is the first step
>
> Please take 15 mins because in 15 min you can get a real impact!
>
>
>> http://www.squeaksource.com/XMLPullParser.html
>>
>> If I would going to write a XML parser, I'd go for a VTD parser instead.
>> Cheers,
>>
>> Hernán
>>
>> 2010/7/19 Norbert Hartl <norbert(a)hartl.name>:
>>>
>>> On 06.07.2010, at 23:04, jaayer wrote:
>>>
>>>>
>>>>
>>>> ---- On Tue, 06 Jul 2010 03:19:48 -0700 Torsten Bergmann  wrote ----
>>>>
>>>>> Just check "XMLWriter-tbn.5" which can be found in "http://squeaksource.com/PharoGoodies/"
>>>>>
>>>>> ------------------------------------------------------
>>>>> |writer|
>>>>> writer := XMLTagWriter xml.
>>>>> writer comment: 'A new xml file'.
>>>>> writer tag: 'package' with: [
>>>>> Â Â writer cData: 'name' with: 'XMLWriter'.
>>>>> ].
>>>>> writer contents
>>>>>
>>>>> returns
>>>>>
>>>>>
>>>>>
>>>>>
>>>>>
>>>>>
>>>>> ------------------------------------------------------
>>>>>
>>>>> You can also access the stream (writer stream).
>>>>> Indenting is not yet working fully but at least
>>>>> it should give you idea. Check out the test cases for
>>>>> more.
>>>>>
>>>>> I once saw such an XMLWriter written by Ernest Micklei
>>>>> in VAST (credits for the idea) and rebuilt it in Pharo.
>>>>>
>>>>> Bye
>>>>> T.
>>>>> --
>>>>> GMX DSL: Internet-, Telefon- und Handy-Flat ab 19,99 EUR/mtl.
>>>>> Bis zu 150 EUR Startguthaben inklusive! http://portal.gmx.net/de/go/dsl
>>>>>
>>>>> _______________________________________________
>>>>> Pharo-project mailing list
>>>>> Pharo-project(a)lists.gforge.inria.fr
>>>>> http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project
>>>>>
>>>>
>>>> The next version of XMLSupport will feature an XMLWriter with an API similar to XMLTagWriter. I had decided a few weeks that any API using explicit start/end methods was unsmalltalk-like and should be replaced with one based on execute-around methods, though I was unaware of XMLTagWriter and instead modeled the API loosely on Seaside's HTML generation. You now send XMLWriter messages that create markup-writing objects for the parts of a document. These objects can then be configured using messages like #attributeAt:put: and written to the document explicitly with a serialization message (which typically accepts content) or implicitly by creating another markup writer after it. The new API looks like this:
>>>>
>>>> Â Â Â | writer |
>>>> Â Â Â ((writer := XMLWriter new)
>>>> Â Â Â Â Â Â Â enablePrettyPrinting;
>>>> Â Â Â Â Â Â Â xmlDeclaration;
>>>> Â Â Â Â Â Â Â tag: 'foo')
>>>> Â Â Â Â Â Â Â Â Â Â Â xmlnsAt: 'foo' put: 'http://foo';
>>>> Â Â Â Â Â Â Â Â Â Â Â attributeAt: 'a' put: 'one';
>>>> Â Â Â Â Â Â Â Â Â Â Â attributeAt: 'b' put: 'two';
>>>> Â Â Â Â Â Â Â Â Â Â Â content: [
>>>> Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â writer tag: 'bar' content: [
>>>> Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â (writer
>>>> Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â string: 'test';
>>>> Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â tag: 'baz';
>>>> Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â tag: 'foobar')
>>>> Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â content: 'test']]
>>>> which produces:
>>>> <?xml version="1.0" encoding="UTF-8"?>
>>>> <foo xmlns:foo="http://foo" a="one" b="two">
>>>> Â Â <bar>test<baz />
>>>> Â Â Â Â <foobar>test</foobar>
>>>> Â Â </bar>
>>>> </foo>
>>>>
>>> Could you elaborate on the usage of xmlns? The one you defined does nothing. The foo in the xml is just the element name. I would like to know
>>>
>>> - how to define a namespace prefix for an element
>>> - how to define a default namespace for an element
>>>
>>> I think I need another look in the xml parser since last time :) Thanks for putting effort into xml parser. Is there a pull parser available or planned?
>>>
>>> thanks,
>>>
>>> Norbert
>>>
>>>
>>> _______________________________________________
>>> Pharo-project mailing list
>>> Pharo-project(a)lists.gforge.inria.fr
>>> http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project
>>>
>>
>> _______________________________________________
>> Pharo-project mailing list
>> Pharo-project(a)lists.gforge.inria.fr
>> http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project
>
>
> _______________________________________________
> Pharo-project mailing list
> Pharo-project(a)lists.gforge.inria.fr
> http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project
>
July 20, 2010
Re: [Pharo-project] [ANN] ConfigurationOfMagma for Magma 1.1r1
by Dale Henrichs
First, if you are creating configuration for a project and you have
different code that needs to be loaded depending upon the version of
Pharo into which it is loaded, then you can add attiributes like
#'Pharo1.1' or #'Pharo1.0' to control which packages get loaded into the
image. This is a case where the maintainer _is_ involved in updating the
application to ensure that it runs on both Pharo1.0 and Pharo1.1 or
Pharo1.x.
Secondly, not all maintainer can ensure that their project runs on
Pharo1.0 and Pharo1.1, etc.. So there is a separate problem of
identifying the versions of a project that are _known_ to work in
Pharo1.0 or Pharo1.1.
When a new Pharo1.x arrives, many projects may not work, but over time,
more and more of the projects get ported to Pharo1.x so determining a
means to communicate to users which projects are known to work is important.
I would say that we haven't completely settled the second issue. As
Miguel mentioned, I think it is clear that the following will be part of
the process
- Copy repositories of configurations (+mcz files) for each new
release
- Use version attributes for conditionally loading packages in version
methods.
I think that we're still up in the air (I know that I am) as to the best
method for controlling the actual load. Ideally, the solution would not
involve editing configurations (tags).
Technically, once you copied the configs/mcz files that are known to
work to a Pharo1.0 repository, all you need to do is use
#repositoryOverrides: to force the load to be done from the Pharo1.0
repository, but we want something that is very simple and doesn't
require an extra step and we're still discussing this.
Dale
Andreas Wacknitz wrote:
> Am 20.07.10 16:42, schrieb Miguel Enrique Cobá MartÃnez:
>> El mar, 20-07-2010 a las 10:17 +0200, Mariano Martinez Peck escribió:
>>> Hi Miguel. I understand your problem, and we are working on that with
>>> Dale and Stef. Having repositories for a specific Pharo version and so
>>> on. But we are just starting....
>>>
>>> By the moment, you can use what Sean told you, or, just update the
>>> configuration, but in a new version. I mean....if you had the version
>>> 2.3.4 that was released and working in pharo 1.0, then don't touch it,
>>> create a new one, say, 2.4 and that works in 1.1. Of course this is
>>> not the perfect solution, but for the moment. But one thing for sure:
>>> do not update the SAME version that was working for 1.0.
>>> Magma should continue working in 1.0 using the same metacello version.
>> Exactly. I will do it this night.
>>
>> BTW. What will be the solution, copying directories (debian does this
>> too. They copy the repository contents and then diverge from them. The
>> previous repository only receives bug fixes) but the solution of Dale,
>> as I understand it uses tags to identify what version is running on and
>> then load only the packages for that version. This solution is a third
>> alternative. So by now we have:
>>
>> - Copy repositories of configurations for each new release
>> - Use version attributes for conditionally loading packages in version
>> methods.
>> - Use tags to mark the pharo release a given version method applies.
>> Then metacello searches for the version method with the highest number
>> that is tagged with the release number of the image (got from
>> SystemVersion)
>>
>> Cheers
> Hi,
>
> Wouldn't it be good to also ask the maintainer of the offending packages
> to change the assignments such that Pharo will be happy without changing
> the preference?
>
> Regards,
> Andreas
>
>
>
> _______________________________________________
> Pharo-project mailing list
> Pharo-project(a)lists.gforge.inria.fr
> http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project
July 20, 2010
Re: [Pharo-project] Bug with Windows titles not refreshing (in OB)
by Lukas Renggli
I am not sure if this is a bug. I think this is intentionally
implemented like this.
Lukas
2010/7/20 Mariano Martinez Peck <marianopeck(a)gmail.com>:
> Hi, there is a bug with windows titles as they don't refresh and keeps a
> previous title.
>
> Steps to reproduce:
>
> 1) Search senders of a particular message, for example, doesNotUnderstand:
> 2) You will see that the opened windows for senders, has the title "Senders
> of '#doesNotUnderstand:"
> 3) Now, select one of the senders, for example, ContextPart >> send:
> selector to: rcvr with: args super: superFlag
> 4) That will open the senders of that message, BUT the windows title still
> says "Senders of '#doesNotUnderstand:"  instead of "Senders of
> '#send:to:with:super:"
>
> Issue: http://code.google.com/p/pharo/issues/detail?id=2707
>
> Cheers
>
> Mariano
>
> _______________________________________________
> Pharo-project mailing list
> Pharo-project(a)lists.gforge.inria.fr
> http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project
>
--
Lukas Renggli
www.lukas-renggli.ch
July 20, 2010
Re: [Pharo-project] [ANN 1.1] pre-built 1.1 Release #11411 Core
by Lukas Renggli
I only keep per project the artifacts of the last 10 builds + some
manually marked builds (releases).
The disk usage stabilized around 3 GB.
Lukas
On 20 July 2010 18:22, Stéphane Ducasse <stephane.ducasse(a)inria.fr> wrote:
> apparently ours kills our server :)
> the disc got filled up :)
>
> Stef
>
> On Jul 20, 2010, at 3:52 PM, Lukas Renggli wrote:
>
>> Thank you Marcus, my hudson is rebuilding the whole shebang now.
>>
>> Lukas
>>
>> On 20 July 2010 15:48, Marcus Denker <marcus.denker(a)inria.fr> wrote:
>>>
>>> Â Â Â Â https://gforge.inria.fr/frs/download.php/27296/PharoCore-1.1.zip
>>>
>>> --
>>> Marcus Denker  -- http://www.marcusdenker.de
>>> INRIA Lille -- Nord Europe. Team RMoD.
>>>
>>>
>>> _______________________________________________
>>> Pharo-project mailing list
>>> Pharo-project(a)lists.gforge.inria.fr
>>> http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project
>>>
>>
>>
>>
>> --
>> Lukas Renggli
>> www.lukas-renggli.ch
>>
>> _______________________________________________
>> Pharo-project mailing list
>> Pharo-project(a)lists.gforge.inria.fr
>> http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project
>
>
> _______________________________________________
> Pharo-project mailing list
> Pharo-project(a)lists.gforge.inria.fr
> http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project
>
--
Lukas Renggli
www.lukas-renggli.ch
July 20, 2010