tags:

views:

57

answers:

3

Hey

I have been searching high and low for a way to paginate an XML file and i am beginning to think it might not be possible.. could anyone shed some light on this, is it possible, i can paginate database results no issue but can't find a way to do it...

Seen some examples but they used an ID field that was in the XML file, and as i can't edit the file myself, just gotta work with what i've got...

Hope someone can help...

+2  A: 

XML has no concept of pages, because it's not a UI technology.

You certainly can. You'd have to parse the XML into a DOM object, pick a page size, then iterate through the DOM in page-sized chunks.

You don't say which language you're using or whether you want server or client side. But it's certainly possible.

duffymo
PHP would be the language of choice and server side would be best i think..
David
A: 

XML is a way of defining the data - The viewing of the data is a separate operation so pagination is defined in the tool you use to view the XML and not in the XML model.

Mark
A: 

You did not mention how you render your XML in the first place, but you might want to take a look at e.g. XSL-FO, which supports paging.

Taneli Waltari