Ask a Question related to PERL Modules, Design and Development.
-
marie #1
XML::Twig
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.
marie Guest
-
Using XML::Twig
I'm a little confused using the Perl XML::Twig module. What I'm trying to do is output a subset of the matched twig_root entries in an XML file. ... -
XML Twig help
Hi, Just starting to learn Twig and Perl. Keep getting an error on this line: my $twig = XML::Twig->new(twig_roots => {... -
XML::Twig parser junk.
Hi, I'm trying to use XML::Twig to insert dates into <unitdate> tags to create an EAD finding aid, but I'm running into a strang XML::Twig parser... -
XML::Twig empty_tags
Am I mis-understanding the meaning of the empty_tags property? The docs say: my $twig=XML::Twig->new( empty_tags => 'html', ... -
twig requires 5.004, I am using Windows v5.6.1, which twig do I need
I would like to use XML::Twig but use XML::Twig returns "Compilation failed in require, BEGIN failed - compilation aborted." I downloaded... -
harryfmudd [AT] comcast [DOT] net #2
Re: XML::Twig (attempted English translation)
marie wrote:
Bad translation, with translator's note numbers in square brackets> 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.
>
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
harryfmudd [AT] comcast [DOT] net Guest
-
marie #3
XML::Twig
Hello, I need some help with the XML::Twig module. The XML documents
that I am working with are rather big and their processing with
XML::Twig is very slow. I would like to use 'twig_roots' or
'twig_handlers' in order to select the parts of the XML documents that
interest me.
Those parts that I want to select are some elements that have attributs
with a certain value. The value that interests me can change during
processing of the document, so at a moment I maybe have to search for
the element with id=3 and then for the element - of the same document -
with id=45 etc.
I would like to know if I could use a variable in the condition
concerning the attribute value (maybe in a regular expression?). For
instance, instead of using the string "BLA", use "$bla" or /$bla/ in
my $twig = XML::Twig->new( twig_handlers => {'attribute[@value="BLA"]'
=> \&function} );
I have already tried that but it didn't work. Thank you in advance for
your help.
marie Guest
-
harryfmudd [AT] comcast [DOT] net #4
Re: XML::Twig (attempted English translation)
harryfmudd [AT] comcast [DOT] net wrote:
See the translation by the original poster in the adjacent thread. The> 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
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
harryfmudd [AT] comcast [DOT] net Guest
-
marie #5
Re: XML::Twig (attempted English translation)
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 écrit :
> 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 Wyantmarie Guest



Reply With Quote

