Solved

What is the next step with XSL?

Posted on 2004-03-26
5
170 Views
Last Modified: 2010-04-06
Hi,
go to http://www.demo.izi.se/test.asp

what to do next to present this readable in our site? I don´t know what to do with the XSL file end where to put it or is it possible to include a XSL file?


set xmlDoc=CreateObject("Microsoft.XMLDOM")
xmlDoc.async="false"
xmlDoc.load("http://www.demo.izi.se/cat1.xml")

path="//*[@id='100']"
set nodes=xmlDoc.selectNodes(path)

for each x in nodes
  document.write("<xmp>")
  document.write(x.xml)
  document.write("</xmp>")
next
0
Comment
Question by:jenmat
  • 2
5 Comments
 
LVL 1

Expert Comment

by:Cyrrus30
ID: 10690339
Well, once that your XSL file is done, just display your XML object using this syntax:

'You need another XMLDOM (or whatever object you,re using for your XML) object, in wich you load your XSL file. Then:

Response.Write ( objXML.transformNode ( objXSL ) )

I don't know if it's what you're looking for...
0
 

Author Comment

by:jenmat
ID: 10690437
well, i am not really sure how to handle the ID in the XML file to create a proper XSL. Is that something you can provide a start to? The XML contains a lot of data using <categories> and <category> with several IDs. I want to be able to sort out different categories and for example create a menu och select menu. I think i have a start in the above with the "sort out".
0
 
LVL 1

Accepted Solution

by:
Cyrrus30 earned 500 total points
ID: 10691036
Well, I,m not a XSL guru, I only used it for basic display. Your XSL file contains, for the basic, lines like this:

<xsl:template match="category">
        <span class="title1"><xsl:value-of select="."/></span><br/>
 </xsl:template>

In this exemple, it will display all elements named Category (to follow your exemple), put them in a span with a class named title1, and put a carriage-return after.
The line
<xsl:value-of select="."/> means that it will take all elements named "category". You can be selective here (never did it, so I can't go further onthis).

It's quite simple when you want to apply styles, but if you want sometinh more complicated, like a select (dropdown), I can't help you anymore.. :)
0

Featured Post

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
xml attribute DTD attribute differences 3 76
Problem to echo 6 110
React or Angular? 6 81
php mysql check email already in database. (second check) 7 68
There are two main kinds of selectors in CSS: One is base selector like h1, h2, body, table or any existing HTML tags.  For instance, the following rule sets all paragraphs (<p> elements) to red: (CODE) CSS also allows us to define our own custom …
It's sometimes a bit tricky to use date functions in Oracle BPEL. I'll explain quickly how you can add N days to the current date. In a BPEL process this can be useful, and you can adapt it to fit your needs. First of all, let's see how to add 1 …
The viewer will learn how to create and use a small PHP class to apply a watermark to an image. This video shows the viewer the setup for the PHP watermark as well as important coding language. Continue to Part 2 to learn the core code used in creat…
Learn how to create flexible layouts using relative units in CSS.  New relative units added in CSS3 include vw(viewports width), vh(viewports height), vmin(minimum of viewports height and width), and vmax (maximum of viewports height and width).

820 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question