XML, XSL

This is a discussion on "XML, XSL" within the Other Programming Languages section. This forum, and the thread "XML, XSL are both part of the Program Your Website category.



Go Back   Webforumz.com > Main Forums > Program Your Website > Other Programming Languages

Notices


Reply
 
LinkBack Thread Tools
  #1 (permalink)  
Old Apr 8th, 2004, 11:30
benbacardi's Avatar
Highly Reputable Member
Join Date: Feb 2004
Location: United Kingdom
Age: 20
Posts: 611
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via MSN to benbacardi Send a message via Skype™ to benbacardi
XML, XSL

[topic moved into new category]
I know this isnt HTML or XHTML but i didnt know where to put it.... I dont suppose anyone knows anything about XML and XSL? I have a the url of a picture stored in the XML and i am trying to get it to display the picture when i use XSL to output it, but i dont know how to and cant get it work... any one know anything?
Reply With Quote

  #2 (permalink)  
Old Apr 8th, 2004, 13:49
Up'n'Coming Member
Join Date: Feb 2004
Location: Woodbridge, UK
Age: 27
Posts: 80
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via ICQ to Trebz Send a message via MSN to Trebz
The W3Schools Website has some excellent stuff on XML/XSLT

http://www.w3schools.com/default.asp
Reply With Quote
  #3 (permalink)  
Old Apr 8th, 2004, 14:07
benbacardi's Avatar
Highly Reputable Member
Join Date: Feb 2004
Location: United Kingdom
Age: 20
Posts: 611
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via MSN to benbacardi Send a message via Skype™ to benbacardi
yes thats where i learnt in the first place thanks but i doesnt tell what i want to do...
Reply With Quote
  #4 (permalink)  
Old Apr 8th, 2004, 14:19
benbacardi's Avatar
Highly Reputable Member
Join Date: Feb 2004
Location: United Kingdom
Age: 20
Posts: 611
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via MSN to benbacardi Send a message via Skype™ to benbacardi
shall i elaborate a bit more on what i cant do?

I have this code in XML:
Code: Select all
<product>
<name>Product Name</name>
<desc>Short Description</desc>
<para>Long Paragraph One</para>
<para>Long Paragraph Two</para>
<url>picture1.gif</url>
</product>
and, using XSL, i would like to know how to use the value of the <url> tags as the src="" value of an <IMG> tag in the HTML within the XSL file... does that make sense?
Reply With Quote
  #5 (permalink)  
Old Apr 8th, 2004, 14:39
Up'n'Coming Member
Join Date: Feb 2004
Location: Woodbridge, UK
Age: 27
Posts: 80
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via ICQ to Trebz Send a message via MSN to Trebz
Maybe u need to look at using XPAth to extract the url and put it in an image tag? I don't know jack about XSL btw :-)

I'll have a look and see if I can find out how for ya.
Reply With Quote
  #6 (permalink)  
Old Apr 8th, 2004, 14:40
benbacardi's Avatar
Highly Reputable Member
Join Date: Feb 2004
Location: United Kingdom
Age: 20
Posts: 611
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via MSN to benbacardi Send a message via Skype™ to benbacardi
thanks what is XPAth? never heard of that...
Reply With Quote
  #7 (permalink)  
Old Apr 8th, 2004, 15:02
Up'n'Coming Member
Join Date: Feb 2004
Location: Woodbridge, UK
Age: 27
Posts: 80
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via ICQ to Trebz Send a message via MSN to Trebz
http://www.w3schools.com/xpath/xpath_intro.asp
Reply With Quote
  #8 (permalink)  
Old Apr 8th, 2004, 15:07
Up'n'Coming Member
Join Date: Feb 2004
Location: Woodbridge, UK
Age: 27
Posts: 80
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via ICQ to Trebz Send a message via MSN to Trebz
Code: Select all
<script type="text/vbscript">

set xmlDoc=CreateObject("Microsoft.XMLDOM")
xmlDoc.async="false"
xmlDoc.load("yourfileorxml.xml")

path="/product/url/text()"
set nodes=xmlDoc.selectNodes(path)

for each x in nodes
  document.write("[img][/img]")
next

</script>
Play with that and see how you get on.
Reply With Quote
  #9 (permalink)  
Old Apr 8th, 2004, 15:09
benbacardi's Avatar
Highly Reputable Member
Join Date: Feb 2004
Location: United Kingdom
Age: 20
Posts: 611
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via MSN to benbacardi Send a message via Skype™ to benbacardi
ok thank you
Reply With Quote
  #10 (permalink)  
Old Apr 8th, 2004, 15:15
benbacardi's Avatar
Highly Reputable Member
Join Date: Feb 2004
Location: United Kingdom
Age: 20
Posts: 611
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via MSN to benbacardi Send a message via Skype™ to benbacardi
could you do that in javascript? thanks
Reply With Quote
  #11 (permalink)  
Old Apr 8th, 2004, 15:51
Up'n'Coming Member
Join Date: Feb 2004
Location: Woodbridge, UK
Age: 27
Posts: 80
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via ICQ to Trebz Send a message via MSN to Trebz
Hmm, I got a lot of work to do before 5, so I might leave that for one of these other clever people!!

If it's not answered by the time I get on the computer tonight at home, i'll do it then.
Reply With Quote
  #12 (permalink)  
Old Apr 8th, 2004, 16:52
benbacardi's Avatar
Highly Reputable Member
Join Date: Feb 2004
Location: United Kingdom
Age: 20
Posts: 611
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via MSN to benbacardi Send a message via Skype™ to benbacardi
ok thanks
Reply With Quote
  #13 (permalink)  
Old Apr 9th, 2004, 16:35
benbacardi's Avatar
Highly Reputable Member
Join Date: Feb 2004
Location: United Kingdom
Age: 20
Posts: 611
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via MSN to benbacardi Send a message via Skype™ to benbacardi
ok i've tried what you put in VBScript, trebz, but it says theres an error with the page ( it loads alrite but i get the error sign on the bottom left and no pictures ) and the error details say "Expected: )" do u know how to solve this?
Reply With Quote
  #14 (permalink)  
Old Apr 9th, 2004, 21:04
Up'n'Coming Member
Join Date: Feb 2004
Location: Woodbridge, UK
Age: 27
Posts: 80
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via ICQ to Trebz Send a message via MSN to Trebz
That means you've missed a ")" somewhere, i'm sure the code I pasted is okay since I tested it.

Look through what you have, and for every "(" there should be a ")" somwehere on the same line.

If you can't fix it then email the page to me. (treborbobuk@hotmail.com)
Reply With Quote
  #15 (permalink)  
Old Apr 10th, 2004, 11:49
benbacardi's Avatar
Highly Reputable Member
Join Date: Feb 2004
Location: United Kingdom
Age: 20
Posts: 611
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via MSN to benbacardi Send a message via Skype™ to benbacardi
ok it still doesnt work but this time it just says that there is a syntax error
Reply With Quote
  #16 (permalink)  
Old Apr 12th, 2004, 08:12
benbacardi's Avatar
Highly Reputable Member
Join Date: Feb 2004
Location: United Kingdom
Age: 20
Posts: 611
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via MSN to benbacardi Send a message via Skype™ to benbacardi
can anybody help me on this?
Reply With Quote
  #17 (permalink)  
Old Apr 12th, 2004, 08:22
Rob's Avatar
Rob Rob is offline
Head Admin & CEO

SuperMember
Join Date: Jul 2003
Location: at my desk
Age: 34
Posts: 2,952
Blog Entries: 7
Thanks: 7
Thanked 4 Times in 4 Posts
Send a message via MSN to Rob Send a message via Skype™ to Rob
I have tested this also:-
Code: Select all
<script type="text/vbscript">

set xmlDoc=CreateObject("Microsoft.XMLDOM")
xmlDoc.async="false"
xmlDoc.load("rxml.xml")

path="/product/url/text()"
set nodes=xmlDoc.selectNodes(path)

for each x in nodes
  document.write("[img][/img]")
next

</script>
and it works.

Make sure you have you XML declaration tag at the top of your XML doc:-
Code: Select all
<?xml version="1.0"?>
__________________
Rob - SEO Specialist
Owner & Founder of Webforumz.com

I am currently unavailable for private work
Reply With Quote
  #18 (permalink)  
Old Apr 12th, 2004, 08:30
benbacardi's Avatar
Highly Reputable Member
Join Date: Feb 2004
Location: United Kingdom
Age: 20
Posts: 611
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via MSN to benbacardi Send a message via Skype™ to benbacardi
that doesnt work... the page says:

Required white space was missing. Error processing resource 'file:///C:/Data Ben/John/Assignment/order.xsl'. Line 35, Position 30

document.write("[img][/img]")
-----------------------------^
Reply With Quote
  #19 (permalink)  
Old Apr 12th, 2004, 08:34
benbacardi's Avatar
Highly Reputable Member
Join Date: Feb 2004
Location: United Kingdom
Age: 20
Posts: 611
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via MSN to benbacardi Send a message via Skype™ to benbacardi
sorry

Code: Select all
Required white space was missing. Error processing resource 'file:///C:/Data Ben/John/Assignment/order.xsl'. Line 35, Position 30 

  document.write("[img][/img]")
-----------------------------^
Reply With Quote
  #20 (permalink)  
Old Apr 14th, 2004, 09:44
benbacardi's Avatar
Highly Reputable Member
Join Date: Feb 2004
Location: United Kingdom
Age: 20
Posts: 611
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via MSN to benbacardi Send a message via Skype™ to benbacardi
ok i really am still stuck on this one and need quite a bit of help..... ?
Reply With Quote
Reply

Tags
xml, xsl

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 On


All times are GMT. The time now is 02:56.


Powered by vBulletin®
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.2.0 RC8
© 2003-2008 Webforumz.com : All Rights Reserved

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43