-
Re: Is it possible to apply an XSL file on the childs of one node selected with the SelectSingleNode
Candy:
Use this:
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
version="1.0">
You must upgrade your parser to version 3 or higher to take advantage of the
newer namespace.
HTH
Russell
"candy" <candy@apsc.ubc.ca> wrote in message
news:3bd053e9$2@news.devx.com...
>
> What is the newer xslt namespace?
> thanks, candy
>
>
> "Russell Jones" <arj1@northstate.net> wrote:
> >Perform the first match on the root of the node you're passing. If at all
> >possible, you should upgrade to use the newer XSLT namespace rather than
> the
> >older XSL namespace that you're using now.
> >
> > <?xml version='1.0'?>
> > <xsl:stylesheet xmlns:xsl="http://www.w3.org/TR/WD-xsl">
> > <xsl:template match="/">
> > <table border="0">
> > <tr>
> > <td>
> > <xsl:for-each select="./paragraph">
> > <xsl:value-of select="paragraph"/>
> > </xsl:for-each>
> > </td>
> > </tr>
> > </table>
> > </xsl:template>
> > </xsl:stylesheet>
> >>
> >
> >"Dimitri De Blomme" <dimitri_de_blomme@yahoo.com> wrote in message
> >news:3bcd412b$1@news.devx.com...
> >>
> >> Hi,
> >>
> >> I'm a beginner in XML.
> >> I have an XML file with the following structure
> >> <document>
> >> <section id="1">
> >> <paragraph id="1">
> >> </paragraph>
> >> <paragraph id="2">
> >> </paragraph>
> >> </section>
> >> <section id="2">
> >> <paragraph id="1">
> >> </paragraph>
> >> <paragraph id="2">
> >> </paragraph>
> >> </section>
> >> </document>
> >>
> >> I have the following code in my ASP page (to position on the 1st
section):
> >>
> >> Set objNode = objXML.SelectSingleNode("document/section[@id='1']")
> >>
> >> And I would like to apply an XSL file on the selected node (all the
> >paragraphs
> >> of the selected node)
> >> Response.Write(objNode.transformNode(objXSL))
> >>
> >> I can't find how to do that in my XSL file.
> >> Is it possible to do a <xsl:template match="CURRENT NODE"> ?
> >>
> >> <?xml version='1.0'?>
> >> <xsl:stylesheet xmlns:xsl="http://www.w3.org/TR/WD-xsl">
> >> <xsl:template match="???">
> >> <table border="0">
> >> <tr>
> >> <td>
> >> <xsl:for-each select="./paragraph">
> >> <xsl:value-of select="paragraph"/>
> >> </xsl:for-each>
> >> </td>
> >> </tr>
> >> </table>
> >> </xsl:template>
> >> </xsl:stylesheet>
> >>
> >>
> >> Thank you.
> >> Dimitri.
> >>
> >
> >
>
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
Forum Rules
|
Top DevX Stories
Easy Web Services with SQL Server 2005 HTTP Endpoints
JavaOne 2005: Java Platform Roadmap Focuses on Ease of Development, Sun Focuses on the "Free" in F.O.S.S.
Wed Yourself to UML with the Power of Associations
Microsoft to Add AJAX Capabilities to ASP.NET
IBM's Cloudscape Versus MySQL
|
Bookmarks