[Last Call] Learn how to a build a cloud-first strategyRegister Now

x
?
Solved

What is the next step with XSL?

Posted on 2004-03-26
5
Medium Priority
?
176 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
3 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 2000 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

Hire Technology Freelancers with Gigs

Work with freelancers specializing in everything from database administration to programming, who have proven themselves as experts in their field. Hire the best, collaborate easily, pay securely, and get projects done right.

Question has a verified solution.

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

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 …
Introduction Since I wrote the original article about Handling Date and Time in PHP and MySQL several years ago, it seemed like now was a good time to update it for object-oriented PHP.  This article does that, replacing as much as possible the pr…
The viewer will learn how to dynamically set the form action using jQuery.
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).
Suggested Courses

830 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