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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 16, 20262026-06-16T03:50:44+00:00 2026-06-16T03:50:44+00:00

I’m having difficulty conceptualizing how to go about converting an image’s relative path to

  • 0

I’m having difficulty conceptualizing how to go about converting an image’s relative path to an absolute path via xslt.

There currently exists an XML document that has a section <myHTML> which holds html encoded text. This html document may contain <img> tags with relative paths – For example: <img src="myPic.jpg>

There also exists a xsl that processes that section with a block like this:

<div id="bodyText">
  <xsl:value-of select="/abc:myT/abc:myHTML" disable-output-escaping="yes">
</div>

I need to prepend an absolute path to the beginning of the image name. Since the whole html block is being accessed via value-of select, I’m not sure how to attack this.

I do believe that I need to use an xsl input parameter in order to pass in the path, but not sure how to access the <img> tag inside <myHTML>.

And advice would be appreciated.

Update

There were some questions as to the format of the XML file and what I meant by “html encoded text”. Please disregard typos, the below chunk is from memory and is representative of the actual xml file. It is meant to illustrate the HtmlEncode() data in the <myHTML> block.

<?xml version="1.0" encoding="UTF-8">
<?xml-stylesheet ...snipped..>
<myT xmlns="abc">
   <myHTML>
      &lt;html$gt;&lt;head$gt;&lt;title$gt;This is my title&lt;/title$gt;&lt;/head$gt;
      &lt;body$gt;
      &lt;img src="myPic.jpg" /$gt;
      &lt;/body$gt;&lt;/html$gt;
   </myHTML>
</myT>

Additionally, as Dimitre pointed out, i’m using .NET and it’s XSLT 1.0 processor.

  • 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-16T03:50:45+00:00Added an answer on June 16, 2026 at 3:50 am

    Unless there is a good reason forcing you to use XLST for this, I’d suggest that it’s the wrong tool for the job. Load the XML document into a DOM and XPath to get a node-set containing the relevant myHtml elements. Unescape the HTML and load it into an HTML parser (or if it’s XHTML, an XML parser).. again XPath to get the img element, and read/write the href attributes.

    In any case – it might help if you could update the question with more details of your problem. Are there constraints forcing you to use XSLT? (In which case, is the HTML escaped in a way that you could reliably regex against?) Is performance an issue? What sort of application is it? Etc. Etc.

    • 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 want use html5's new tag to play a wav file (currently only supported
I'm parsing an RSS feed that has an &#8217; in it. SimpleXML turns this
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 know there's a lot of other questions out there that deal with this
I don't have much knowledge about the IPv6 protocol, so sorry if the question
I'm trying to convert HTML to plain text. I get many &\#8217; &\#8220; etc.
I'm having trouble keeping the paragraph square between the quote marks. In firefox the
Let's say I'm outputting a post title and in our database, it's Hello Y&#8217;all

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.