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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 5, 20262026-06-05T22:56:11+00:00 2026-06-05T22:56:11+00:00

I’m having trouble obtaining data with a macro I’ve created using XSLT. I have

  • 0

I’m having trouble obtaining data with a macro I’ve created using XSLT. I have several EventData nodes which I would like to access from a page in another Content folder.

I’ve tried many different queries (too many to post) but my latest one is below. I had this working when the Event Data was below the standard page but I have since moved them to their own folder and haven’t managed to successfully update the XSLT.

XML:

<root id="-1">
  <HomeTemplate id="1055" parentID="-1" level="1">
    <ContentFolder id="1097" parentID="1055" level="2">
      <EventData id="1095" parentID="1097" level="3">
       <eventDate>2012-06-20T00:00:00</eventDate>
       <eventName>Event Name Data</eventName>
       <eventLocation>Event Location Data</eventLocation>
      </EventData>
    .......
    </ContentFolder>
    <ContentFolder id="1059" parentID="1055" level="2">
      <StandardTemplate id="1061" parentID="1059" level="3">
        <pageHeading>Results</pageHeading>
        .......
      </StandardTemplate>
    </ContentFolder>
  ......
  </HomeTemplate>
</root>

XSLT:

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE xsl:stylesheet [ <!ENTITY nbsp "&#x00A0;"> ]>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:output method="xml" omit-xml-declaration="yes"/>
<xsl:param name="currentPage"/>
<xsl:template match="/">
  <table>
    <xsl:for-each select="EventData">
      <tr>
        <td>Event Date: <xsl:value-of select="umbraco.library:FormatDateTime(./eventDate, 'd')"/></td>
        <td>Event Name: <xsl:value-of select="./eventName"/></td>
        <td>Event Location: <xsl:value-of select="./eventLocation"/></td>
      </tr>
    </xsl:for-each>
  </table>
</xsl:template>
</xsl:stylesheet>

EDIT:

<xsl:for-each select="umbraco.library:GetXmlNodeById(1097)/EventData">

The above works but I ideally want something that would select by type so isn’t hard coded.

  • 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-05T22:56:12+00:00Added an answer on June 5, 2026 at 10:56 pm

    Old Schema

    <xsl:for-each select="$currentPage/ancestor-or-self::node[@nodeTypeAlias='HomeTemplate']//node[@nodeTypeAlias='EventData']">
    </xsl:for-each>
    

    New Schema

    <xsl:for-each select="$currentPage/ancestor-or-self::HomeTemplate//EventData[@isDoc]">
    </xsl:for-each>
    

    Please note this example walks upto the top level node/document type with the alias of HomeTemplate as I presume the most top level node you are using has only one instance.

    Also note this is a fairly expensive xPath call as it walks up the tree to find the top level node until we get to the Home node. Then it looks through all the child nodes no matter how deep to find the node (document type) with the alias of EventData.

    Source: http://our.umbraco.org/wiki/reference/xslt/45-xml-schema/xslt-examples-updated-to-new-schema

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

Sidebar

Related Questions

link Im having trouble converting the html entites into html characters, (&# 8217;) i
I have a string like this: La Torre Eiffel paragonata all&#8217;Everest What PHP function
I would like to run a str_replace or preg_replace which looks for certain words
We're building an app, our first using Rails 3, and we're having to build
We are using XSLT to translate a RIXML file to XML. Our RIXML contains
I have a text area in my form which accepts all possible characters from
I'm having trouble keeping the paragraph square between the quote marks. In firefox the
I have thousands of HTML files to process using Groovy/Java and I need to
I have some data like this: 1 2 3 4 5 9 2 6
That's pretty much it. I'm using Nokogiri to scrape a web page what has

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.