I have an xhtml file that is valid and im running a simple xslt sheey against him only to be able to catch the body element and it dosent work. The xml: <html xmlns="http://www.w3.org/1999/xhtml"> <body> <a name="top"></a> </body> </html> The xslt: <?xml version="1.0" encoding="utf-8"?> <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:msxsl="urn:schemas-microsoft-com:xslt" exclude-result-prefixes="msxsl" > <xsl:output method="xml" indent="yes"/> <xsl:template match="/"> <xsl:apply-templates select="node()"/> </xsl:template> <xsl:template match="body"> here </xsl:template> </xsl:stylesheet>
Haim Nachum
Posts
-
Can anybody tell me whats wrong with this xslt -
Socket is suddenly closedHi. I have a chat site (http://www.pitput.com) that connects user via socket connections. I have in the client side a flash object that opens a connection to a port in my server. In the server i have a service that is listening to that port in an async matter. All is working fine except when i talk to someone after an unknown period of time(about couple of minutes) the server is closing my connection and i get an error in the server : " A connection attempt failed because the connected party did not properly respond after a period of time, or established connection failed because connected host has failed to respond". I dont know how exactly the tcp socket works. does it checking for "live" connection every couple of seconds? how does it decide when to close the connection? Im pretty sure that the close operation is not coming from the client side. Thanks.
-
Async socketsWhere is the timeout for the connection set?
-
Async socketsHi. Im building a web chat application and im using async sockets in the server-side. The client connects to the server socket via flash component. My question is , when does the connection dies? if i close my browser i see that the server is closing the connection. is that because TCP socket sends data every x seconds to check the connection? and if it does , can i rely on it? or should i use UDP socket and try to handle the connection state myself. Thank you.
-
Advise about implementing roulette like chatHi, Im implementing a roulette like chat in asp.net and i having some issues about the logic. The basic flow of the application should be : 1. user signed in to the site 2. user requesting someone to chat to 3. the request is sent to the server and the server draws a random user to chat to 4. the two user start communicating, The problem i seem to have is that when a user request is reaching the server and the server tries to draw a new user to chat to (lets say from a DB) , how i synchronize that user with the drawn one, because its a multi-thread environment the user that i drew may also did the same function and tried to drew a user to. So i will face a problem that the first user assigned to himself the other user and the other user may assigned to himself other user as well. Is this a common problem? and if so what is the common solutions? thank you.
-
Saving a word document(2000 to 2010) to xmlIm sorry , i thought that if i posted the question on a c# forum and would be clear that i meant it programatically. I will seek articals about it. Thanks
-
Saving a word document(2000 to 2010) to xmlHi. How can i save a word document to xml format for parsing later with xslt. I noticed that word 2007-2010 document are constructed with the openxml format so i can use openxml tools to save it. But word 2000-2003 seems to be in binary format. Is there a tool that i can use for this mission? Thanks
-
Saving a word document(2000 to 2010) to xmlHi. How can i save a word document to xml format for parsing later with xslt. I noticed that word 2007-2010 document are constructed with the openxml format so i can use openxml tools to save it. But word 2000-2003 seems to be in binary format. Is there a tool that i can use for this mission? Thanks
-
Ajax app with tabsHi. I'm creating a web app with ajax. I added tab control(from jquery ui) that enables to add tabs dynamically. So if the user wants for example to add a new customer he will open a new tab with the "add customer form". Now, if i open a couple of this tabs i have a problem with conflicting id's because each tab that opens receives from the server a chunk of ready html that contains a form with controls that some of them have a id's. My question is , what are the main techniques to add lots of html to a single aspx page that avoids confilicting id's and etc. Thanks.
-
Problem with http handlersHi. Im building a web application in win xp using iis5 and visual studio 2008. i've created a custom handler(with no extension) in the following manner : 1. created a class that implements IHttpHandler. 2. registerd it in web.config in the httphandlers section like follows :
<\add verb="*" path="/GetData" type="WebSiteLogic.GetDataHandler"/>.
Now, when i run the app using Visual Studio server and works fine. But when i deploy it to use with my local iis server or choose in VS to use my iis local server it wont recognize the handler. Can somebody point me out what im missing? Thanks. -
Getting zero elements with xmldocument.selectnodesHi. I have an xml document that im loading to the xmldocument class. After loading i can see in the innerXML property the xml text. Using the FirstChild propery gets me the "html" node. But when im trying to get nodes , any nodes including the "html" node using the "selectNodes" or "selectSingleNode" using XPath, i always get zero nodes; Example doc.SelectSingleNode("//html") . dosent return any node. the xml code looks like that :
<html xmlns="http://www.w3.org/1999/xhtml"><head><meta http-equiv="Content-Type" content="text/html; charset=utf-8" /><meta name="verify-v1" content="k1br6sikEUd0k3G96/qOGGoQOfCbjtZUn+oT10GDsHc=" /><meta name="keywords" content="lyric, lyrics, song, music, song lyrics, music lyrics" /><meta name="description" content="Lyrics.com is a music community with the largest searchable lyrics database." /><meta name="robots" content="all" /><meta name="server" content="10.1.10.2" /><title>Lyrics.com - your music community with the largest searchable lyrics database.</title><script type="text/javascript" src="http://www.lyrics.com/js/prototype.js"></script><script type="text/javascript" src="http://www.lyrics.com/js/overlay.js"></script><script type="text/javascript" src="http://www.lyrics.com/js/common.js"></script><script type="text/javascript" src="http://www.lyrics.com/js/lyrics.js"></script><script type="text/javascript" src="http://www.lyrics.com/js/users.js"></script><script type="text/javascript" src="http://www.lyrics.com/js/scriptaculous.js"></script><link href="/stylesheets/main.v2.css" rel="stylesheet" type="text/css" /><!--[if IE 7]><link href="/stylesheets/ie7.css" type="text/css" rel="stylesheet" /><![endif]--><!--[if lt IE 7.]><script defer type="text/javascript" src="/js/pngfix.js"></script><![endif]--><!--[if IE 6]><link href="/stylesheets/ie6.css" type="text/css" rel="stylesheet" /><script src="/js/ie6.js" type="text/javascript"></script><script src="/js/pngfix.js" type="text/javascript"></script><![endif]--><!-- --><script type="text/javascript" src="http://partner.googleadservices.com/gampad/google_service.js"></script> . . . .
Any ideas why? Thanks -
parsing javascript in realtimeHi. I want to implement the following scenario : i have a crawler exe that crawls a site given a url , the url is in an xml file that the crawler reads. now, i want to be able to have an xml file that have a javascript function that gets the current page that was downloaded in a string from the crawler , and in that function i want to manipulate the page string and return a string to the crawler. is it possible?
-
Recursive problemarr{ 1 , 3, 2 , 0 , 0 , 3} the index 2 in the array have a value that is equal to the sequence of 3 elements(2 , 0 , 0) thus the returning value is 3.
-
Recursive problemthe function(searcharr) should take an element and check if there is a sequence of summed elements that is equal to the index of that element. example arr{ 1 , 3, 2 , 0 , 0 , 3} arr[2] = 3. because 2(i=2) + 0(i=3) + 0(i=4) gives us the value 3 that is the length of the sequence that when summed gives us the value of the index(2).
-
Recursive problemHi. Suppose i have a function that takes an array and its length. That function should search the entire array for each element and return a result. example:
int rec(int arr[], int length) { if(length == 0) return 0; //search array for element length - 1; searchingarr(arr,length -1); rec(arr[],length - 1); }
Now . i cant use loops(while or for), no static variables. only one function inside the rec and use only recursive. i cant put a sign in the array that points to the end either. the problem here is that i want that each time im calling "searchingarr" i paste him the length of the array. here, the length is substracted by 1 each time i call rec. -
Adding progressbar in listview/gridHi. I have a listview that im using its view property as grid. i want to have a grid with rows where each row has a textbox and a progressbar. Ive created a class that have two members: a string member ans a progressbar member. I've created a collection object and added new instances of my class and then assigned the listview ItemsSource property to that collection. but when displaying the listview in runtime i see instead of the progressbar the following text : "system.windows.controls.progressbar minimum:0 maximum:10000 value:0". I guess its because the itemTemplate of the listitem is text, but i dont know how to implement it. here is the code :
private void Window_Loaded(object sender, RoutedEventArgs e) { System.Windows.Controls.ProgressBar p = new System.Windows.Controls.ProgressBar(); p.Maximum = 10000; p.Width = 100; ObservableCollection<somesome> o = new ObservableCollection<somesome>(); o.Add(new somesome { text ="text" , pro = p }); listView1.ItemsSource = o; } public class somesome { public string text { get; set; } public System.Windows.Controls.ProgressBar pro { get; set; } }
Thanks for advance. -
Cant see columns in listview on designerOk. It seems that an update to sp1 was required. Thanks.
-
Cant see columns in listview on designerHi. I have the following code in a WPF Application :
<Window x:Class="WpfApplication1.Window1" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" Title="Window1" Height="300" Width="300"> <Grid> <ListView Name="listView1" Margin="11.5,7,10.5,19.5"> <ListView.View> <GridView > <GridViewColumn Header="1"/> <GridViewColumn Header="2"/> </GridView> </ListView.View> </ListView> </Grid> </Window>
But in designer i see the listview empty and i dont see the 2 columns. I only see them on runtime. -
Creating an image control in a seperated threadHi. I have a wpf app that have a stack panel that i would like to populate with images that i'm downloading from a website. to avoid getting the UI from freezing while downloading the images i created another thread and in that thread downloaded the images and tried to create the image controls. but i'm getting this exception: "The calling thread must be STA, because many UI components require this." Here is the thread code:
new Thread(delegate() { string searchUrl = siteAlgorithm.BuildSearchExpression(searchKeyWords); searcherObj.Clear(); searcherObj.LoadNewPage(siteAlgorithm.ExtractSearchResults(myWebClient.DownloadSiteToString(searchUrl))); MemoryStream stream; Image img = new Image(); // ---> Exception Thrown System.Windows.Media.Imaging.BitmapImage bitImg; foreach (SearchResult item in searcherObj.FirstPage.resultItems) { stream = new MemoryStream(myWebClient.DownloadData(item.imageUrl)); bitImg = new System.Windows.Media.Imaging.BitmapImage(); bitImg.BeginInit(); bitImg.StreamSource = stream; bitImg.EndInit(); img.Source = bitImg; Gui.AddSearchResultItem(img, item.info, item.uri); } } ).Start();
-
Scrolling texbox with limited lines bufferHi. Is there a simple way to make a textbox with a limited lines count say 500. and when the 501 line is written to the textbox the first line is overwritten by the second one and so on so there will always be 500 lines with rotation(like the command line window for example). Thanks!