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

Feature Request: Support for custom tags/namespaces #50

Open
iPM-Maiwald opened this issue Nov 5, 2021 · 5 comments
Open

Feature Request: Support for custom tags/namespaces #50

iPM-Maiwald opened this issue Nov 5, 2021 · 5 comments

Comments

@iPM-Maiwald
Copy link

iPM-Maiwald commented Nov 5, 2021

We use custom tags. To support a valid RSS-Feed, we have a custom prefix, which has its own namespace in the rss tag.

RSS-Feed
<rss version="2.0" xmlns:prefix="namespaceURI">

We also changed the default case in the ItemTag.php like this.

default:
  $itemTag = null;

  if(strpos($this->tag, ':') !== false){
    $parts = explode(':', $this->tag);
    $prefix = $parts[0];
    $localName = $parts[1];
    $namespaceURI = 'www.ournamespace.com';
    //TODO lookup namespaceURI from $prefix
    $itemTag = $feedItem->get_item_tags($namespaceURI, $localName);
  }else{
    $itemTag = $feedItem->get_item_tags('', $this->tag);
  }

  if(!empty($itemTag)) {
    $value = $itemTag[0]['data'];
  }
break;

For looking up a namespace I suppose one needs to use something like that https://www.php.net/manual/en/xmlreader.lookupnamespace.php

Maybe you can implement a working solution?

Regards

Marcus

@ChrisRAoW
Copy link
Owner

@iPM-Maiwald Can you send over an example of your rss?

@iPM-Maiwald
Copy link
Author

@ChrisRAoW can you mail me? m.maiwald@ipark-media.de

@ChrisRAoW
Copy link
Owner

@iPM-Maiwald I implemented a functionality to support custom fields. Could this work for you as well?

Check the ReadME file in the master branch

@iPM-Maiwald
Copy link
Author

@ChrisRAoW Yes this would work. Do you have an ETA on the next release?

@ChrisRAoW
Copy link
Owner

@iPM-Maiwald It's already there. Version 1.6

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

2 participants