Jump to content

Markup Language


hackalive

Recommended Posts

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

Link to comment
Share on other sites

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, ..)

Link to comment
Share on other sites

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).

Link to comment
Share on other sites

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

Link to comment
Share on other sites

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

Link to comment
Share on other sites

<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>

Link to comment
Share on other sites

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

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.