Skip to content

XML prefix declaration #9

Description

@ktk

I have an XML file that looks similar to example8 but with one difference: The initial element is already using a namespace, here iweb_authorities:

<?xml version="1.0" encoding="UTF-8"?>
<iweb_authorities:authoritiesMessage xmlns:iweb_authorities="http://www.i-web.ch/schema/IwebAuthorities/1" xmlns:iweb_general="http://www.i-web.ch/schema/IwebGeneral/1" xmlns:iweb_ris_general="http://www.i-web.ch/schema/IwebRISGeneral/1" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:eCH-0007="http://www.ech.ch/xmlns/eCH-0007/6" xsi:schemaLocation="http://www.i-web.ch/schema/IwebAuthorities/1 http://www.i-web.ch/schema/IwebAuthorities/1/IwebAuthorities.xsd http://www.i-web.ch/schema/IwebGeneral/1 http://www.i-web.ch/schema/IwebGeneral/1/IwebGeneral.xsd http://www.i-web.ch/schema/IwebRISGeneral/1 http://www.i-web.ch/schema/IwebRISGeneral/1/IwebRISGeneral.xsd http://www.ech.ch/xmlns/eCH-0007/6 http://www.ech.ch/xmlns/eCH-0007/6/eCH-0007-6-0.xsd">
  <iweb_authorities:header>
    <iweb_general:messageId>65653265</iweb_general:messageId>
    <iweb_general:senderId>i-web</iweb_general:senderId>
    <iweb_general:sendDate>2016-04-15T08:00:03</iweb_general:sendDate>
    <iweb_general:sendingApplication>icms</iweb_general:sendingApplication>
    <iweb_general:receiverId>lindas</iweb_general:receiverId>
    <iweb_general:receivingApplication>behoerdenverzeichnis</iweb_general:receivingApplication>
  </iweb_authorities:header>
  <iweb_authorities:authority>
    <iweb_authorities:metaData>
      <iweb_general:objectId>6746</iweb_general:objectId>
      <iweb_general:validFrom>0001-01-01T00:00:00</iweb_general:validFrom>
      <iweb_general:validUntil>9999-12-31T23:59:59</iweb_general:validUntil>
      <iweb_general:URL>http://www.gemeinde-riederalp.ch/de/politik/behoerden/</iweb_general:URL>
    </iweb_authorities:metaData>

My mapping starts like this:

<#Authority>
  rml:logicalSource [
    rml:source "input/riederalp/riederalp_behoerden.xml";
    rml:referenceFormulation ql:XPath;
    rml:iterator "/iweb_authorities:authoritiesMessage/iweb_authorities:authority"
  ]; 

but that fails as it doesn't seem to recognize the first iweb_authorities prefix:

663 [main] ERROR be.ugent.mmlab.rml.processor.concrete.XPathProcessor  - XPathException javax.xml.xpath.XPathException: javax.xml.xpath.XPathException: nu.xom.XPathException: XPath error: XPath expression uses unbound namespace prefix iweb_authorities for the expression /iweb_authorities:authoritiesMessage/iweb_authorities:authority

I tested the XPath expression in Eclipse where it works fine, it figures out the prefixes on its own as defined in the prefixed element itself in the XML.

Any ideas on how this should be specified in RML?

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions