Win a copy of The Java Performance Companion this week in the Performance forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Navigation of XML records

 
Mamta Katamneni
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 5040
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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 ]
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic