Search

Mmm ... I m afraid the "yes. :o)" was to positive :-). I can't get it to work with the name()

Just a little explanation for my problem.

The client wants to filter on three simple types: houses, appartment and plots instead of a long list of several types (villa, mansion, etc). Those "simple" types are the names of the parent nodes in the xml.

I could make a function to catch all the different types in three categories. But the types can be in theory endless and change every day. Beyond the fact that they are categorized in the xml and that feels like reinventing a wheel.

I don't get why it isn't working...

You could always use the php functions to get the name, I wouldn't know how to do that though.

I've just twigged why using name() the way you have doesn't work. You've used the | operator as though it were or.

When using name() you will have to be specific as to which node you want as it returns a string. The | operator is a union operator, not or, so it is trying to join nodes into a nodeset, which it can't do with strings.

Try it using or instead and see what happens...

I will give or a shot.

or is not valid and just one value with name() is also not valid : (

This really bothers me...

Can you try: name(Wonen/Appartement/self::*)

I am trying to play with a solution for this, but I keep getting stuck on the fact that this isn't valid XML.

There are loads of undeclared html entities in this xml which are tripping up xpathr.com

I think I may have narrowed down the syntax though...

name(Wonen/Appartement | Wonen/Woonhuis | OverigOG | Bouwgrond)

Thank you! This syntax works!

If I understand it correct: text() and node() are selectors or maybe better tests and if true it returns a value. Name() is a function which needs one or more parameters.

Is there a way to prevent certain entries from importing if a field is empty?

i.e. XMLIMPORTER setup to import 1,2,3,4,5 deleagates from an XML entry. but if only the fields for delegate 1 are present ignore the the other fields and continue?

Not too hot on what XMLImporter is capable of.

Is it possible to import XML feed from a Symphony generated page that is set to admin?

I get a error 404 on a hidden page I've created. I'm using Symphony to transform some ugly XML into Symphony friendly XML to import into a Section using XMLImporter but I'd like to only grant admin access to the page so no one sees the feed data bar me.

If I set the page to admin and then run an import with XMLImporter to feed fails as the page renders 404 to the XMLImporter.

Any way around this?

Just guessing: You might have to save the raw xml-page and upload it to some static location.

I have the raw XML in a document in the workspace folder.. this is being transformed onto a Symphony page into a nice feed structure for importing.

But putting that nicely rendered XML page into admin only view isn't possible it seems with XMLImporter.

One word: bugger.

I know for a fact I've done this before with exactly the same process using admin to hide the pages, and it worked. Definitely worked.

This means that there could be a bug somewhere.

Ah, now I remember... It uses the Gateway class, so you will need to send an auth-token along in the url.

Ahh right my query used an underscore.. I'll check on the morrow!

Finally got this bad boy working! woop.. How do you guys and gals deal with paginated XML to import?

I have a CURL request to an API that returns a node that inidcates there are 4 pages of XML entries. I only get the first page in the request so using Dynamic or Remote Datasource isn't possible right?

The XML needs transforming on my end of the stream before being spat out onto the hidden+admin rendered symphony page in preparation for XMLImport.

Do you create an import rule for each page returned or is there a neater way?

Was prefering this method over Remote Datasource as the data is required for Delegate info at a conference.

My approach at the moment is a curl_multi request to retrieve total of entries based on initial curl request for amount of pages > then rebuild the XML file locally before transforming and then finally XMLImporting :)

Thoughts?

Also, I've noticed that my 2 XMLImport rules are importing into the same Section as required by there are duplicates appearing even though I have a unique field assigned and have ensured that the field value is abslutely unique :( bug?

Also for those not wanting to get their hands dirty or on shared host with Cron:

for $10 a yr I have multiple cron jobs running each day using this service: https://www.setcronjob.com/

Can xmlimporters trigger a notification on success or failure of import? i.e. send and email.

It looks like XML Importer offers delegates for after it updates or creates entries. You could create an extension that subscribes to both of those and fires off an email.

It doesn’t look like there is a corresponding delegate that fires on import failure, but perhaps you could add one?

Ok thanks,

Will see what I can do in next few weeks.. our world would be much easier without clients getting in the way tssk! :)

Just started a discussion about a problem with XML importer expecting a string, receiving an array..

maybe you guys know more about this?

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