R
Rolf Barbakken
I have an xml with records like this one:
<a:response>
<a:href>http://server/public/sol/comp/1049306.eml</a:href>
<aropstat>
<a:status>HTTP/1.1 200 OK</a:status>
<arop>
<d:customerid>1049306</d:customerid>
<erofessioncode b:dt="mv.string">
<c:v>byggtapetserarbeider</c:v>
<c:v>malerarbeider</c:v>
</erofessioncode>
</arop>
</aropstat>
</a:response>
I want to display this tab-separated and have this xsl:
<?xml version="1.0"?>
<xsl:stylesheet version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xslutput method="text"/>
<xsl:template
xmlns:a="DAV:"
xmlns:d="urn:schemas:contacts:"
xmlns:e="cln-ewa:custom:"
xmlns:f="cln-ewa:standard:"
match="/">
<xsl:for-each select="a:multistatus/a:response">
<xsl:value-of select="aropstat/arop/d:customerid"/>
<xsl:text> </xsl:text>
<xsl:for-each select="aropstat/arop/frofessioncode/c:v">
<xsl:value-of select="concat(., ',')" />
</xsl:for-each>
<xsl:text>
</xsl:text>
</xsl:for-each>
</xsl:template>
</xsl:stylesheet>
I have no problem getting the customerid, but without a "for-each" the
professioncode always comes out as a single string with no separation like
this:
byggtapetserarbeidermalerarbeider,
With the "for-each" I get this error:
msxml4.dll: Reference to undeclared namespace prefix: 'c'.
Where am I going wrong?
<a:response>
<a:href>http://server/public/sol/comp/1049306.eml</a:href>
<aropstat>
<a:status>HTTP/1.1 200 OK</a:status>
<arop>
<d:customerid>1049306</d:customerid>
<erofessioncode b:dt="mv.string">
<c:v>byggtapetserarbeider</c:v>
<c:v>malerarbeider</c:v>
</erofessioncode>
</arop>
</aropstat>
</a:response>
I want to display this tab-separated and have this xsl:
<?xml version="1.0"?>
<xsl:stylesheet version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xslutput method="text"/>
<xsl:template
xmlns:a="DAV:"
xmlns:d="urn:schemas:contacts:"
xmlns:e="cln-ewa:custom:"
xmlns:f="cln-ewa:standard:"
match="/">
<xsl:for-each select="a:multistatus/a:response">
<xsl:value-of select="aropstat/arop/d:customerid"/>
<xsl:text> </xsl:text>
<xsl:for-each select="aropstat/arop/frofessioncode/c:v">
<xsl:value-of select="concat(., ',')" />
</xsl:for-each>
<xsl:text>
</xsl:text>
</xsl:for-each>
</xsl:template>
</xsl:stylesheet>
I have no problem getting the customerid, but without a "for-each" the
professioncode always comes out as a single string with no separation like
this:
byggtapetserarbeidermalerarbeider,
With the "for-each" I get this error:
msxml4.dll: Reference to undeclared namespace prefix: 'c'.
Where am I going wrong?