Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

XML prefix declaration #9

Open
ktk opened this issue Oct 5, 2016 · 4 comments
Open

XML prefix declaration #9

ktk opened this issue Oct 5, 2016 · 4 comments

Comments

@ktk
Copy link

ktk commented Oct 5, 2016

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?

@ktk
Copy link
Author

ktk commented Oct 5, 2016

FYI I tested with example8 and that doesn't seem to work either with latest release of RML-Mapper:

665 [main] ERROR be.ugent.mmlab.rml.processor.concrete.XPathProcessor  - XPath Exception: javax.xml.xpath.XPathException: javax.xml.xpath.XPathException: org.xml.sax.SAXParseException; systemId: file:///Users/ktk/workspace/zazuko/seco/usecases/i-web/input/simergy.xml; lineNumber: 10; columnNumber: 80; The prefix "simmodel" for element "simmodel:SimAppLibraryDefault_AppLibraryDefault_GlobalLibrary" is not bound.

@syats
Copy link

syats commented Jan 17, 2018

HI @ktk
I have been running into the same issues. Apparently namespaces and XPath is a complicated issue.
I wonder if you got around this in any way? I've even tried the competing RML implementation with the same results.
Any pointers would be appreciated.

@ktk
Copy link
Author

ktk commented Jan 17, 2018

@syats long time ago, to be honest I don't use RML anymore, codebase is too buggy and everyone I talked to with some Java clue told this is not code they want to touch. So not sure if there is a solution to that.

@florent-andre
Copy link

As of RMLio/rmlmapper-java#132, this issue should be closed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants