tags:

views:

26

answers:

1

Hi

I have the folowing XML

<?xml version="1.0" encoding="ISO-8859-1" ?> 
- <DEVICEMESSAGES>
  <VERSION xml="1" checksum="" revision="0" envision="33050000" device="" /> 
  <HEADER id1="0001" id2="0001" content="Nasher[<messageid>]: <!payload>" /> 
  <MESSAGE level="7" parse="1" parsedefvalue="1" tableid="15" id1="24682" id2="24682" eventcategory="1003010000" content="Access to <webpage> was blocked due to its category (<info> by <hostname>)" /> 
  </DEVICEMESSAGES>

I am using the following xslt

<xsl:stylesheet version="2.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"&gt;
     <xsl:output method="text"/>
     <xsl:strip-space elements="*"/>

     <xsl:template match="DEVICEMESSAGES">
       <xsl:value-of select="@id2"/>,<xsl:text/>
       <xsl:value-of select="@content"/>,<xsl:text/>
       <xsl:text>&#xa;</xsl:text>
     </xsl:template>

</xsl:stylesheet>

when i use MSXML i just get ,, whereas i want to have something like

id2,             content
0001 ,           Nasher[<messageid>]: <!payload>" 
A: 

The DEVICEMESSAGES element doesn't have attributes at all.

Change:

<xsl:template match="DEVICEMESSAGES"> 

to:

<xsl:template match="DEVICEMESSAGES/HEADER"> 
Dimitre Novatchev
Hi DimitreThank you very much
edwards
Any ideas how do i add column headers to the output though ?
edwards
@edwards: Please, ask this in a separate, new question.
Dimitre Novatchev
Apologies Dimitre and thanks for responding again
edwards