470,848 Members | 1,450 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 470,848 developers. It's quick & easy.

XSLT for an xml with namespace


can anyone help me out with this, im a newbie to xml n stuff. i really
have tough time working on this .

Xml file:

<p:win32_Service xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
<p:Caption>Windows Management Instrumentation</p:Caption>
<cim:Location xmlns:cim="http://schemas.dmtf.org/wsman/2005/06/base"
From the above Xml i want to retieve only the Status,Caption and

StartName elements.

So i wrote an xsl code, which goes something like this

<?xml version="1.0" ?>
<xsl:stylesheet version="1.0"


<xsl:output method="text"/>

<xsl:template match="/">
<xsl:apply-templates select="//p:Status|//p:Caption"/>

<xsl:template match="cim:Location"/>
<xsl:template match="p:Status">
<xsl:value-of select="p:Status" />
<xsl:template match="p:Caption">
<xsl:value-of select="p:Caption" />
When i run these two files in vbscript code, i cannot see any output??
i am trying to figure it out since a long time.

I appreciate if anyone can help me with this.

Apr 6 '06 #1
1 1219

sh*******@gmail.com wrote:

<xsl:template match="p:Status">
<xsl:value-of select="p:Status" />
Make that
<xsl:value-of select="." />
<xsl:template match="p:Caption">
<xsl:value-of select="p:Caption" />

Same here
<xsl:value-of select="." />


Martin Honnen --- MVP XML
Apr 9 '06 #2

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

6 posts views Thread by Mikko Nummelin | last post: by
1 post views Thread by Wil | last post: by
1 post views Thread by Sonu Kapoor | last post: by
4 posts views Thread by David S. Alexander | last post: by
1 post views Thread by Nick | last post: by
6 posts views Thread by kluge.wolfram | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.