in reply to Re^3: XML::Twig Text replacement
in thread XML::Twig Text replacement

There are actually 3 ways of dealing with namespaces, 2 of which are supported by XML::Twig:

For XML::Twig, consistency is not as important as convenience, and I the current behaviour seems to be convenient for most users. I'll look into adding an option to just drop namespaces, it should not be too difficult, but I am not sure how useful it would be.

Replies are listed 'Best First'.
Re^5: XML::Twig Text replacement
by ikegami (Patriarch) on May 03, 2010 at 15:44 UTC

    There are actually 3 ways of dealing with namespace

    "Drop" and "ignore" mean the same thing. At the very least, the difference is ambiguous. Let's clarify:

    • Standard support (verbose)
    • Ignore namespace declarations (assume everything is in the null namespace)
    • Ignore namespace declarations and make prefixes significant.

    The last is XML::Twig's default. It also supports the first.

    For XML::Twig, consistency is not as important as convenience

    That's exactly the point I was making.

    Prefixes are arbitrary strings that can and do change from document to document. The employment of a default namespace also can and does change from document to document.

    It would very convenient if it could ignore namespaces, but it doesn't have a way of doing that. Instead of just ignoring namespaces, the default is to make make the prefix significant. Not only is that a step in the wrong direction, it makes it unusable in theory and in practice.

    Being unable to use XML::Twig under common circumstances is not convenient at all.