aspose file tools*
The moose likes XML and Related Technologies and the fly likes Navigation of XML records Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Engineering » XML and Related Technologies
Bookmark "Navigation of XML records " Watch "Navigation of XML records " New topic
Author

Navigation of XML records

Mamta Katamneni
Greenhorn

Joined: Nov 18, 2004
Posts: 1
Hi
I am trying for providing navigation for records like the way provided int the following examle.

http://www.w3schools.com/xml/tryit.asp?filename=cd_navigate

but my xml file is not in the standard format. It looks like

<FormData>
<Form name="ADDRCHG" description="Address Change Form">
<Element name="FirstName" value="S">
</Element>
<Element name="LastName" value="B">
</Element>
<Element name="NewAddressLine1" value="1234 some street">
</Element>
</Form>
<Form name="ContactUsNPF" description="Contact US Form for NPF">
<Element name="FirstName" value="S">
</Element>
<Element name="LastName" value="B">
</Element>
<Element name="Question" value="Hey, how do I use your site?">
</Element>
</Form>
<Form name="ContactUsBTF" description="Contact US Form for BTF">
<Element name="FirstName" value="S">
</Element>
<Element name="LastName" value="B">
</Element>
</Form>
</FormData>

i used XSL to display the records in HTML format and everything works fine. my XSL looks like

<?xml version="1.0"?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/TR/WD-xsl">
<xsl:template match="/">
<html>
<body>

<h1>Forms Details:</h1>
<table border="0" cellpadding="2">

<xsl:for-each select="FormData/Form">
<tr>
<th>
<xsl:value-of select="@description"/>
</th>
</tr>
<tr>
<xsl:for-each select="Element">
<tr>
<td> <xsl:value-of select="@name" />:
<xsl:value-of select="@value" /> </td>
</tr>
</xsl:for-each>
</tr>

</xsl:for-each>
</table>
</body>
</html>
</xsl:template>
</xsl:stylesheet>

with this one i am able to display the entire data in a single page. But i want to place buttons at the bottom of XSL file and provide navaigation like MovePrevious, MoveNext, with one record in each page. As my XML is not in the standard format i couldn't use the code provided in the example. Could someone please help me.


Thanks in advance.
[ November 18, 2004: Message edited by: Mamta Katamnent ]
Madhav Lakkapragada
Ranch Hand

Joined: Jun 03, 2000
Posts: 5040
Mamta,

Welcome to Javaranch.

Well, I have to say, that one superb example. I am impressed with this example and would love to learn more. That said, I can't find any explanation of what this example does or what technology it uses.

As for my part, I am not good in Javascript and so I don't understand what the xmldso thingy (object?) does. Do you have a link/page where they explain the example.

I have a strange feeling this is something to do with the Microsoft technology (.asp?). Its not just simple XSLT thing.

- m
[ November 19, 2004: Message edited by: Madhav Lakkapragada ]

Take a Minute, Donate an Hour, Change a Life
http://www.ashanet.org/workanhour/2006/?r=Javaranch_ML&a=81
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Navigation of XML records