The Three Pโs (that being PHP and Python and Perl) are all pretty good at interfacing with the XML protocol and format. And that XML is a very important protocol in todayโs digital age. Over the last few days with our Android mobile applications, for instance, XML files served the purpose of โฆ
- GUI look data source
- project settings
โฆ the diversity of usage apparent here, and it shows throughout the goings on of users interested in โdataโ, especially โdata with intelligenceโ. HTML has โdata intelligenceโ capabilities, but not nearly to the pared down degree XML does. It is all about the storage of data, pure and simple, not in the โgameโ of a look or feel to anything, so much as HTML does.
And this close relationship with โdataโ makes it no surprise, Iโm sure, to you that databases like Oracle or MS-SQL or MySql and others, these days, have syntax especially designed for the import or export usage of XML data in string or file format.
XML is a very hierarchical protocol, which suits the way a lot of data works.
Interested in making some rudimentary XML? Today, we write some XML using PHP and the DOMDocument class, but we have to thank .. (Volume II: Applications) by Harry Fuecks (ISBN: 0957921845) for the idea to try the approach we take today, and they showed code using the โDOMโ, DOMDocumentโs predecessor. To get from โDOMโ thinking to โDOMDocumentโ thinking, reminded us of that CSS โmappingโ to Javascript DOM idea that you substitute the CSS โ-โ (minus) and next lowercase letter for a Javascript DOM capital letter as per โฆ
CSS
#the_el { background-color: yellow; }
Javascript DOM
document.getElementById('the_el').style.backgroundColor='yellow';
โฆ โDOMโ (class) methods often go to โDOMDocumentโ equivalents via โDOMโ โ-โ lowercase letter mapped to โDOMDocumentโ capital letter ones.
Todayโs downloadable PHP creating very rudimentary XML is xml_on_the_flyphp that you can try for yourself at this live
run link.
You might also be interested in Javascript putElement(s)By via PHP Relative URLs Tutorial.
Previous relevant Javascript putElement(s)By via PHP Relative URLs Tutorial is shown below.
Today weโve continued with the the Javascript DOM journey as explained for the last few days with Javascript putElement(s)By via PHP Local File Tutorial as shown below, as to whether we can come up with some useful โmeaningfulโ functionality for โฆ
- putElementById()
- putElementsByClassName()
- putElementsByTagName()
โฆ in Javascript โฆ and, today, weโve improved it with the allowance for relative URLs on such HTML elements as img for example, and have looked at Ajax as an idea, but have put off its use, because we see no performance improvement.
The methods will not work with all URL data input, and this is an ongoing curiosity, which we may one day return to examine further, but sometimes you have to take a break on some projects, so, if you donโt mind โฆ thereโs been that โto make the morning coffee and breakfast before you even think of itโ project weโve been meaning to get back to โฆ as a matter of fact thereโs been a breakthrough on it โฆ and โฆ well โฆ โWould you mind bringing up that dust pan from the laundry?โ โThe robotโs having another mini nervous breakdown and has put its fist though the plate.โ โฆ breakthrough โฆ get it โฆ chortle, chortle.
You may remember, a couple of days ago, the introduction of the PHP DOMDocument class functionality, where this link was very useful. It allows PHP to simulate some of Javascriptโs DOM capabilities, and in our case it is used to parse HTML from within PHP. It also makes it easy to accept XML input data, which is presented with the < and > as shown in the XML โฆ you might want to try an XML URL or data file browsed for.
Today you can see that relative URL (mapped to an absolute URL) functionality as a liverun.
And we worked out the window.open approach doesnโt work everywhere, so we may end up falling back, a bit, on the underlying PHP, sometimes.
Todayโs code changes were helped out enormously by the advice on this link regarding parsing URLs in PHP โฆ thanks.
Todayโs downloadable PHP is putElementsByphp
Progression on the code โฆ putElementsByphp
Previous relevant Javascript putElement(s)By via PHP Local Files Tutorial is shown below.
Today we march on with the the Javascript DOM journey as explained for the last few days with Javascript putElement(s)By via PHP Follow Up Tutorial as shown below, as to whether we can come up with some useful โmeaningfulโ functionality for โฆ
- putElementById()
- putElementsByClassName()
- putElementsByTagName()
โฆ in Javascript โฆ and though, today, weโve improved, it still needs more work, such as catering for relative URLs, Ajax mode, perhaps, and the way it will not work with all URL data input.
You may remember, yesterday, the introduction of the PHP DOMDocument class functionality, where this link was very useful. It allows PHP to simulate some of Javascriptโs DOM capabilities, and in our case it is used to parse HTML from within PHP. It also makes it easy to accept XML input data, as this happens here today.
Here, today, we also add functionality for the use of local hard disk file browsing.
Today you can see that extra local file browsing and XML input functionality as a liverun.
And we worked out the window.open approach doesnโt work everywhere, so we may end up falling back, a bit, on the underlying PHP, sometimes.
Todayโs downloadable PHP is putElementsByphp
Progression on the code โฆ putElementsByphp
Previous relevant Javascript putElement(s)By via PHP Follow Up Tutorial is shown below.
Today we continue the Javascript DOM journey as explained yesterday with Javascript putElement(s)By via PHP Primer Tutorial as shown below, as to whether we can come up with some useful โmeaningfulโ functionality for โฆ
- putElementById()
- putElementsByClassName()
- putElementsByTagName()
โฆ in Javascript โฆ and though, today, weโve improved, it still needs more work, such as catering for relative URLs, Ajax mode, perhaps, and the way it will not work with all URL data input.
Today, to improve the program, we can, at times use the PHP DOMDocument class functionality, and this link was very useful. It allows PHP to simulate some of Javascriptโs DOM capabilities, and in our case it is used to parse HTML from within PHP.
Today we make it more user-friendly with a text input button to accept a user-defined URL to use as the data base (small blank chortle).
And we worked out the window.open approach doesnโt work everywhere, so we may end up falling back, a bit, on the underlying PHP, sometimes.
Todayโs downloadable PHP is putElementsByphp
Progression on the code โฆ putElementsByphp
Previous relevant Javascript putElement(s)By via PHP Primer Tutorial is shown below.
If you are into Javascript DOM you will be into โฆ
โฆ and being into programming, for every get you ever see in a function or method name, you may be accustomed to looking for the set or put reverse functionality function or method.
Gadzooks โฆ there is no โฆ
- putElementById()
- putElementsByClassName()
- putElementsByTagName()
โฆ and no set versions either, in Javascript โฆ but today we imagine a set of Javascript functions (minus the document. bizzo though โฆ a poet who doesnโt know itโฆ chortle, chortle) โฆ how could they work? โฆ well, you could try packing them off with a couple of vegemite sandwiches and an orange off up the road to get the bus โฆ or, well, maybe a transfer of HTML elementโage (elementary โฆ no end to the chortles today!) to the end of our own webpage (optionally from another URL, perhaps โฆ (weโll need PHP) โฆ havenโt dealt with relative URLs yet, though).
So, try it if you like โฆ
Todayโs downloadable PHP is putElementsByphp (whose code would improve with the relative URL issue disappearing โฆ and if this disappears you know we got to that first!)
If this was interesting you may be interested in this too.
If this was interesting you may be interested in this too.
If this was interesting you may be interested in this too.
If this was interesting you may be interested in this too.
If this was interesting you may be interested in this too.