• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Navigation of XML records

 
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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 ]
 
Ranch Hand
Posts: 5040
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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 ]
 
reply
    Bookmark Topic Watch Topic
  • New Topic