Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > XML > Welcome any assistance

Reply
Thread Tools

Welcome any assistance

 
 
Toney
Guest
Posts: n/a
 
      09-24-2005
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=1234key....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"
xmlnssl="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)


 
Reply With Quote
 
 
 
 
shaun roe
Guest
Posts: n/a
 
      09-25-2005
In article <aJbZe.28051$hp.22037@lakeread08>,
"Toney" <(E-Mail Removed)> wrote:

> 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=1234key....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"
> xmlnssl="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 xmlnssl="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>
</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)

 
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
Welcome screen not welcome mona@Ve.com Computer Support 4 12-14-2007 03:12 AM
501 PIX "deny any any" "allow any any" Any Anybody? Networking Student Cisco 4 11-16-2006 10:40 PM
code driving me crazy, any assistance? andyjgw@gmail.com ASP .Net 3 07-01-2005 11:33 AM
mailing list welcome welcome msg in wiki suggestion Brian van den Broek Python 0 12-12-2004 09:11 PM
Virus assistance please... Any help would be appreciated Stevhan Hartwell Computer Support 8 10-17-2003 10:56 PM



Advertisments