Ask a Question related to PERL Modules, Design and Development.

  1. #1

    Default 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

  2. Similar Questions and Discussions

    1. 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. ...
    2. 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 => {...
    3. 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...
    4. 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', ...
    5. 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...
  3. #2

    Default Re: XML::Twig (attempted English translation)

    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
    harryfmudd [AT] comcast [DOT] net Guest

  4. #3

    Default 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

  5. #4

    Default Re: XML::Twig (attempted English translation)

    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
    harryfmudd [AT] comcast [DOT] net Guest

  6. #5

    Default 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 Wyant
    marie Guest

Posting Permissions

  • You may not post new threads
  • You may post replies
  • You may not post attachments
  • You may not edit your posts

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139