Login | Register   
Twitter
RSS Feed
Download our iPhone app
TODAY'S HEADLINES  |   ARTICLE ARCHIVE  |   FORUMS  |   TIP BANK
Browse DevX
Sign up for e-mail newsletters from DevX


Tip of the Day
Home » Tip Bank » XML » XSLT
Language: XSLT
Expertise: Beginner
Jul 10, 2000

Filtering On Node Name

Question:

I have an XML document for news items. It has a tag which has 3 child nodes , and , of which there can be multiples with the one tag. For example:


  
  
  
  
  
  

    

    

    

What I want to be able to do is branch to a given template, depending on the name of the node in the order that they displayed, within the tag. I have tried using and , but where I keep getting stuck is in testing for the name of the current node. I could, of course, use a generic tag called, and let it have an attribute called "type" Then I could evaluate the branching the attribute, but, in a way, this defeats the purpose of using XML. What would you suggest?

Answer:

Just use the call and wildcard characters:


















DevX Pro
 
Comment and Contribute

 

 

 

 

 


(Maximum characters: 1200). You have 1200 characters left.

 

 

Sitemap