Insert one value in my XSLT code

S

shapper

Hello,

I am transforming a XML file into another XML file using a XSLT.

Everything is working fine! I have only one problem:

I want one of the values in my XSLT file to be taken from a Key in my
Web.Config AppSettings!

Please see the XSLT code:

Hi,

I was reading some Merge Methods in the web but I am having some
problems making this work.

Look at my XSLT code:

<?xml version="1.0" encoding="utf-8"?>
<xsl:stylesheet
version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns="http://www.google.com/schemas/sitemap/0.84"
xmlns:dk="http://schemas.microsoft.com/AspNet/SiteMap-File-1.0">
<xsl:eek:utput method="xml" version="1.0" encoding="UTF-8"
indent="yes"/>
<xsl:template match="dk:*"/>
<xsl:template match="@*|text()|comment()"/>
<xsl:template match="/">
<xsl:element name="urlset">
<xsl:apply-templates select="//dk:siteMapNode[@google='true']"/>
</xsl:element>
</xsl:template>
<xsl:template match="dk:siteMapNode">
<xsl:element name="url">
<xsl:element name="loc">
<xsl:text>http://www.MYDOMAIN.com/</xsl:text>
<xsl:value-of select="substring(@url, 3)"/>
</xsl:element>
<xsl:element name="lastmod">
<xsl:value-of select="@lastmod"/>
</xsl:element>
<xsl:element name="changefreq">
<xsl:value-of select="@changefreq"/>
</xsl:element>
<xsl:element name="priority">
<xsl:value-of select="@priority"/>
</xsl:element>
</xsl:element>
</xsl:template>
</xsl:stylesheet>

Do you see the line?

<xsl:text>http://www.MYDOMAIN.com/</xsl:text>

I want "http://www.MYDOMAIN.com/" to be taken from a Key in Application
Settings in my Web.Config or at run time before the XML file is
displayed.

Thanks,

Miguel
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,755
Messages
2,569,534
Members
45,008
Latest member
Rahul737

Latest Threads

Top