Welcome any assistance

T

Toney

Definitely welcome any assistance.

Inherited some code with an xml structure I don't think is the best. In the
short term I have to live with what's there.

Everything appears correctly until you mouse over the link and get a
concantenation of all data elements, e.g.
http://www.anydomain.com?key=1234keyimage1234.jsp09/12/2005. The data is
located within the datagram of the parent element which also has child
elements. With the stylesheet how do I separate out the link information
and strip the rest? I'm sure it must be a simple solution and my brain is
just on lock down.

Example xml:

<?xml version="1.0" encoding="UTF-8"?>
<images>
<image>
http://www.anydomain.com?key=1234
<image-filename>keyimage1234.jsp</image-filename>
<image-lastmodified>09/12/2005</image-lastmodified>
</image>
<image>
http://www.anydomain.com?key=3456
<image-filename>keyimage3456.jsp</image-filename>
<image-lastmodified>09/22/2005</image-lastmodified>
</image>
<image>
http://www.anydomain.com?key=7898
<image-filename>keyimage7898.jsp</image-filename>
<image-lastmodified>09/31/2005</image-lastmodified>
</image>
</images>


Example xslt:

<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform">

<xsl:template match="image">
<a href="{.}"><xsl:value-of select="image-filename"/></a> (last modified:
<xsl:value-of select="image-lastmodified" />)<br/><br/>
</xsl:template>

</xsl:stylesheet>


Example results:

keyimage1234.jsp (last modified: 09/12/2005)

keyimage3456.jsp (last modified: 09/22/2005)

keyimage7898.jsp (last modified: 09/31/2005)
 
S

shaun roe

Toney said:
Definitely welcome any assistance.

Inherited some code with an xml structure I don't think is the best. In the
short term I have to live with what's there.

Everything appears correctly until you mouse over the link and get a
concantenation of all data elements, e.g.
http://www.anydomain.com?key=1234keyimage1234.jsp09/12/2005. The data is
located within the datagram of the parent element which also has child
elements. With the stylesheet how do I separate out the link information
and strip the rest? I'm sure it must be a simple solution and my brain is
just on lock down.

Example xml:

<?xml version="1.0" encoding="UTF-8"?>
<images>
<image>
http://www.anydomain.com?key=1234
<image-filename>keyimage1234.jsp</image-filename>
<image-lastmodified>09/12/2005</image-lastmodified>
</image>
<image>
http://www.anydomain.com?key=3456
<image-filename>keyimage3456.jsp</image-filename>
<image-lastmodified>09/22/2005</image-lastmodified>
</image>
<image>
http://www.anydomain.com?key=7898
<image-filename>keyimage7898.jsp</image-filename>
<image-lastmodified>09/31/2005</image-lastmodified>
</image>
</images>


Example xslt:

<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform">

<xsl:template match="image">
<a href="{.}"><xsl:value-of select="image-filename"/></a> (last modified:
<xsl:value-of select="image-lastmodified" />)<br/><br/>
</xsl:template>

</xsl:stylesheet>

Doesnt this do what you want:

<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
version="1.0">
<xsl:template match="image">
<a href="{normalize-space(text())}"><xsl:value-of
select="image-filename"/></a> (last modified:
<xsl:value-of select="image-lastmodified" />)<br/><br/>
</xsl:template>
 

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

Forum statistics

Threads
473,769
Messages
2,569,580
Members
45,055
Latest member
SlimSparkKetoACVReview

Latest Threads

Top