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 41765
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 10, 20262026-05-10T15:13:58+00:00 2026-05-10T15:13:58+00:00

I am receiving a 3rd party feed of which I cannot be certain of

  • 0

I am receiving a 3rd party feed of which I cannot be certain of the namespace so I am currently having to use the local-name() function in my XSLT to get the element values. However I need to get an attribute from one such element and I don’t know how to do this when the namespaces are unknown (hence need for local-name() function).

N.B. I am using .net 2.0 to process the XSLT

Here is a sample of the XML:

<?xml version='1.0' encoding='UTF-8'?> <feed xmlns='http://www.w3.org/2005/Atom'>    <id>some id</id>    <title>some title</title>    <updated>2008-09-11T15:53:31+01:00</updated>    <link rel='self' href='http://www.somefeedurl.co.uk' />    <author>       <name>some author</name>       <uri>http://someuri.co.uk</uri>    </author>    <generator uri='http://aardvarkmedia.co.uk/'>AardvarkMedia script</generator>    <entry>       <id>http://soemaddress.co.uk/branded3/80406</id>       <title type='html'>My Ttile</title>       <link rel='alternate' href='http://www.someurl.co.uk' />       <updated>2008-02-13T00:00:00+01:00</updated>       <published>2002-09-11T14:16:20+01:00</published>       <category term='mycategorytext' label='restaurant'>Test</category>       <content type='xhtml'>          <div xmlns='http://www.w3.org/1999/xhtml'>             <div class='vcard'>                <p class='fn org'>some title</p>                <p class='adr'>                   <abbr class='type' title='POSTAL' />                   <span class='street-address'>54 Some Street</span>                   ,                   <span class='locality' />                   ,                   <span class='country-name'>UK</span>                </p>                <p class='tel'>                   <span class='value'>0123456789</span>                </p>                <div class='geo'>                   <span class='latitude'>51.99999</span>                   ,                   <span class='longitude'>-0.123456</span>                </div>                <p class='note'>                   <span class='type'>Review</span>                   <span class='value'>Some content</span>                </p>                <p class='note'>                   <span class='type'>Overall rating</span>                   <span class='value'>8</span>                </p>             </div>          </div>       </content>       <category term='cuisine-54' label='Spanish' />       <Point xmlns='http://www.w3.org/2003/01/geo/wgs84_pos#'>          <lat>51.123456789</lat>          <long>-0.11111111</long>       </Point>    </entry> </feed> 

This is XSLT

<?xml version='1.0' encoding='UTF-8' ?>  <xsl:stylesheet version='1.0' xmlns:xsl='http://www.w3.org/1999/XSL/Transform' xmlns:atom='http://www.w3.org/2005/Atom' xmlns:wgs='http://www.w3.org/2003/01/geo/wgs84_pos#' exclude-result-prefixes='atom wgs'>   <xsl:output method='xml' indent='yes'/>    <xsl:key name='uniqueVenuesKey' match='entry' use='id'/>   <xsl:key name='uniqueCategoriesKey' match='entry' use='category/@term'/>    <xsl:template match='/'>     <locations>       <!-- Get all unique venues -->       <xsl:for-each select='/*[local-name()='feed']/*[local-name()='entry']'>         <xsl:variable name='CurrentVenueKey' select='*[local-name()='id']' ></xsl:variable>         <xsl:variable name='CurrentVenueName' select='*[local-name()='title']' ></xsl:variable>         <xsl:variable name='CurrentVenueAddress1' select='*[local-name()='content']/*[local-name()='div']/*[local-name()='div']/*[local-name()='p'][@class='adr']/*[local-name()='span'][@class='street-address']' ></xsl:variable>         <xsl:variable name='CurrentVenueCity' select='*[local-name()='content']/*[local-name()='div']/*[local-name()='div']/*[local-name()='p'][@class='adr']/*[local-name()='span'][@class='locality']' ></xsl:variable>         <xsl:variable name='CurrentVenuePostcode' select='*[local-name()='postcode']' ></xsl:variable>         <xsl:variable name='CurrentVenueTelephone' select='*[local-name()='telephone']' ></xsl:variable>         <xsl:variable name='CurrentVenueLat' select='*[local-name()='Point']/*[local-name()='lat']' ></xsl:variable>         <xsl:variable name='CurrentVenueLong' select='*[local-name()='Point']/*[local-name()='long']' ></xsl:variable>         <xsl:variable name='CurrentCategory' select='WHATDOIPUTHERE'></xsl:variable>              <location>               <locationName>                 <xsl:value-of select = '$CurrentVenueName' />               </locationName>               <category>                 <xsl:value-of select = '$CurrentCategory' />               </category>               <description>                   <xsl:value-of select = '$CurrentVenueName' />               </description>               <venueAddress>                 <streetName>                   <xsl:value-of select = '$CurrentVenueAddress1' />                 </streetName>                 <town>                   <xsl:value-of select = '$CurrentVenueCity' />                 </town>                 <postcode>                   <xsl:value-of select = '$CurrentVenuePostcode' />                 </postcode>                 <wgs84_latitude>                   <xsl:value-of select = '$CurrentVenueLat' />                 </wgs84_latitude>                 <wgs84_longitude>                   <xsl:value-of select = '$CurrentVenueLong' />                 </wgs84_longitude>               </venueAddress>               <venuePhone>                 <phonenumber>                   <xsl:value-of select = '$CurrentVenueTelephone' />                 </phonenumber>               </venuePhone>           </location>         </xsl:for-each>     </locations>   </xsl:template> </xsl:stylesheet> 

I’m trying to replace the $CurrentCategory variable the appropriate code to display mycategorytext

  • 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. 2026-05-10T15:13:58+00:00Added an answer on May 10, 2026 at 3:13 pm

    I don’t have an XSLT editor here, but have you tried using

    *[local-name()='category']/@*[local-name()='term'] 
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

We are evaluating easyXDM for reading 3rd party cookies with http://easyxdm.net/wp/2010/03/17/sending-and-receiving-messages/ (i.e. following socket
I am currently receiving this error: Validation of viewstate MAC failed. If this application
A 3rd party site sends its notifications after my web application has completed some
This 3rd party script keeps causing heap memory exceptions: byte[] forwardMessage(byte[] content) { s
I'm interfacing with a native 3rd party C++ DLL via C# and the provided
I started using git to track my customizations to a 3rd party web app.
I have situation where a 3rd party open source product I am using is
Receiving alot of these messages when compiling which is making compiling a simple program
Im receiving an XML RSS feed. One of the tags look like this: <georss:point>55.0794503724671
I'm trying to consume data from a 3rd party web service. Unfortunately, the web

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.