Jump to content

Donar

Members
  • Posts

    23
  • Joined

  • Last visited

Donar's Achievements

Newbie

Newbie (1/7)

0

Reputation

  1. Good day, My XSLT transforms XLM pages into HTML pages. Now I am stuck with a problem, that seems not trivial to me. I would appreciate a pointer into the right direction. I want to reduce the number of lines I have to write in my original XML files. What I want, is something like a XSLT preprocessor, translating some XML tags into a group of other XML tags, before XSLT processes them. If at all possible, I want to keep the replaced as well as the replacing lines in the same XML document (so, no include-file-style solutions). Example: Oftentimes, my XML files contain repetitive multiple lines, e.g. the following simplified snippet: <img> <url>a_midi.jpg</url></img><img> <url>b_midi.jpg</url></img><img> <url>c_midi.jpg</url></img> It would be great, if I could include these multiple lines into a macro tag, placed somewhere near the beginning of the XML file, like this: <macro id="name_a"> <img> <url>a_midi.jpg</url> </img> <img> <url>b_midi.jpg</url> </img> <img> <url>c_midi.jpg</url> </img></macro> Instead of repeating the initial lines over and over again at various places, I'd just use something like: <use_macro id="name_a"/> Now, I certainly can instruct the XSLT to process the template <macro> matching the name "name_a", when it encounters the <use_macro> tag. However, this is not what I want. The reason is, that above <img> tags are themselves contained in another surrounding tag, say <multi_img>. The XSLT processing this <multi_img> tag considers a lot of other tags contained in itself, which dictate how exactly the XML is transformed into HTML (and sometimes the <img> tags even need to be processed multiple times in different manners.) Hence, what I am looking for, is a way to (1) first transform the XML <use_macro> into the XML contained in the <macro> tag; (2) and then process the resulting XML with XSLT as if there was no <use_macro> tag at all in the first place. Possibly the solution is obvious and I am just overworked, but I can't find what I need (even not after spending some time with Jeni Tennison's "XSLT and XPath / On the edge"). I appreciate pointers (also to the appropriate chapter in Tennison's book), or just the statement "it can not be done". Thanks in advance. Regards,Donar
  2. Donar

    Upgrading from PWS

    Appreciated. Bookmarked and DLed. However, atm they are mostly 0 and rarely 1 connections: it would require like several visitors accessing my pages within the same 100 ms in order to substanially increase that number. (Compared with the kept-alive HTTP, with the same number of visitors, or even less for that matrer, half of them received the overload page.)As soon as I see the connections approach 5, I will give it a try. (Should it not work I won't blame you, hehe, after all, I still have the original disks to reinstall )Thanks, and regardsPS: The files are not liked by my AntiVir.
  3. Donar

    Upgrading from PWS

    Thanks for your answers.I might upgrade to win 2000 server then, if I can get ahold of a not too expensive copy.However, I noticed the following: My scripts execute fast (some ADO involved, but still far below 1 sec), and there is no need to maintain a session between the scripts. That is, the connections may terminate instantly after the end of a script.However, I notice, that the PWS does not let go of the connections (at least the number of connections won't change for a fairly long time). Since this is what prevents others from accessing my scripts, I would be fine if I could get rid of the connection. Session.Abandon does /not/ do the trick: PWS won't let them go. I was thinking that the ServerVariable HTTP_KEEP_ALIVE was the culprit (?), but if so, how would I change that default of 300 seconds to something far below that?Or if it is not the cause for that behaviour, what else should I change?Thanks very much, folks (you're my hope, I come from googling for like 3 hours now )Regards//HerbertEdit:Well, I found it:IIS, rightclick on webserver, WWW, Edit, uncheck HTTP KeepaliveRestart IIS (with it PWS goes down and up again)Et voilĂ : Number of connections almost always remains on 0 zero now.Though I'd report it so that others in this situation can make use of it. Saves me another year or so from upgrading :)//Herbert
  4. Donar

    Upgrading from PWS

    Yes, still running Personal Web Server :)Now that I have my first experiences with my web server, I'd like to know what the best option would be for me to upgrade to a "real" web-server with some more advanced functions. Main reason being that at times I have 10 simultaneous visitors now, and all those see is the ugly "Page can not be displayed" page.I run Win 2000 Pro, and of course ASP Scripts must be supported :)What is your advice?Regards//Herbert
  5. I found a quite trivial solution. It works for IE and Firefox, not sure about other browsers.In the client, I first declare an IFrame displaying an empty page. Immediately after that, a JS is executed, basically like this: <iframe id="hsacities" name="hsacities" src="blank.html"></iframe><script type="text/javascript" src="display.js"></script> The JS simply reads: document.getElementById("hsacities").src = 'MyASPScript.asp?'+window.location; Then, on the server side, I can extract the origin with: fromsite = Request.ServerVariables("QUERY_STRING") Now it's an easy task to assign a userid as per variable fromsite and query only the according records.Of course, this is not foolproof: I am aware that ynyone could copy the JS "file" and modify it to submit an approved page. However, besides that he increases the legit user's data no harm is done: and especially is he not able to use the script for own purposes. Maybe I find a way around this as well one day :)Thanks to all for your suggestions, helped me on the way to find a solution (sometimes it's the half way to have someone to share the problem with). If someone is interested in how the script looks like (or even wants to tell me about the appearance in other browsers) I'd be glad to give you the URL :)Regards//HerbertPS: No way to make above Codeboxes smaller?
  6. Hello Jesh,yes, I have tried to loop over all server variables. All I get is the user's IP, ther server's (my own) IP/Name, the ASP file's name and its physical location (on harddisk), but not a single clue about the page in which the IFrame is contained: the IFrames' src (the ASP file) acts as if it was the destination page directly typed in by the surfer.
  7. Sigh. I try to avoid that overhead just to get the page's URL incorporating my IFrame.There really is no other way to obtain that URL which is present everywhere, just with standard JS and ASP? No way to pass a parameter to the src attribute of IFrame?I try to explain some more as for the purpose:My ASP Script is a working utility showing where the last page vistors came from. It runs stable and all, but in a IFrame. Understandably I want avoid that anyone can copy the IFrame code and use it on his own pages, thus interacting severely with the original user's data, being of no benefit for both. Therefore, I wanted to couple functionality with the originating webpage: the ASP script is to check the calling webpage and accordingly updates the correct data.Well, thanks anyway for suggesting your solution, aspnetguy.Herbert
  8. Thank you, but...how can my ASP script read the JS variable parentDocument using ASP commands?Regards//Herbert
  9. Probably I don't see the tree anymore because of too much forest :)Anyway:A website (not mine) includes an IFrame with the src attribute pointing to an ASP script on my Web server.Let's say the external page is www.someclient.com/somepage.htmlIt contains in its body:<iframe src=MyScript.asp etc.></frame>How can the ASP script tell, on which page that IFrame is located?Thanks in advance!Best regards//Herbert
×
×
  • Create New...