Click here to get back home

XML::Twig

 HomeNewsGroups | Search | About
 comp.lang.perl.modules    Post an article   get this group's latest topics as an RSS feed add this group's latest topics to your My MSN content add this group's latest topics to your My Yahoo content
Subject Author Date
XML::Twig marie 06-09-2006
Posted by marie on June 9, 2006, 1:50 pm
Please log in for more thread options


Bonjour =E0 tous,
J'ai besoin d'aide avec le module XML::Twig: les documents XML que je
veux analyser sont tr=E8s grands et leur traitement =E0 l'aide de
XML::Twig est prouv=E9 tr=E8s lent. J'aimerais utiliser 'twig_roots' ou
'twig_handlers' afin de choisir juste quelques parties des documents
XML.
Les parties que j'aimerais choisir sont des =E9l=E9ments qui ont des
attributs avec une certaine valeur. La valeur que je cherche change
pendant le traitement du document; il peut arriver par ex. que je
cherche, au d=E9but, l'=E9l=E9ment avec id=3D3, ensuite l'=E9l=E9ment avec
id=3D45 du m=EAme document etc.
Je voudrais donc savoir si je pourrais utiliser une variable dans la
condition concernant la valeur de l'attribut(peut-=EAtre dans une
expressions reguli=E8re?).

par ex. au lieu d'utiliser la cha=EEne de caract=E8res "BLA", utiliser
"$bla" ou /$bla/.
my $twig =3D XML::Twig->new( twig_handlers =3D> {'attribute[@value=3D"BLA"]'
=3D> \&fonction } );

Je l'ai essay=E9 mais =E7a n'a pas march=E9... Je vous remercie par avance
pour votre aide.


Posted by harryfmudd [AT] comcast [DOT] on June 9, 2006, 3:15 pm
Please log in for more thread options


marie wrote:

> Bonjour à tous,
> J'ai besoin d'aide avec le module XML::Twig: les documents XML que je
> veux analyser sont très grands et leur traitement à l'aide de
> XML::Twig est prouvé très lent. J'aimerais utiliser 'twig_roots' ou
> 'twig_handlers' afin de choisir juste quelques parties des documents
> XML.
> Les parties que j'aimerais choisir sont des éléments qui ont des
> attributs avec une certaine valeur. La valeur que je cherche change
> pendant le traitement du document; il peut arriver par ex. que je
> cherche, au début, l'élément avec id=3, ensuite l'élément avec
> id=45 du même document etc.
> Je voudrais donc savoir si je pourrais utiliser une variable dans la
> condition concernant la valeur de l'attribut(peut-être dans une
> expressions regulière?).
>
> par ex. au lieu d'utiliser la chaîne de caractères "BLA", utiliser
> "$bla" ou /$bla/.
> my $twig = XML::Twig->new( twig_handlers => {'attribute[@value="BLA"]'
> => \&fonction } );
>
> Je l'ai essayé mais ça n'a pas marché... Je vous remercie par avance
> pour votre aide.
>

Bad translation, with translator's note numbers in square brackets
referring to the bottom of the translation.

Good day to all:

I have need of help with the XML::Twig module: the XML documents which I
must analyze are very large and their handling with the help of
XML::Twig has proven very slow [1]. I would like to use 'twig_roots' or
'twig_handlers' after [2] choosing just some parts of the XML documents.

The parts which I would like to chose are the elements which have
attributes with a certain value. The value for which i search changes
depending on the handling of the document; it can happen [3] (for
example) that I search for, at first, an element with id=3, and then an
element with id=45 in the same document, etc.

For example, ???? [4] to use the string "BLA", using "$bla" or /$bla/.

my $twig = XML::Twig->new (twig_handlers => {'attribute[@value="BLA"]'
=> \&function } );

I have tried but this does not work. I thank you in advance for your help.

Marie (Tom Wyant, translator)

[1] fr 'lent' = en 'slow'? Not sure whether this refers to the
processing speed, or difficulty of coding. TW

[2] fr 'afin' = en 'after'? TW

[3] fr 'arrive' = en 'arrive', but that does not make sense in context.
Maybe 'transpire' rather than 'happen'? TW

[4] fr 'au lieu'. I have no idea what the English is. Sorry. TW

Posted by harryfmudd [AT] comcast [DOT] on June 10, 2006, 12:35 pm
Please log in for more thread options


harryfmudd [AT] comcast [DOT] net wrote:
> marie wrote:
>
>> Bonjour à tous,
>> J'ai besoin d'aide avec le module XML::Twig: les documents XML que je
>> veux analyser sont très grands et leur traitement à l'aide de
>> XML::Twig est prouvé très lent. J'aimerais utiliser 'twig_roots' ou
>> 'twig_handlers' afin de choisir juste quelques parties des documents
>> XML.
>> Les parties que j'aimerais choisir sont des éléments qui ont des
>> attributs avec une certaine valeur. La valeur que je cherche change
>> pendant le traitement du document; il peut arriver par ex. que je
>> cherche, au début, l'élément avec id=3, ensuite l'élément avec
>> id=45 du même document etc.
>> Je voudrais donc savoir si je pourrais utiliser une variable dans la
>> condition concernant la valeur de l'attribut(peut-être dans une
>> expressions regulière?).
>>
>> par ex. au lieu d'utiliser la chaîne de caractères "BLA", utiliser
>> "$bla" ou /$bla/.
>> my $twig = XML::Twig->new( twig_handlers => {'attribute[@value="BLA"]'
>> => \&fonction } );
>>
>> Je l'ai essayé mais ça n'a pas marché... Je vous remercie par avance
>> pour votre aide.
>>
>
> Bad translation, with translator's note numbers in square brackets
> referring to the bottom of the translation.
>
> Good day to all:
>
> I have need of help with the XML::Twig module: the XML documents which I
> must analyze are very large and their handling with the help of
> XML::Twig has proven very slow [1]. I would like to use 'twig_roots' or
> 'twig_handlers' after [2] choosing just some parts of the XML documents.
>
> The parts which I would like to chose are the elements which have
> attributes with a certain value. The value for which i search changes
> depending on the handling of the document; it can happen [3] (for
> example) that I search for, at first, an element with id=3, and then an
> element with id=45 in the same document, etc.
>
> For example, ???? [4] to use the string "BLA", using "$bla" or /$bla/.
>
> my $twig = XML::Twig->new (twig_handlers => {'attribute[@value="BLA"]'
> => \&function } );
>
> I have tried but this does not work. I thank you in advance for your help.
>
> Marie (Tom Wyant, translator)
>
> [1] fr 'lent' = en 'slow'? Not sure whether this refers to the
> processing speed, or difficulty of coding. TW
>
> [2] fr 'afin' = en 'after'? TW
>
> [3] fr 'arrive' = en 'arrive', but that does not make sense in context.
> Maybe 'transpire' rather than 'happen'? TW
>
> [4] fr 'au lieu'. I have no idea what the English is. Sorry. TW

See the translation by the original poster in the adjacent thread. The
above translation is wrong in at least two important respects:

[2] should have been translated "in order to"

[4] was the heart of the matter. With the untranslated part translated,
the import was that the original poster wanted to specify the desired
string using a variable rather than a literal.

In short, anyone responding should respond to the adjacent thread, not
this one.

The road to Hell is paved with good intentions. Sigh.

Tom Wyant

Posted by marie on June 10, 2006, 7:01 pm
Please log in for more thread options


Thank you all. In fact it was my fault that I didn't write the first
message in English:) I've managed to find the solution to the problem
concerning the use of variables in XML::Twig.
Thanks again!


harryfmudd [AT] comcast [DOT] net a =E9crit :

> harryfmudd [AT] comcast [DOT] net wrote:
> > marie wrote:
> >
> >> Bonjour =E0 tous,
> >> J'ai besoin d'aide avec le module XML::Twig: les documents XML que je
> >> veux analyser sont tr=E8s grands et leur traitement =E0 l'aide de
> >> XML::Twig est prouv=E9 tr=E8s lent. J'aimerais utiliser 'twig_roots' ou
> >> 'twig_handlers' afin de choisir juste quelques parties des documents
> >> XML.
> >> Les parties que j'aimerais choisir sont des =E9l=E9ments qui ont des
> >> attributs avec une certaine valeur. La valeur que je cherche change
> >> pendant le traitement du document; il peut arriver par ex. que je
> >> cherche, au d=E9but, l'=E9l=E9ment avec id=3D3, ensuite l'=E9l=E9ment =
avec
> >> id=3D45 du m=EAme document etc.
> >> Je voudrais donc savoir si je pourrais utiliser une variable dans la
> >> condition concernant la valeur de l'attribut(peut-=EAtre dans une
> >> expressions reguli=E8re?).
> >>
> >> par ex. au lieu d'utiliser la cha=EEne de caract=E8res "BLA", utiliser
> >> "$bla" ou /$bla/.
> >> my $twig =3D XML::Twig->new( twig_handlers =3D> {'attribute[@value=3D"=
BLA"]'
> >> =3D> \&fonction } );
> >>
> >> Je l'ai essay=E9 mais =E7a n'a pas march=E9... Je vous remercie par av=
ance
> >> pour votre aide.
> >>
> >
> > Bad translation, with translator's note numbers in square brackets
> > referring to the bottom of the translation.
> >
> > Good day to all:
> >
> > I have need of help with the XML::Twig module: the XML documents which I
> > must analyze are very large and their handling with the help of
> > XML::Twig has proven very slow [1]. I would like to use 'twig_roots' or
> > 'twig_handlers' after [2] choosing just some parts of the XML documents.
> >
> > The parts which I would like to chose are the elements which have
> > attributes with a certain value. The value for which i search changes
> > depending on the handling of the document; it can happen [3] (for
> > example) that I search for, at first, an element with id=3D3, and then =
an
> > element with id=3D45 in the same document, etc.
> >
> > For example, ???? [4] to use the string "BLA", using "$bla" or /$bla/.
> >
> > my $twig =3D XML::Twig->new (twig_handlers =3D> {'attribute[@value=3D"B=
LA"]'
> > =3D> \&function } );
> >
> > I have tried but this does not work. I thank you in advance for your he=
lp.
> >
> > Marie (Tom Wyant, translator)
> >
> > [1] fr 'lent' =3D en 'slow'? Not sure whether this refers to the
> > processing speed, or difficulty of coding. TW
> >
> > [2] fr 'afin' =3D en 'after'? TW
> >
> > [3] fr 'arrive' =3D en 'arrive', but that does not make sense in contex=
t=2E
> > Maybe 'transpire' rather than 'happen'? TW
> >
> > [4] fr 'au lieu'. I have no idea what the English is. Sorry. TW
>
> See the translation by the original poster in the adjacent thread. The
> above translation is wrong in at least two important respects:
>
> [2] should have been translated "in order to"
>
> [4] was the heart of the matter. With the untranslated part translated,
> the import was that the original poster wanted to specify the desired
> string using a variable rather than a literal.
>
> In short, anyone responding should respond to the adjacent thread, not
> this one.
>
> The road to Hell is paved with good intentions. Sigh.
>=20
> Tom Wyant


Similar ThreadsPosted
XML Twig help April 8, 2005, 2:18 pm
Using XML::Twig December 19, 2005, 4:59 pm
XML::Twig June 9, 2006, 6:27 pm
XML::Twig question December 23, 2007, 2:25 pm
Help with XML::Twig xpath syntax, please October 16, 2005, 6:56 pm
XML::Twig parseurl with input Headers/XML January 16, 2005, 10:58 pm
XML::Twig::XPath - strange problem November 10, 2005, 9:44 am
XML::Twig produces double encoded UTF-8 January 4, 2007, 3:36 pm
XML::Twig constructor disregarding map_xmlns - bug in module? August 29, 2004, 1:21 pm
Problem Parsing Huge XML file using XML::Twig April 23, 2007, 10:24 pm

Our other projects:

Art Dolls, Fairies and Mermaids - Sunnyfaces.net

Roy's Linux, Programming and Search Engines messages

1-Script XML SitemapXML Sitemap