![]() |
![]() | ![]() | ![]() | Altova Mailing List Archives>Archive Index >microsoft.public.xml Archive Home >Recent entries >Thread Prev - Re: Sending Data between Frames (XML/XSL) >Thread Next - Re: Sending Data between Frames (XML/XSL) Re: Sending Data between Frames (XML/XSL)To: NULL Date: 2/2/2007 8:16:00 AM On Feb 2, 11:02 am, "Joe Fawcett" <joefawc...@newsgroup.nospam> wrote: > You can use location.search, which gives something like "?cd=1" which you > can then parse for the actual id. > > -- > > Joe Fawcett (MVP - XML)http://joe.fawcett.name > > "ignignokt" <davis...@gmail.com> wrote in message > > news:1170425765.272405.95330@s...... > > > > > On Feb 2, 7:48 am, "Joe Fawcett" <joefawc...@newsgroup.nospam> wrote: > >> You cannot do what you want using only linked stylesheets. The menu can > >> be > >> like this but the details page needs to a regular HTML page that reads > >> the > >> querystring and then uses script to set a parameter in the XSLT based on > >> the > >> CD chosen. > >> So your links are like CdDetailsPage.html?cd=1. Your HTML reads the cd > >> id, > >> sets a parameter in the XSLT to 1 and then transforms. > >> See the msxml sdk for how to use setParameter. > > >> -- > > >> Joe Fawcett (MVP - XML)http://joe.fawcett.name > > >> "ignignokt" <davis...@gmail.com> wrote in message > > >>news:1170347623.159027.196680@h...... > > >> >I would like some help on the best way of acheiving the following: I > >> > am trying to create a html document with 2 frames that call a > >> > seperate > >> > XML file for each frame. I would like the top frame to have > >> > hyperlinks > >> > and when you click on the specific hyperlink, it will display the > >> > information in the main frame. > > >> > Example: I have many different CDs. The links on the top frame are > >> > "CD > >> > 1", "CD 2", "CD 3", etc. When you click on "CD 1" all the information > >> > for CD 1 is listed in the main frame. > > >> > My question is how do you sort the information when you click on the > >> > hyperlink in one XML to the data in the other XML file. > > >> > Here is my main XML file: > >> > <?xml version="1.0" encoding="UTF-8"?> > >> > <?xml-stylesheet type="text/xsl" href="vid.xsl"?> > >> > <catalog> > >> > <disc> > >> > <file> > >> > <label>AVI 1</label> > >> > <name>lagulap2.mpg</name><size>6.11 MB</size> > >> > <created>1/25/2007 9:10:39 AM</created> > >> > <image01>c:\videocatalog\images\AVI 1\lagulap201.jpg</image01> > >> > <image02>c:\videocatalog\images\AVI 1\lagulap202.jpg</image02> > >> > <image03>c:\videocatalog\images\AVI 1\lagulap203.jpg</image03> > >> > <image04>c:\videocatalog\images\AVI 1\lagulap204.jpg</image04> > >> > <image05>c:\videocatalog\images\AVI 1\lagulap205.jpg</image05> > >> > <image06>c:\videocatalog\images\AVI 1\lagulap206.jpg</image06> > >> > </file> > >> > <file> > >> > <label>AVI 1</label> > >> > <name>ronyoung.avi</name> > >> > <size>5.45 MB</size> > >> > <created>1/25/2007 9:15:40 AM</created> > >> > <image01>c:\videocatalog\images\AVI 1\ronyoung01.jpg</image01> > >> > <image02>c:\videocatalog\images\AVI 1\ronyoung02.jpg</image02> > >> > <image03>c:\videocatalog\images\AVI 1\ronyoung03.jpg</image03> > >> > <image04>c:\videocatalog\images\AVI 1\ronyoung04.jpg</image04> > >> > <image05>c:\videocatalog\images\AVI 1\ronyoung05.jpg</image05> > >> > <image06>c:\videocatalog\images\AVI 1\ronyoung06.jpg</image06> > >> > </file> > >> > <file> > >> > </disc> > >> > <disc> > >> > <label>AVI 2</label> > >> > <name>sc-comm.mpeg</name> > >> > <size>4.56 MB</size> > >> > <created>1/25/2007 9:12:39 AM</created> > >> > <image01>c:\videocatalog\images\AVI 1\sc-comm01.jpg</image01> > >> > <image02>c:\videocatalog\images\AVI 1\sc-comm02.jpg</image02> > >> > <image03>c:\videocatalog\images\AVI 1\sc-comm03.jpg</image03> > >> > <image04>c:\videocatalog\images\AVI 1\sc-comm04.jpg</image04> > >> > <image05>c:\videocatalog\images\AVI 1\sc-comm05.jpg</image05> > >> > <image06>c:\videocatalog\images\AVI 1\sc-comm06.jpg</image06> > >> > </file> > >> > </disc> > >> > </catalog>- Hide quoted text - > > >> - Show quoted text - > > > Thanks for your help. One question, how do I get the HTML to read the > > querystring?- Hide quoted text - > > - Show quoted text - Thanks for your advice. I actually used some javascript in the html file to find the ID. Im going to look into set the parameter in the XSL file. Thanks alot. HTML file: <html> <body> <script type="text/javascript"> function Request(key) { var strQueryString=QueryString(); strQueryString=strQueryString.replace(/\%20/g," "); if (strQueryString.length < 1) return ""; arrTmp=strQueryString.split("&"); for (var i=0; i<arrTmp.length; i++) { var arrTmp2=arrTmp[i].split("="); if (arrTmp2.length < 1) continue; var curKey=arrTmp2[0]; var curValue=(arrTmp2.length < 2)?"":arrTmp2[1]; if (curKey.toLowerCase() == key.toLowerCase()) return curValue; } return ""; } function QueryString() { var strFullUrl=document.location+""; var arrTmp=strFullUrl.split("?"); if (arrTmp.length < 2) return ""; return arrTmp[1]; } alert(Request("disc")); </script> </body> </html> | ![]() | ![]() | ![]() |
| Company | Legal | Press | Partners | Careers | Sitemap | Contact Us | Altova Blog | |||||
|
