Namespaces in XML
i am declaring a namepace, but cascade seems to be stripping it
out, take a look at the attached file.
____________________________________________________ from the
mailing list:
We are attempting to publish podcasts with Cascade and need to be able to use the ‘itunes’ namespace in the tags (e.g <itunes:name>) we’re getting an error “An error occurred: Error on line 6: The prefix "itunes" for element "itunes:subtitle" is not bound” and wondered if others had run into the same problem or if we’re just missing something.
We’re currently running Cascade 6.4
_________________________________________________ For the rendered
page to be valid XML, this namespace prefix needs to be declared
before being used. Usually this would be done at the top of the
template used to output the page.
You can read more about declaring namespaces in the w3c
spec:
http://www.w3.org/TR/REC-xml-names/#ns-decl.
Feel free to post to our help.hannonhill.com with any additional questions.
Thanks,
Bradley
-
Screenshot.png 142 KB
Discussions are closed to public comments.
If you need help with Cascade CMS please
start a new discussion.
Keyboard shortcuts
Generic
? | Show this help |
---|---|
ESC | Blurs the current field |
Comment Form
r | Focus the comment reply box |
---|---|
^ + ↩ | Submit the comment |
You can use Command ⌘
instead of Control ^
on Mac
Support Staff 1 Posted by Tim on 14 Jul, 2010 02:07 PM
Hi Nick,
I believe the namespace may be getting stripped since there aren't any elements using that namespace. Try to prefix one of the elements in your rss content with
<itunes:>
and see if that works.2 Posted by nick.shontz on 14 Jul, 2010 02:27 PM
hey,
That did the trick.
thanks much!
nick
Support Staff 3 Posted by Tim on 14 Jul, 2010 02:35 PM
Perfect! Thanks for the update!
Tim closed this discussion on 14 Jul, 2010 02:35 PM.
nick.shontz re-opened this discussion on 14 Jul, 2010 03:52 PM
4 Posted by nick.shontz on 14 Jul, 2010 03:52 PM
Hey,
looks like was a false alarm. i can use the itunes namespace in the template, but i can't use it in the velocity that i'm using to create the <item>...<item> sections or the velocity that is applied to the default region that creates the channel info.
i'm getting the same error "An error occurred: Error on line 7: The prefix "itunes" for element "itunes:subtitle" is not bound."
any ideas?
nick
5 Posted by Bradley Wagner on 14 Jul, 2010 10:35 PM
Please attach the relevant portions of your Velocity/XSLT format so we can look at it.
6 Posted by nick.shontz on 14 Jul, 2010 10:54 PM
here are the files, included are the template, the default block's xml (it has a customized data definition) and the velocity i'm applying to it. if you remove the <itunes:XXXX> tags from the velocity it works just fine.
7 Posted by nick.shontz on 30 Jul, 2010 02:15 PM
yeah, so still waiting to hear back on this...
8 Posted by Joel on 30 Jul, 2010 02:22 PM
Nick,
My apologies. We're still looking into the cause of this issue. As soon as we have some feedback I will be sure to let you know.
In the interim, please use the suggested workaround below.
Add NS declaration into the Velocity format where the namespace was used. I.e.:
<itunes:subtitle xmlns:itunes="url">subtitle</itunes:subtitle>
Doing it this way:
Support Staff 9 Posted by Tim on 11 Aug, 2010 03:36 PM
Revisiting this issue...since individual regions are rendered as complete XML documents, the namespace will need to be declared in the Format (whether using Velocity or XSL) in order for this to work as expected.
Hope this helps!
Tim closed this discussion on 11 Aug, 2010 03:36 PM.