Namespace issues

When XML documents include elements from multiple namespaces (see Chapter 10), it is possible that the document will contain element instances with the same name, but from different namespaces. Consider the following example (a modified version of an example first introduced in Chapter 10). There are two Score elements in this document fragment:

<competitionEntry xmlns:M="...">
  <competition>Piano</competition>
  <competitor>J Smith</competitor>
  <score>57</score>
  <M:played>
    <M:composer>George Gershwin</M:composer>
    <M:composition>Rhapsody in Blue</M:composition>
    <M:score>Ferde Grofé</M:score>
  </M:played>
</competitionEntry>

This example causes no issues for XPointer expressions, as the two XPointer examples below make clear. The ...

Get XML Companion, The, Third Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.