Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > XML > Insert one value in my XSLT code

Reply
Thread Tools

Insert one value in my XSLT code

 
 
shapper
Guest
Posts: n/a
 
      10-27-2006
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"
xmlnssl="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">
<xslutput 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

 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Insert one value in my XSLT code shapper XML 1 10-27-2006 09:46 PM
Insert one value in my XSLT code shapper XML 0 10-27-2006 07:40 PM
How To Insert Code With Javascript, How to insert into a div an amountof code Sergio del Amo Javascript 4 05-29-2005 02:45 AM
XSLT: insert value inside of html-tag Angus Parvis XML 2 08-06-2004 01:57 PM
Using One XSLT and multiple XML Problem (One is XML and another one is XBRL) loveNUNO XML 2 11-20-2003 06:47 AM



Advertisments