hackalive Posted June 4, 2010 Share Posted June 4, 2010 Okay so in my site I have loads of <ha:login /> (that tage should be replaced auto by the login box) and other stuff which I want to replece with my own XML (so to speak), the same as Facebook Markup Langauge, so I have implemented <!DOCTYPE html PUBLIC "XHTML 1.0 Strict" "http://www.w3.org/tr/xhtml1/Dtd/xhtml1-strict.dtd"> <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en" xmlns:ha="http://mysite.com/2010/ml"> which I believ is neseccary in order to parse it, so my question is can any one give me some good info on how to start putting together my own real XML parser, and as I understand FBML does require you to carry out a DOM reparse in order to execute it all, so can someone provide some good info on how to get this all going? Please dont suggest preg_replace as I doubt that is how FB achieved it Many thanks in advance Quote Link to comment Share on other sites More sharing options...
ignace Posted June 4, 2010 Share Posted June 4, 2010 You need to use XSLT to replace the tag <ha:login/> with your login-form, somewhat like: <xsl:template match="login"> <form action="#" method="POST"> .. </form> </xsl:template> Quote Link to comment Share on other sites More sharing options...
hackalive Posted June 4, 2010 Author Share Posted June 4, 2010 okay so I have a file which has all the <ha:> that I will use listed, okay thats a start, anyone else, thanks ignace Quote Link to comment Share on other sites More sharing options...
hackalive Posted June 4, 2010 Author Share Posted June 4, 2010 okay so FBML (FBconnect) only requires you to call a JS file then add the <fb:> tags wanted and then use DOM reparse, so how do I achive this? Thanks Quote Link to comment Share on other sites More sharing options...
ignace Posted June 4, 2010 Share Posted June 4, 2010 okay so I have a file which has all the <ha:> that I will use listed, okay thats a start, anyone else, thanks ignace If you have Firefox, install Firebug you'll notice that upon loading the JS file it modifies your HTML and adds the libraries so you can use their namespace (fb). Among those you will find they load a XSLT template file to translate <fb:login/> to their famous login screen. You can alter the DOM using native JS or by using a library like jQuery. Seriously though if you want to replicate what they did, it's best you buy yourself a book on everything X(HTML, ML, SLT, ..) Quote Link to comment Share on other sites More sharing options...
hackalive Posted June 4, 2010 Author Share Posted June 4, 2010 I might start with what you said about Firebug, so just pint firebug at the Facebook connect area on any facebook connect enabled page? Quote Link to comment Share on other sites More sharing options...
ignace Posted June 4, 2010 Share Posted June 4, 2010 I might start with what you said about Firebug, so just pint firebug at the Facebook connect area on any facebook connect enabled page? Yup. Quote Link to comment Share on other sites More sharing options...
hackalive Posted June 4, 2010 Author Share Posted June 4, 2010 thanks for the advice ignace but I am in firebug and dont see what you mean Quote Link to comment Share on other sites More sharing options...
ignace Posted June 4, 2010 Share Posted June 4, 2010 thanks for the advice ignace but I am in firebug and dont see what you mean Post the URL Quote Link to comment Share on other sites More sharing options...
hackalive Posted June 4, 2010 Author Share Posted June 4, 2010 http://www.somethingtoputhere.com/therunaround/ Thanks so much ignace, I just want to do this now, I dont want to have to re-engineer in a year or so, rather do it right the first time :-D Quote Link to comment Share on other sites More sharing options...
ignace Posted June 4, 2010 Share Posted June 4, 2010 Look this is your default HTML <head>: <head> <title>The Run Around</title> <link type="text/css" rel="stylesheet" href="style.css" /> <script type="text/javascript" src="base.js"></script> </head> After FB.init() has finished your <head> looks like: <head> <title>The Run Around</title> <link type="text/css" rel="stylesheet" href="style.css" /> <script type="text/javascript" src="base.js"></script> <script type="text/javascript" src="http://static.ak.connect.facebook.com/.."></script> <link rel="stylesheet" href="http://static.ak.connect.facebook.com/.."> </head> This will create all these changes. Click on the + next to them to see their source in Firebug (under the HTML-tab). Quote Link to comment Share on other sites More sharing options...
hackalive Posted June 4, 2010 Author Share Posted June 4, 2010 Okay so I need to make a XSLT template file, then use JS (like they do) to chnage the DOM and use DOM parse becuase of it, yes, am I on the right track? Thanks again ignace Quote Link to comment Share on other sites More sharing options...
ignace Posted June 4, 2010 Share Posted June 4, 2010 Most likely you won't need JS, they use it for convenience towards developers. But yes you would need XSLT. Quote Link to comment Share on other sites More sharing options...
hackalive Posted June 4, 2010 Author Share Posted June 4, 2010 okay so ignace, thanks so much for all your help, XSLT template tutorials that are good, does anyone know of any? and then process 2 how do I get it all to do it (so to speak, the tags replace with the relevant XSLT one, I know using JS and I would to preffer to use JS, so anyone know how i can join it all together?) but at the moment the important thing is the XSLT template, I want to do one simple tag and have the JS replae and also do the crucial DOM reparse to see if it will work.. Again thanks ignace for all your help Quote Link to comment Share on other sites More sharing options...
hackalive Posted June 5, 2010 Author Share Posted June 5, 2010 anyone know how I can implement the XML parser, XML namespace (XSLT template) to make this all work Quote Link to comment Share on other sites More sharing options...
hackalive Posted June 5, 2010 Author Share Posted June 5, 2010 also if anyone knows another forum or site to post my question on please let me know, thanks Quote Link to comment Share on other sites More sharing options...
hackalive Posted June 5, 2010 Author Share Posted June 5, 2010 maybe so people can see where this is headed, here is the first "tag" i want to implement <ha:group gid="66666"></ha:group> so it would be used like this <ha:group gid="66666">Hello, you are part of group 66666<ha:else>you are NOT part of group 66666</ha:else></ha:group> So what I am after is how to make the XMLNS sheet that recognises and converts the tags (how to parse this, or any tags). All suggestions are welcome. I know I need XML namespace (XMLNS) but need to know how to build up the XMLNS sheet etc to achive the above sample tag. Thanks guys in advance Quote Link to comment Share on other sites More sharing options...
hackalive Posted June 11, 2010 Author Share Posted June 11, 2010 anyone (bump) Quote Link to comment Share on other sites More sharing options...
hackalive Posted June 11, 2010 Author Share Posted June 11, 2010 I have read about XSLT and read a few tuts but still am unsure how to solve this issue, I dont knwo if XSLT is the right way about? what do you guys think+ (Please reference Reply #16, [above]) Quote Link to comment Share on other sites More sharing options...
hackalive Posted June 12, 2010 Author Share Posted June 12, 2010 bump Quote Link to comment Share on other sites More sharing options...
ignace Posted June 12, 2010 Share Posted June 12, 2010 <ha:group gid="66666">Hello, you are part of group 66666<ha:else>you are NOT part of group 66666</ha:else></ha:group> <xsl:choose> <xsl:when test="$group = 66666"> <xsl:value-of select="group"/> </xsl:when> <xsl:otherwise> <xsl:value-of select="group/else"/> </xsl:otherwise> </xsl:choose> Quote Link to comment Share on other sites More sharing options...
hackalive Posted June 12, 2010 Author Share Posted June 12, 2010 okay ignace yes thanks very much, but how to implemet the reparsing and this file Quote Link to comment Share on other sites More sharing options...
hackalive Posted June 12, 2010 Author Share Posted June 12, 2010 I am still at a loss (have no idea) how to make this all work (implement) Quote Link to comment Share on other sites More sharing options...
hackalive Posted June 12, 2010 Author Share Posted June 12, 2010 Okay, I know at the momnent I am posting here alot but I would like to get it sorted sooner rather than later. So here is what I understand I need to achieve and my problems (to start us off :-D) Task Problem Create tags such as <ha:login-button> None, they are just tags File (such as XSLT) that stores and decides how to interact with the tags How, I am clueless, what does the file even look like and how does in interact with all the extra settings (eg <ha:login-button length="long">< JavaScript Which 'makes it all work'. Again how, how can I do this, I know how to JS and presume if we resolve the above I could work on this issue Quote Link to comment Share on other sites More sharing options...
Daniel0 Posted June 12, 2010 Share Posted June 12, 2010 You could start with spending your time on research instead of spending it on bumping this topic. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.