Skip to content
View in the app

A better way to browse. Learn more.

Web Designer Forum

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

XML Help

Featured Replies

Hello,

I've just started learning xml however I'm slightly confused on something. With XML is it possible to have an xml document which holds some data then on a section of a xhtml web page the data from the xml document is displayed and styled?

 

All the tutorials I'm finding seem to suggest that you only display the information in the xml document via the xml document and not through the external xhtml web page?

 

Cheers.

Hi there,

 

XML is mainly a data transfer language, meaning that it is used to send data in an easy to parse and understand way. You can use languages like XSLT (XLST?) to transform the document, and ultra-modern browsers can use CSS styling on non-standard elements, so you potentially style an XML document.

 

For me, I use XML as the method to return data in an AJAX request, so, for example in my latest project I request the backend file with this query:

GET backend.php?request=fileInfo&file=readme.txt&dir=./

The backend file returns XML something like this:

<root>
<fileInfo>
	<name>readme.txt</name>
	<size>326 bytes</size>
	<type>text</type>
</fileInfo>
</root>

 

The Javascript (jQuery as usual) then parses this like any other XML based tech (like XHTML) and inserts it into the correct place in the page.

 

Many API's (such as the Google APIs) return data in a similiar way, although they tend to be standardised to a sub-set like JSON and SOAP (google them, boring but useful) as it is easily parsed by PHP and Javascript.

 

by the way, take a look in the PHP Tutorials here, there is a nice function for Array to XML.

Create an account or sign in to comment

Account

Navigation

Search

Search

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.