Search

@whgdesign -

Under the included elements instead of / put //Pand, so your XML Importer XPath would be like this..

Included elements: //Pand

Fields:

PandID XPath Expression: PandID/text()

KantoorID XPath Expression: KantoorID/text()

UID XPath Expression: UID/text()

DatumGewijzigd XPath Expression: DatumGewijzigd/text()

See if that works

I did:

Included elements: // and an error appears DOMXPath::evaluate(): Invalid expression

Sorry, I made a typo above (which I corrected). It should be...

Included elements: //Pand

There is no error as before, but when I run the importer the following error appears: Import Failed

    No entries to import.

What does your XML look like?

@designermonkey - @whgdesign posted his XML.

The XML can be found at this link.

Wow, completely missed that one... Don't know how!

So then, the ds namespace you have is a default namespace for unprefixed xmlnodes which will get confused as you've had to add ds as the name.

To get this to work (tested) you need to change the included elements to

//ds:Pand

and then all the xPaths to

ds:PandID/text()
ds:KantoorID/text()
ds:UID/text()
ds:DatumGewijzigd/text()

respectively. Prefixing it with the name you have had to declare will find all nodes that belong to that namespace, whether they are prefixed in the xml or not.

When I try your solution, I'll get this error.

Attachments:
Schermafbeelding 2011-06-15 om 10.09.12.png

Interesting...

What version of Sym are you using? I tested it on the most recent stable version and it worked perfectly using the XML link you supplied.

Previously I used Symphony version 2.2. After your post I updated the version to 2.2.1 and I still has the same problem.

Can you post a picture of your settings?

No problem, here you go...

Have you tried deleting the importer and rebuilding it? I let it find the namespaces, then added the ds namespace by hand (as it's namespacing an element).

Attachments:
Symphony – XML Importers_1308165846464.png

I reinstalled the extension and added a new XML Importer. Inside the importer I added a new namespace ds - http://ws1.vbo.nl/aanbodmakelaar

It didn't work and the same error appeared.

So, I just double chcked my setup, and I was on the unstable branch as I'd done a little development on the XML Importer, I've since changed to the master branch and done a complete git pull to update to the latest version of that branch and all is still working fine.

Can you check that you're definitely on the latest master branch? I know you probably are.

I can't understand why I can do this and you can't. Something is definitely amiss somewhere...

Can you zip up and send me a copy of the importer file john dot porter at designermonkey dot co dot uk

@designermonkey I send you an email.

I'm on holiday in a tent for a week, but I will definitely look when I get back

Alright, thanks for your message. Have a nice holiday..

@designermonkey did you saw the email I've send you?

This is the same error @czheng has been experiencing lately. While it's a mystery why some environments seem fine and others not, the root of the problem seems to lie in the validateXPath function because it doesn't apply namespaces to the document when it tries to validate the user's XPath expression.

The workaround for the moment is to edit the importer file directly and not through the interface.

Create an account or sign in to comment.

Symphony • Open Source XSLT CMS

Server Requirements

  • PHP 5.3-5.6 or 7.0-7.3
  • PHP's LibXML module, with the XSLT extension enabled (--with-xsl)
  • MySQL 5.5 or above
  • An Apache or Litespeed webserver
  • Apache's mod_rewrite module or equivalent

Compatible Hosts

Sign in

Login details