First performance is not always a problem, so let's not assume it could be. Generally, if the XML is typed in (as opposed to generated from various data bases and such) you can safely assume that neither speed nor memory usage will cause you much trouble.

Whether the definitions should be right in the text or not... I guess in this case it models the way the notes are written, which seems to make sense. Later this creation-oriented XML can then be re-purposed and the definitions extracted, maybe keeping only links to them remaining in the text. In any case there will still be links in the text that could only be found by the inefficient //link XPath expression ;--). That's what you get when working with documents, which are not as "informationally organized" as data!

Really, you have to spend your computer's CPU cycles doing something (besides displaying windows all over your desktop and ads for Pair Networks in the browser ;--). So you might as well use them for something useful that makes taking notes easier in this case.

Finally, if you use XML::Twig, or any stream module for what matters, processing those def elements is actually not a huge hit performance wise, its just something else that happens during parsing.


In reply to Re: Re: Re: Re: Picking an XML Module by mirod
in thread Picking an XML Module by ninja-joe

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.