Solved

What is the next step with XSL?

Posted on 2004-03-26
5
167 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
Comment Utility
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
Comment Utility
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
Comment Utility
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

Threat Intelligence Starter Resources

Integrating threat intelligence can be challenging, and not all companies are ready. These resources can help you build awareness and prepare for defense.

Join & Write a Comment

When you work with shopping cart / ecommerce relates web sites, you need to pass the certain form post details to the payment gateway process page with required details for the products items you give to order. Also you may need to track the ordered…
This article covers the basics of the Sass, which is a CSS extension language. You will learn about variables, mixins, and nesting.
Viewers will learn one way to get user input in Java. Introduce the Scanner object: Declare the variable that stores the user input: An example prompting the user for input: Methods you need to invoke in order to properly get  user input:
The viewer will learn how to look for a specific file type in a local or remote server directory using PHP.

743 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

Need Help in Real-Time?

Connect with top rated Experts

13 Experts available now in Live!

Get 1:1 Help Now