Click to See Complete Forum and Search --> : XML > XSL Help


mdikanic
06-17-2008, 01:26 PM
Hi, this is my first post here, and of course it is asking for help. :(
I am taking a class "Introduction to XML" and I have a couple of pracitice tasks for my exam, and I am stuck on this one. Can someone plesae solve it, and try to explain...
I still did not get my head around XSLT and XPath, so I am here trying to get some help.

So the task:

Using the extended/expanded? XML file cdkatalog (or some other .xml file as long as it has a couple of entrys inside), create an XSL file which will display the information from the xml file as follows: first page should display a logo followed by an assigned number of lines; second and all subsequent pages should display a logo and an assigned number of lines. The number of lines on the first page and other pages is defined via an input form, eg:
Number of lines on page 1:
Number of lines on other pages:

So, sorry for my english, I am from Croatia, and i translated it as best I coudl!

mdikanic
06-17-2008, 02:32 PM
To give U a little help, this is what it does:

http://img113.imageshack.us/img113/2870/11yo4.jpg
http://img383.imageshack.us/img383/3164/22dn0.jpg

And here is the cdkatalog.xml file in attach.

mparker1113
06-17-2008, 03:00 PM
have you started any on the xslt file? Did your teacher ever have you write any simple xsl?

mdikanic
06-17-2008, 03:17 PM
Well, this is my first task with xslt, so I am reading w3schools, and my notes from class and trying to make smthg! :)

This problem has a few ingredients:

1) a <form> with two inputs:
<label>Number of lines on page 1:</label> <input value="2"/>
<label>Number of lines on other pages:</label> <input value="4"/>

2) an XML file

3) an XSLT file which produces output that resembles this:

LOGO (showing 2 items)
-item
-item

LOGO (showing 4 items)
-item
-item
-item
-item

LOGO (showing 4 items)
-item
-item
-item
-item

LOGO (showing 4 items)
-item
-item
-item
-item

So for me it is hard to put all those things in one! :)

mparker1113
06-17-2008, 03:24 PM
The xslt will read in the xml and use that for display if you use a <xsl:value-of select = "path to xml"> to name one approach.

I suggest that you start with w3schools and get a beginning tutorial working for writing xml data in a xsl form. If you have specific syntax questions it is easier to help than to just write out all of this --- as i think you will best benefit from beginning work first...




Well, this is my first task with xslt, so I am reading w3schools, and my notes from class and trying to make smthg! :)

This problem has a few ingredients:

1) a <form> with two inputs:
<label>Number of lines on page 1:</label> <input value="2"/>
<label>Number of lines on other pages:</label> <input value="4"/>

2) an XML file

3) an XSLT file which produces output that resembles this:

LOGO (showing 2 items)
-item
-item

LOGO (showing 4 items)
-item
-item
-item
-item

LOGO (showing 4 items)
-item
-item
-item
-item

LOGO (showing 4 items)
-item
-item
-item
-item

So for me it is hard to put all those things in one! :)

mdikanic
06-17-2008, 03:51 PM
The xslt will read in the xml and use that for display if you use a <xsl:value-of select = "path to xml"> to name one approach.

I suggest that you start with w3schools and get a beginning tutorial working for writing xml data in a xsl form. If you have specific syntax questions it is easier to help than to just write out all of this --- as i think you will best benefit from beginning work first...

Ah ok :(
Was hoping that someone would write and explain lines of code, but looks like i will have to try harder :)

TNX