ASP Error: 70
Description: Permission denied
Source: Microsoft VBScript runtime error

[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

RE: Accessing a node dynamically using XSL

Subject: RE: Accessing a node dynamically using XSL
From: Florent Georges <darkman_spam@xxxxxxxx>
Date: Mon, 16 Jan 2006 18:05:51 +0100 (CET)
florent fiction
Sumiit Kumar Mukherjee wrote:

> <Name type="String">harry</Name>
> <Subjects type="String">Literature,Fiction</Subjects>
> <Literature type="String">Shakespeare, Woodsworth, Jeffrey
> Archer</Literature>
> <Fiction type="String">Da Vinci Code</Fiction>

> My requirement is like this: First, find out the values in the
> <Subjects> element. For each such value [separated by a comma],
> there will be an element present in the XML

    ~> cat skm.xml
    <root>
      <Name type="String">harry</Name>
      <Subjects type="String">Literature,Fiction</Subjects>
      <Literature type="String">Shakespeare, Woodsworth</Literature>
      <Fiction type="String">Da Vinci Code</Fiction>
    </root>

    ~> cat skm.xsl
    <xsl:transform
        xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
        version="2.0">

      <xsl:output method="text"/>

      <xsl:template match="root">
        <xsl:apply-templates
            select="for $sub in tokenize(Subjects, ', *')
                      return *[local-name()=$sub]"/>
      </xsl:template>

      <xsl:template match="*">
        <xsl:value-of select="local-name()"/>
        <xsl:text>: </xsl:text>
        <xsl:value-of select="."/>
        <xsl:text>&#10;</xsl:text>
      </xsl:template>

    </xsl:transform>

    ~> saxon skm.xml skm.xsl
    Literature: Shakespeare, Woodsworth
    Fiction: Da Vinci Code

  With XSLT 1.0, use a recursive template instead of an XPath 'for'
expression.

--drkm



	

	
		
___________________________________________________________________________ 
Nouveau : tiliphonez moins cher avec Yahoo! Messenger ! Dicouvez les tarifs exceptionnels pour appeler la France et l'international.
Tilichargez sur http://fr.messenger.yahoo.com

Current Thread

PURCHASE STYLUS STUDIO ONLINE TODAY!

Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
Email
First Name
Last Name
Company
Subscribe in XML format
RSS 2.0
Atom 0.3
Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery ™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2013 All Rights Reserved.