Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8024761
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 4, 20262026-06-04T22:57:18+00:00 2026-06-04T22:57:18+00:00

So I’ve been working on some XSLT to modify YouTube’s RSS XML, and of

  • 0

So I’ve been working on some XSLT to modify YouTube’s RSS XML, and of course as soon as I got it working, they’ve changed their formatting. Before, each video’s unique ID was stored between <videoid> tags, which you could then use to create a URL. But now the only way to get a video’s URL is from a tag like this

<media:player url='https://www.youtube.com/watch?v=XXXXXXXXXXX&amp;feature=youtube_gdata_player'/>`

which is contained within <media:group> tags.

The way I’ve been trying to get at it is

<xsl:value-of select="media:group/media:player@url" />

but doing that gives me a compilation error that says

xsl:value-of : could not compile select expression 'media:group/media:player@url'

Does anyone see anything wrong with that?

Also, as a side note, I want to do something similar with

<xsl:value-of select="media:group/media:thumbnail@url" />

however there are several <media:thumbnail> tags for each entry; would this just grab the first one, or would this potentially cause errors?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-04T22:57:21+00:00Added an answer on June 4, 2026 at 10:57 pm

    you are missing a / in your XPath. Try:

    <xsl:value-of select="media:group/media:player/@url" />
    

    As far as DOM API is concerned, attributes belong to an element. The XPath goes about it in a slightly different way. Child nodes live on the child:: axes (which is the default so you rarely see it used explicitly) and attributes live on the atribute:: axes (you can get there with the abbreviated @). When constructing an XPath expression you are basically building a sequence of location steps separated by /. An attribute is “one location step” away from the element owning it.

    To the second part of your question. The selector will create a sequence (think node list) of all nodes that match the expression and will do what the xsl: instruction prescribes to do on that sequence. In your case (xsl:value-of), all @url of all matching media:thumbnail will be put together in a node-set that will be further converted to a string:

    A node-set is converted to a string by returning the string-value of the node in the node-set that is first in document order

    So you will get the value of the “first” one. That said, I would argue that running xsl:value-of on a sequence of more than one node is not really intuitive (even though the spec clearly says what it will do) so you would do a favor to someone reading the code after you if you be more specific with your selectors. Something like: media:group/media:thumbnail[1]/@url

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

We are using XSLT to translate a RIXML file to XML. Our RIXML contains
I'm working with an upstream system that sometimes sends me text destined for HTML/XML
I have a jquery bug and I've been looking for hours now, I can't
link Im having trouble converting the html entites into html characters, (&# 8217;) i
I have just tried to save a simple *.rtf file with some websites and
For some reason, after submitting a string like this Jack’s Spindle from a text
I have a string like this: La Torre Eiffel paragonata all&#8217;Everest What PHP function
this is what i have right now Drawing an RSS feed into the php,
I've got a string that has curly quotes in it. I'd like to replace
In my XML file chapters tag has more chapter tag.i need to display chapters

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.