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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 20, 20262026-05-20T00:00:35+00:00 2026-05-20T00:00:35+00:00

i would like to create a data feed that has the basic elements of

  • 0

i would like to create a data feed that has the basic elements of RSS 2.0 and looks like so:

<?xml version="1.0" encoding="UTF-8" ?> 
<rss version="2.0" xmlns:g="http://base.google.com/ns/1.0"> 
<channel> 
<title>Clot3333333tory</title> 
<description>Clot333333333333333holesale pricing and bulk ordering to consumers and businesses.</description> 
<item>  
<title>
<description>
<link>  

i am using an XSLT stylesheet on an XML document to populate this template, a problem a have run into is i want to use a tag called <Caption> in the XML document for the tag <description> in the finished project. This ‘Caption’ field is formatted in html, i would like to pull the Caption data into ‘description’ but just display it as text and drop all the html tags. What would it look like in the stylesheet to do this?

EDIT:
the incoming XML file looks like so(including only one ‘item’ element):

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE StoreExport SYSTEM "http://store.yahoo.com/doc/dtd/StoreExport.dtd">  
<StoreExport>
<Settings>
<Published timestamp="1297187196"/>
<Locale code="C" name="English" encoding="iso-8859-1"/>  
<StoreName>Clo3333333nd.com</StoreName>
<Currency>USD</Currency>  
<ShipMethods>
  <ShipMethod>Ground</ShipMethod>
  <ShipMethod>Two Day Delivery</ShipMethod>
  <ShipMethod>One Day Delivery</ShipMethod>
  <ShipMethod>3 Day</ShipMethod>

</ShipMethods>
<PayMethods>
  <PayMethod>American Express</PayMethod>
  <PayMethod>Discover</PayMethod>
  <PayMethod>MasterCard</PayMethod>
  <PayMethod>Visa</PayMethod>
  <PayMethod>Diner's Club</PayMethod>
</PayMethods>
</Settings>
<Products>
<Product Id="agfasu">
  <Code>3616a</Code>
  <Description>Ageless Fashion Suit</Description>
  <Url>http://www.clo333333nd.com/agfasu.html</Url>
  <Thumb>&lt;img border=0 width=50 height=70 src=http://ep.yimg.33333333333st-27703333333618_2144_317652924&gt;</Thumb>
  <Picture>&lt;img border=0 width=600 height=845 src=http://ep.yimg.com/33333333-2770333333333317019111&gt;</Picture>

  <Orderable>YES</Orderable>
  <Taxable>YES</Taxable>
  <Pricing>
    <BasePrice>178.00</BasePrice>
    <LocalizedBasePrice>178.00</LocalizedBasePrice>
    <OrigPrice>299.99</OrigPrice>

    <LocalizedOrigPrice>299.99</LocalizedOrigPrice>
    <SalePrice>178.00</SalePrice>
    <LocalizedSalePrice>178.00</LocalizedSalePrice>
  </Pricing>
  <Path>
    <ProductRef Id="wochsu" Url="http://www.cl333333333333hsu.html">Womens Church Suits</ProductRef>
    <ProductRef Id="2454" Url="http://www.clo333333333nd.com/2454.html">Aussie Austine Spring/Summer 2011</ProductRef>

  </Path>
  <Availability>Usually ships the next business day.</Availability>
  <Caption>&lt;head&gt; &lt;meta content="en-us" http-equiv="Content-Language"&gt; &lt;style type="text/css"&gt; .style3 {  font-family: arial, helvetica;  font-size: medium;  font-weight: bold; } .style4 {  font-size: small; } &lt;/style&gt; &lt;/head&gt;  &lt;p&gt;&lt;strong&gt;Wholesale Women&amp;#39;s Church Suits&amp;nbsp; - 3 Piece Suit - Jacket/Vest/Long  Skirt&lt;/strong&gt;&lt;/p&gt; &lt;p&gt;&lt;strong&gt;Aussie Austine Spring/Summer 2011&lt;/strong&gt;&lt;/p&gt; &lt;p class="style4"&gt;&lt;strong&gt;Wholesale Clothing Distributors - Church Attire, Gospel Fashion, Mother of Bride Style  at a Wholesale Price. For all your fancy, classic, elegant parties and or  occasions. Our suits come in a variety of styles to accommodate your fashion  taste. Suits for all women, moms, grandma&amp;#39;s, daughters and aunts. That classic  look that will bring attention. From stylish skirts, pants, jackets  and vests. Two piece suits, available hats and purses. Brand Name Wholesale  Ladies Apparel. &lt;/strong&gt;&lt;/p&gt; &lt;p&gt;3&lt;strong&gt; Piece Suit - Jacket/Vest/Long Skirt&lt;/strong&gt;&lt;/p&gt; &lt;p&gt;&lt;strong&gt;Sizes&amp;nbsp; 8 10 12 14 16 18 20&lt;/strong&gt;&lt;/p&gt; &lt;p&gt;&lt;strong&gt;Color&amp;nbsp; Khaki Red&lt;/strong&gt;&lt;/p&gt; &lt;p&gt;Available Accessories: Hat and Purse&amp;nbsp; &lt;/p&gt; &lt;font face="arial, helvetica" size="4"&gt; &lt;p align="left"&gt;Orders of 12 and 24 Items are Mixed Colors and Sizes. For more  information Please call Us @ 323333300&lt;/p&gt; &lt;p align="left"&gt;Please feel free to call if you would like wholesale pricing for  larger orders&amp;nbsp;&lt;/font&gt;&lt;/p&gt; &lt;font face="arial, helvetica" size="2"&gt; &lt;p align="left"&gt;&lt;b&gt;&lt;font size="4"&gt;Please call or E-mail &lt;a href="mailto:Sal333333sland.com"&gt;Sales@cloth333333333and.com&lt;/a&gt; If you  are interested in purchasing larger quantities&lt;/font&gt;&lt;/b&gt;&lt;/p&gt; &lt;/font&gt; &lt;p align="left" class="style3"&gt;&amp;nbsp;&lt;/p&gt; &lt;p align="left"&gt;&amp;nbsp;&lt;/p&gt; &lt;p align="left"&gt;&amp;nbsp;&lt;/p&gt;  &lt;p align="left"&gt;`&lt;/p&gt;</Caption>  

you can see the ‘Caption’ tag i mentioned at the bottom.
i have never used xslt before, so i currently only have a skeleton that i can only get to just basically repeat all the data, even if i use ‘match’ templates, all of the text is included in the final product regardless. i know i am just wording the template incorrectly, but i can find this concept explained anywhere. the wording i am using for match is:

<xsl:template match="Description"
<title>
<apply-template/>
</title>
</xsl:template>  

with the intention of turning the ‘Description’ tag into a ‘title’ field in a final xml rss2.0 document

EDIT:
okay, i am using XSLTPalette and the screen has 3 output modes: ‘raw’,’pretty’,’rendered’ results. when i use the stylesheet i have now to strip elements from the ‘Caption’ nodes, they appear like i want in the ‘raw’ results, it is just the text without all the escaped chars. also appears fine in the rendered result, but my data is still unstructured in the rendered result. it doesnt appear at all in the ‘pretty’ output box, but ‘raw’ is getting closer to what i need, i guess. here is an incomplete stylesheet for an example:

<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
 version="1.0">
    <xsl:template match="//Product/Caption">
    <xsl:param name="text"/>
    <xsl:choose>
        <xsl:when test="contains($text, '&lt;')">
            <xsl:value-of select="substring-before($text, '&lt;')"/>
            <xsl:call-template name="strip-tags">
                    <xsl:with-param name="text" select="substring-after($text, '&gt;')"/>
            </xsl:call-template>
        </xsl:when>
        <xsl:otherwise>
            <xsl:value-of select="$text"/>
        </xsl:otherwise>
    </xsl:choose>
 </xsl:template>
</xsl:stylesheet>  

two things: this effectively strips the correct section of nodes, but how would i also encapsulate the output of this section into a tag called ‘description’ for the final document, and what am i not doing to have only the things i want show up in the product, like to include nothing except what i specify i want.

  • 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-05-20T00:00:36+00:00Added an answer on May 20, 2026 at 12:00 am

    Without seeing exactly what you get as input, I can only suggest that you pass the nodes you want to strip HTML from, through this XSLT template.

    <xsl:template name="strip-tags">
        <xsl:param name="text"/>
        <xsl:choose>
            <xsl:when test="contains($text, '&lt;')">
                <xsl:value-of select="substring-before($text, '&lt;')"/>
                <xsl:call-template name="strip-tags">
                        <xsl:with-param name="text" select="substring-after($text, '&gt;')"/>
                </xsl:call-template>
            </xsl:when>
            <xsl:otherwise>
                <xsl:value-of select="$text"/>
            </xsl:otherwise>
        </xsl:choose>
    </xsl:template>
    

    Just include it in you existing XSLT, applying it to the relevant <Caption> node.

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

Sidebar

Related Questions

I would like create my own collection that has all the attributes of python
I would like to create 10 plots that have different data, but the same
I would like to create data visualizations in desktop apps, using frameworks, languages and
I would like create a web service in ASP.Net 2.0 that will supports JSON.
I would like to create a database backed interactive AJAX webapp which has a
I would like to create a stored procedure in MySQL that took a list
I would like to create events for certain resources that are used across various
What I would like to do (in C++) is create a 'Parameter' data type
For stress tests, I would like to create XML files based on a XSD
I have live audio that I would like to feed into a oracle database.

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.