0

I am using Feeds and Feeds XPath Parser.

I have an XML source like this.

<xml>
  <records>
    <record>
      <EAC-CPF xmlns:eac="http://jefferson.village.virginia.edu/eac" xmlns:edit="http://nla.gov.au/nla.party" xml:id="_cb2bf3c2-b54c-42c3-a890-048c06549e45#10" xsi:schemaLocation="urn:isbn:1-931666-33-4 http://eac.staatsbibliothek-berlin.de/schema/cpf.xsd">
        <cpfDescription>
          <identity>...</identity>
        </cpfDescription>
      </EAC-CPF>
    </record>
  </records>
</xml>

Which I am trying to import with field settings like

EAC-CPF/cpfDescription/identity/...

With debugging turned on I can see that fields outside of the EAC-CPF node are correctly found whereas those within are not. I've tried various escaping of EAC-CPF but I'm wondering if its a limitation of XPath in PHP or the Parser module. Or is it the nested namespace and schema?

0

There are 2 errors regarding the xml:id and xsi:schemaLocation, but they are not fatal. I'm guessing the xsi namespace is defined previously.

There's nothing wrong with nested namespaces.

Is there a default namespace declare somewhere passed the root? That could be because of https://drupal.org/node/1220834.

The hyphen in EAC-CPF is not causing the problems.

Remember that if elements have a namepsace, the namespace must be present in the XPath query.

  • I've replaced the leading underscore in the xml:id which allows it to validate. I read about that somewhere, the first character. But the spec seems to think it is valid. xml:id follows the same rules as name which allow an underscore or a letter as the first character. So I'm confused. – Queenvictoria Feb 20 '14 at 22:49

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.