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

  • Home
  • SEARCH
  • 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 8182911
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 7, 20262026-06-07T01:00:02+00:00 2026-06-07T01:00:02+00:00

Within Symphony CMS, I want to be able to have an XML document which

  • 0

Within Symphony CMS, I want to be able to have an XML document which contains page content (probably using DocBook) and another XML document which is a central acronym/abbreviation repository. This repository, for example could look like this:

<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet type="text/xsl" href="../utilities/master.xsl"?>
<terminology>
    <abbreviations>
        <term abbr="World Wildlife Fund">WWF</term>
    </abbreviations>
</terminology>

An XSL document will then perform transforms with XPath to display the DocBook XML within templates.

For example, within the copy that is output from the DocBook contains the text ‘WWF,’ whenever this occurs, the XSLT and XPath wraps that word with an abbreviation tag with a title using the acronym/abbreviation repository as a resource.

<abbr title="World Wildlife Fund">WWF</abbr>

The whole setup needs to be extendable enough to have a whole bunch of terms in the repository that can be called upon whenever a certain string of text is seen within the DocBook content.

I have been pointed in the direction of the HTML Ninja Technique which sounds as though it will provide me with what I need, but the example is pulling in HTML (which seems a bit odd) and does not go into detail about how to perform the kind of manipulation on strings of text I am looking to produce.

It is worth noting, I have been attempting to do this within a master.xsl template in Symphony Utilities. I am happy to be corrected if this won’t work within this file.

I am very new to XSLT and XPath, so please don’t assume anything of my knowledge when answering this. I am even struggling to wire up the XML and XLS documents at this time. Step-by-step instructions to allow me to produce a proof of concept will be appreciated.

  • 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-07T01:00:04+00:00Added an answer on June 7, 2026 at 1:00 am

    Assuming that I have 3 set of files at same location.

    1. Page Document (XML).

      <?xml version="1.0"?>
      <?xml-stylesheet type="text/xsl" href="transform.xsl"?>
      <html>
          <span>WWF1</span>
          <span>WWF</span>
          <span>WWF2</span>
      </html>
      
    2. Acronym Repository (XML)

      <?xml version="1.0"?>
      <terminology>
        <abbreviations>
          <term abbr="World Wildlife Fund 1">WWF1</term>
          <term abbr="World Wildlife Fund 2">WWF2</term>
        </abbreviations>
      </terminology>
      
    3. Transformer (XSL).

      <?xml version="1.0"?>
      <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
      <xsl:output indent="yes" method="xml"/>
         <xsl:template match="/">
            <xsl:apply-templates select="html" mode="transform">
               <xsl:with-param name="repository" select="document('repository.xml')/terminology"/>
            </xsl:apply-templates>
         </xsl:template>
      
        <!-- Updated Template Start-->
        <xsl:template match="text()" mode="transform" priority="2.5">
           <xsl:param name="repository" />
           <xsl:variable name="this" select="." />
           <xsl:variable name="term" select="$repository/abbreviations/term[contains($this,./text())]" />
           <xsl:choose>
              <xsl:when test="count($term) > 0">
             <xsl:value-of select="substring-before(., $term/text())"/>
                 <xsl:variable name="termTitle" select="$term/@abbr" />
                 <abbr title="{$termTitle}"><xsl:value-of select="$term/text()"/></abbr>
         <xsl:value-of select="substring-after($this, $term/text())"/>
              </xsl:when>
              <xsl:otherwise>
                 <xsl:copy-of select="."/>
              </xsl:otherwise> 
           </xsl:choose>
         </xsl:template>
         <!-- Updated Template Stop-->
      
         <xsl:template match="node()" mode="transform" priority="2">
            <xsl:param name="repository" />
            <xsl:copy>
               <xsl:apply-templates mode="transform">
                  <xsl:with-param name="repository" select="$repository"/>
               </xsl:apply-templates>
            </xsl:copy>
          </xsl:template>
      </xsl:stylesheet>
      

    The transformer file would give an output like the following.

    <html>
      <span><abbr title="World Wildlife Fund 1">WWF1</abbr></span>
      <span>WWF</span>
      <span><abbr title="World Wildlife Fund 2">WWF2</abbr></span>
    </html>
    

    You can scale the acronym by simply adding another node.

    The XSLT need not be changed.

    I hope this helps you.

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

Sidebar

Related Questions

Within my service I have an mbean which is accessed by my war file.
Within a Cocoa application I have a webview. When Google's personalized home page loads
Within a Mac OS X (10.7 Lion) Non-Document Based application, I want to include
Within my scenario, I have a button within an iframe section of my page
Within a Visual Basic Project I have added a resource file (resx) that contains
Within a child, I have an XML element with the following structure: <position> <startOffset>*NUMBER*</startOffset>
Within a valid XML file, I have the following section: <PropertyGroup> <WorkingDir>C:\SomeFolder\</WorkingDir> </PropertyGroup> <ItemGroup>
Within an asp.net MVC app, I'm trying to find rooms which have a guest/client,
Within my code I have list items like this; <div id=content> <ul class=kwicks> <li
Within an ASPX page, I would like to have the popup shown within the

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.