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"
xmlns:p="http://schemas.microsoft.com/wsman/2005/06/wmi/root/cimv2/win32_Service">
<p:AcceptPause>true</p:AcceptPause>
<p:AcceptStop>true</p:AcceptStop>
<p:Caption>Windows Management Instrumentation</p:Caption>
<p:StartMode>Auto</p:StartMode>
<p:StartName>LocalSystem</p:StartName>
<p:State>Running</p:State>
<p:Status>OK</p:Status>
<cim:Location xmlns:cim="http://schemas.dmtf.org/wsman/2005/06/base"
xmlns:a="http://schemas.xmlsoap.org/ws/2004/08/addressing"
"http://schemas.xmlsoap.org/ws/2005/06/management">
<a:Addres>http://schemas.xmlsoap.org/ws/2004/08/addressing/role/anonymous</a:Addres>
<a:ReferenceParameters>
<w:ResourceURI>http://schemas.microsoft.com/wsman/2005/06/wmi/root/cimv2/win32_Service</w:ResourceURI>
<w:SelectorSet>
<w:Selector>Winmgmt</w:Selector>
</w:SelectorSet>
</a:ReferenceParameters>
</cim:Location>
</p:win32_Service>
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"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:cim="http://schemas.dmtf.org/wsman/2005/06/base"
xmlns:p="http://schemas.microsoft.com/wsman/2005/06/wmi/root/cimv2/win32_Service">
<xsl:output method="text"/>
<xsl:template match="/">
<xsl:apply-templates select="//p:Status|//p:Caption"/>
</xsl:template>
<xsl:template match="cim:Location"/>
<xsl:template match="p:Status">
<xsl:value-of select="p:Status" />
</xsl:template>
<xsl:template match="p:Caption">
<xsl:value-of select="p:Caption" />
</xsl:template>
</xsl:stylesheet>
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.
Regards