473,396 Members | 2,013 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

problem with xsl for multivalue strings

I have an xml with records like this one:

<a:response>
<a:href>http://server/public/sol/comp/1049306.eml</a:href>
<a:propstat>
<a:status>HTTP/1.1 200 OK</a:status>
<a:prop>
<d:customerid>1049306</d:customerid>
<e:professioncode b:dt="mv.string">
<c:v>byggtapetserarbeider</c:v>
<c:v>malerarbeider</c:v>
</e:professioncode>
</a:prop>
</a:propstat>
</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">
<xsl:output 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="a:propstat/a:prop/d:customerid"/>
<xsl:text> </xsl:text>
<xsl:for-each select="a:propstat/a:prop/f:professioncode/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?

--
_________________
Rolf @ Questus ans
Jul 28 '05 #1
11 1886
Hi,

Tempore 17:38:45, die Thursday 28 July 2005 AD, hinc in foro {comp.text.xml} scripsit Rolf Barbakken <no******@alexandria.cc>:
With the "for-each" I get this error:
msxml4.dll: Reference to undeclared namespace prefix: 'c'.

Where am I going wrong?

The error message sais it all: you're trying to access an element "c:v" but you didn't declare the namespace that goes with "c". Just add the correct "xmlns:c" attribute to an ancestor-or-self of the "xsl:value-of" element.

regards,
--
Joris Gillis (http://users.telenet.be/root-jg/me.html)
Vincit omnia simplicitas
Keep it simple
Jul 28 '05 #2
"Joris Gillis" <ro**@pandora.be> wrote in message
news:op***************@news.pandora.be...
Hi,

Tempore 17:38:45, die Thursday 28 July 2005 AD, hinc in foro
{comp.text.xml} scripsit Rolf Barbakken <no******@alexandria.cc>:
With the "for-each" I get this error:
msxml4.dll: Reference to undeclared namespace prefix: 'c'.

Where am I going wrong?

The error message sais it all: you're trying to access an element "c:v"
but you didn't declare the namespace that goes with "c". Just add the
correct "xmlns:c" attribute to an ancestor-or-self of the "xsl:value-of"
element.


I thought so too, so I tried

xmlns:c="c:"

and

<xsl:for-each select="a:propstat/a:prop/f:professioncode/c:v">
<xsl:value-of select="concat(., ',')"/>
</xsl:for-each>

Is this right?

With this code I get even less than before (no professioncodes at all), but
no error.

--
_________________
Rolf @ Questus ans
Jul 28 '05 #3
Tempore 20:54:06, die Thursday 28 July 2005 AD, hinc in foro {comp.text.xml} scripsit Rolf Barbakken <no******@alexandria.cc>:
The error message sais it all: you're trying to access an element "c:v"
but you didn't declare the namespace that goes with "c". Just add the
correct "xmlns:c" attribute to an ancestor-or-self of the "xsl:value-of"
element.


I thought so too, so I tried

xmlns:c="c:"


Obviously, the namespace-uri (between the quotes) has to be the same as the one declared in the source XML; it is not dummy data. "c:" is a very unlikely uri...
regards,
--
Joris Gillis (http://users.telenet.be/root-jg/me.html)
Vincit omnia simplicitas
Keep it simple
Jul 28 '05 #4
"Joris Gillis" <ro**@pandora.be> wrote in message
news:op***************@news.pandora.be...
Tempore 20:54:06, die Thursday 28 July 2005 AD, hinc in foro
{comp.text.xml} scripsit Rolf Barbakken <no******@alexandria.cc>:
The error message sais it all: you're trying to access an element "c:v"
but you didn't declare the namespace that goes with "c". Just add the
correct "xmlns:c" attribute to an ancestor-or-self of the "xsl:value-of"
element.


I thought so too, so I tried

xmlns:c="c:"


Obviously, the namespace-uri (between the quotes) has to be the same as
the one declared in the source XML; it is not dummy data. "c:" is a very
unlikely uri...


Well I've tried what looks like the correct namespace-uri:

xmlns:c="cln-ewa:standard:professioncode:"

and then:

<xsl:for-each select="a:propstat/a:prop/c:v">
<xsl:value-of select="concat(., ',')"/>
</xsl:for-each>

But nothing comes out of it (no professioncode). You can see the structure
in my xml in the OP.

--
_________________
Rolf @ Questus ans
Jul 29 '05 #5
Tempore 08:54:27, die Friday 29 July 2005 AD, hinc in foro {comp.text.xml} scripsit Rolf Barbakken <no******@alexandria.cc>:
xmlns:c="cln-ewa:standard:professioncode:"

and then:

<xsl:for-each select="a:propstat/a:prop/c:v">
<xsl:value-of select="concat(., ',')"/>
</xsl:for-each>

But nothing comes out of it (no professioncode).

That's pretty logical: there's no location step for 'professioncode'

INPUT XML:
<a:multistatus
xmlns:a="DAV:"
xmlns:b="unknown"
xmlns:c="cln-ewa:standard:professioncode:"
xmlns:d="urn:schemas:contacts:"
xmlns:e="cln-ewa:custom:"
xmlns:f="cln-ewa:standard:">
<a:response>
<a:href>http://server/public/sol/comp/1049306.eml</a:href>
<a:propstat>
<a:status>HTTP/1.1 200 OK</a:status>
<a:prop>
<d:customerid>1049306</d:customerid>
<e:professioncode b:dt="mv.string">
<c:v>byggtapetserarbeider</c:v>
<c:v>malerarbeider</c:v>
</e:professioncode>
</a:prop>
</a:propstat>
</a:response>
</a:multistatus>

XSLT:
<xsl:stylesheet version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:output method="text"/>
<xsl:template
xmlns:a="DAV:"
xmlns:b="unknown"
xmlns:c="cln-ewa:standard:professioncode:"
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="a:propstat/a:prop/d:customerid"/>
<xsl:text> </xsl:text>
<xsl:for-each select="a:propstat/a:prop/e:professioncode/c:v">
<xsl:value-of select="concat(., ',')" />
</xsl:for-each>
<xsl:text> </xsl:text>
</xsl:for-each>
</xsl:template>

</xsl:stylesheet>

OUTPUT :
1049306 byggtapetserarbeider,malerarbeider,
I only just thought about this: Do you need all data of type 'multivalue strings' to be seperated by comma's? If so, it's better to use a template:

<xsl:stylesheet version="1.0"
xmlns:a="DAV:"
xmlns:b="unknown"
xmlns:c="cln-ewa:standard:professioncode:"
xmlns:d="urn:schemas:contacts:"
xmlns:e="cln-ewa:custom:"
xmlns:f="cln-ewa:standard:"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:output method="text"/>
<xsl:template

match="/">
<xsl:for-each select="a:multistatus/a:response">
<xsl:value-of select="a:propstat/a:prop/d:customerid"/>
<xsl:text> </xsl:text>
<xsl:apply-templates select="a:propstat/a:prop/e:professioncode"/>
<xsl:text> </xsl:text>
</xsl:for-each>
</xsl:template>

<xsl:template match="*[@b:dt='mv.string']/*[position() !=last()]">
<xsl:value-of select="." /><xsl:text>,</xsl:text>
</xsl:template>

</xsl:stylesheet>

That will give you following output:
1049306 byggtapetserarbeider,malerarbeider


regards,
--
Joris Gillis (http://users.telenet.be/root-jg/me.html)
Vincit omnia simplicitas
Keep it simple
Jul 29 '05 #6
"Joris Gillis" <ro**@pandora.be> wrote in message
news:op***************@news.pandora.be...
Tempore 08:54:27, die Friday 29 July 2005 AD, hinc in foro {comp.text.xml}
scripsit Rolf Barbakken <no******@alexandria.cc>:
xmlns:c="cln-ewa:standard:professioncode:"

and then:

<xsl:for-each select="a:propstat/a:prop/c:v">
<xsl:value-of select="concat(., ',')"/>
</xsl:for-each>

But nothing comes out of it (no professioncode). That's pretty logical: there's no location step for 'professioncode'

INPUT XML:
<a:multistatus
xmlns:a="DAV:"
xmlns:b="unknown"
xmlns:c="cln-ewa:standard:professioncode:"
xmlns:d="urn:schemas:contacts:"
xmlns:e="cln-ewa:custom:"
xmlns:f="cln-ewa:standard:">
<a:response>
<a:href>http://server/public/sol/comp/1049306.eml</a:href>
<a:propstat>
<a:status>HTTP/1.1 200 OK</a:status>
<a:prop>
<d:customerid>1049306</d:customerid>
<e:professioncode b:dt="mv.string">
<c:v>byggtapetserarbeider</c:v>
<c:v>malerarbeider</c:v>
</e:professioncode>
</a:prop>
</a:propstat>
</a:response>
</a:multistatus>

XSLT:
<xsl:stylesheet version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:output method="text"/>
<xsl:template
xmlns:a="DAV:"
xmlns:b="unknown"
xmlns:c="cln-ewa:standard:professioncode:"
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="a:propstat/a:prop/d:customerid"/>
<xsl:text> </xsl:text>
<xsl:for-each select="a:propstat/a:prop/e:professioncode/c:v">
<xsl:value-of select="concat(., ',')" />
</xsl:for-each>
<xsl:text> </xsl:text>
</xsl:for-each>
</xsl:template>

</xsl:stylesheet>

OUTPUT :
1049306 byggtapetserarbeider,malerarbeider,


I get no professioncode with this code.
I only just thought about this: Do you need all data of type 'multivalue
strings' to be seperated by comma's? If so, it's better to use a template:

<xsl:stylesheet version="1.0"
xmlns:a="DAV:"
xmlns:b="unknown"
xmlns:c="cln-ewa:standard:professioncode:"
xmlns:d="urn:schemas:contacts:"
xmlns:e="cln-ewa:custom:"
xmlns:f="cln-ewa:standard:"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:output method="text"/>
<xsl:template

match="/">
<xsl:for-each select="a:multistatus/a:response">
<xsl:value-of select="a:propstat/a:prop/d:customerid"/>
<xsl:text> </xsl:text>
<xsl:apply-templates select="a:propstat/a:prop/e:professioncode"/>
<xsl:text> </xsl:text>
</xsl:for-each>
</xsl:template>

<xsl:template match="*[@b:dt='mv.string']/*[position() !=last()]">
<xsl:value-of select="." /><xsl:text>,</xsl:text>
</xsl:template>

</xsl:stylesheet>

That will give you following output:
1049306 byggtapetserarbeider,malerarbeider


This returns absolutely nothing. Not one single byte of data. But no error.

The entire xsl now looks like this:
<xsl:stylesheet version="1.0"
xmlns:a="DAV:"
xmlns:b="unknown"
xmlns:c="cln-ewa:standard:professioncode:"
xmlns:d="urn:schemas:contacts:"
xmlns:e="cln-ewa:custom:"
xmlns:f="cln-ewa:standard:"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:output method="text"/>
<xsl:template
match="/">
<xsl:for-each select="a:multistatus/a:response">
<xsl:text></xsl:text>
<xsl:text> </xsl:text>
<xsl:text></xsl:text>
<xsl:text> </xsl:text>
<xsl:value-of select="a:propstat/a:prop/d:sn"/>
<xsl:text> </xsl:text>
<xsl:value-of select="translate(a:propstat/a:prop/d:street,
' ', ' ')"/>
<xsl:text> </xsl:text>
<xsl:value-of select="translate(a:propstat/a:prop/d:postalcode,
' ', '')"/>
<xsl:text> </xsl:text>
<xsl:value-of select="a:propstat/a:prop/d:l"/>
<xsl:text> </xsl:text>
<xsl:value-of select="a:propstat/a:prop/d:officetelephonenumber"/>
<xsl:text> </xsl:text>
<xsl:value-of select="a:propstat/a:prop/d:telephoneNumber"/>
<xsl:text> </xsl:text>
<xsl:value-of select="a:propstat/a:prop/d:mobile"/>
<xsl:text> </xsl:text>
<xsl:value-of select="a:propstat/a:prop/d:email1"/>
<xsl:text> </xsl:text>
<xsl:value-of select="a:propstat/a:prop/d:customerid"/>
<xsl:text> </xsl:text>
<xsl:value-of select="a:propstat/a:prop/f:contacturl"/>
<xsl:text> </xsl:text>
<xsl:value-of select="a:propstat/a:prop/d:facsimiletelephonenumber"/>
<xsl:text> </xsl:text>
<xsl:value-of select="a:propstat/a:prop/a:creationdate"/>
<xsl:text> </xsl:text>
<xsl:value-of select="a:propstat/a:prop/d:department"/>
<xsl:text> </xsl:text>
<xsl:text></xsl:text>
<xsl:text> </xsl:text>
<xsl:value-of select="a:propstat/a:prop/f:deleted"/>
<xsl:text> </xsl:text>
<xsl:value-of select="a:propstat/a:prop/f:maker"/>
<xsl:text> </xsl:text>
<xsl:value-of select="a:propstat/a:prop/f:work"/>
<xsl:text> </xsl:text>
<xsl:text></xsl:text>
<xsl:text> </xsl:text>
<xsl:value-of select="a:propstat/a:prop/f:ssn"/>
<xsl:text> </xsl:text>
<xsl:text></xsl:text>
<xsl:text> </xsl:text>
<xsl:value-of select="a:propstat/a:prop/f:visitadr"/>
<xsl:text> </xsl:text>
<xsl:value-of select="a:propstat/a:prop/d:businesshomepage"/>
<xsl:text> </xsl:text>
<xsl:value-of select="a:propstat/a:prop/e:agressoid"/>
<xsl:text> </xsl:text>
<xsl:value-of select="a:propstat/a:prop/e:agressoinitials"/>
<xsl:text> </xsl:text>
<xsl:value-of select="a:propstat/a:prop/d:homeState"/>
<xsl:text> </xsl:text>
<xsl:value-of select="a:propstat/a:prop/f:contactikon"/>
<xsl:text> </xsl:text>
<xsl:value-of select="a:propstat/a:prop/f:customergroup"/>
<xsl:text> </xsl:text>
<xsl:value-of select="a:propstat/a:prop/e:contactperson"/>
<xsl:text> </xsl:text>
<xsl:value-of select="a:propstat/a:prop/f:projects"/>
<xsl:text> </xsl:text>
<xsl:value-of select="a:propstat/a:prop/e:agressonew"/>
<xsl:text> </xsl:text>
<xsl:value-of select="a:propstat/a:prop/e:extagressoid"/>
<xsl:text> </xsl:text>
<xsl:value-of select="a:propstat/a:prop/e:foretn"/>
<xsl:text> </xsl:text>
<xsl:value-of select="a:propstat/a:prop/f:mycontact"/>
<xsl:text> </xsl:text>
<xsl:value-of select="a:propstat/a:prop/f:activeprojects"/>
<xsl:text> </xsl:text>
<xsl:value-of select="a:propstat/a:prop/f:contacted"/>
<xsl:text> </xsl:text>
<xsl:value-of select="a:propstat/a:prop/a:contentclass"/>
<xsl:text> </xsl:text>
<xsl:apply-templates select="a:propstat/a:prop/e:professioncode"/>
<xsl:text> </xsl:text>
</xsl:for-each>
</xsl:template>
<xsl:template match="*[@b:dt='mv.string']/*[position() !=last()]">
<xsl:value-of select="." /><xsl:text>,</xsl:text>
</xsl:template>
</xsl:stylesheet>

I really appreciate the help.

--
_________________
Rolf @ Questus ans
Jul 29 '05 #7
Tempore 18:44:06, die Friday 29 July 2005 AD, hinc in foro {comp.text.xml} scripsit Rolf Barbakken <no******@alexandria.cc>:
This returns absolutely nothing. Not one single byte of data. But no error.

I bet it's still a namespace issue.
Anyway, this conversation is leading nowhere. The XML sample in the OP was incomplete, I had to make to much assumptions.
Please provide the full XML (maybe a link to it?).

BTW, You don't need to copy everything I write litteraly;)
e.g. if I write xmlns:b="unknown" that means I do not posses enough information to make write the proper namespace-uri. You should have corrected it.

I hope we can soon fix this...
regards,
--
Joris Gillis (http://users.telenet.be/root-jg/me.html)
Vincit omnia simplicitas
Keep it simple
Jul 29 '05 #8
"Joris Gillis" <ro**@pandora.be> wrote in message
news:op***************@news.pandora.be...
Tempore 18:44:06, die Friday 29 July 2005 AD, hinc in foro {comp.text.xml}
scripsit Rolf Barbakken <no******@alexandria.cc>:
This returns absolutely nothing. Not one single byte of data. But no
error.

I bet it's still a namespace issue.
Anyway, this conversation is leading nowhere. The XML sample in the OP was
incomplete, I had to make to much assumptions.
Please provide the full XML (maybe a link to it?).


I have sent you an email. Hope the address is correct.

--
_________________
Rolf @ Questus ans
Jul 29 '05 #9
Tempore 22:04:55, die Friday 29 July 2005 AD, hinc in foro {comp.text.xml} scripsit Rolf Barbakken <no******@alexandria.cc>:

Here's the sylesheet, it does not look very neat, but at least it works.

<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
version="1.0"
xmlns:b="urn:uuid:c2f41010-65b3-11d1-a29f-00aa00c14882/"
xmlns:f="cln-ewa:custom:"
xmlns:c="xml:"
xmlns:g="urn:schemas-microsoft-com:office:office"
xmlns:e="cln-ewa:standard:"
xmlns:d="urn:schemas:contacts:"
xmlns:a="DAV:">
<xsl:output method="text"/>
<xsl:template
match="/">
<xsl:for-each select="a:multistatus/a:response">
<xsl:for-each select="(a:propstat/a:prop)[1]">
<xsl:text></xsl:text>
<xsl:text> </xsl:text>
<xsl:text></xsl:text>
<xsl:text> </xsl:text>
<xsl:apply-templates select="d:sn"/>
<xsl:text> </xsl:text>
<xsl:apply-templates select="d:street"/>
<xsl:text> </xsl:text>
<xsl:apply-templates select="d:postalcode"/>
<xsl:text> </xsl:text>
<xsl:apply-templates select="d:l"/>
<xsl:text> </xsl:text>
<xsl:apply-templates select="d:officetelephonenumber"/>
<xsl:text> </xsl:text>
<xsl:apply-templates select="d:telephoneNumber"/>
<xsl:text> </xsl:text>
<xsl:apply-templates select="d:mobile"/>
<xsl:text> </xsl:text>
<xsl:apply-templates select="d:email1"/>
<xsl:text> </xsl:text>
<xsl:apply-templates select="d:customerid"/>
<xsl:text> </xsl:text>
<xsl:apply-templates select="f:contacturl"/>
<xsl:text> </xsl:text>
<xsl:apply-templates select="d:facsimiletelephonenumber"/>
<xsl:text> </xsl:text>
<xsl:apply-templates select="a:creationdate"/>
<xsl:text> </xsl:text>
<xsl:apply-templates select="d:department"/>
<xsl:text> </xsl:text>
<xsl:text></xsl:text>
<xsl:text> </xsl:text>
<xsl:apply-templates select="f:deleted"/>
<xsl:text> </xsl:text>
<xsl:apply-templates select="f:maker"/>
<xsl:text> </xsl:text>
<xsl:apply-templates select="f:work"/>
<xsl:text> </xsl:text>
<xsl:text></xsl:text>
<xsl:text> </xsl:text>
<xsl:apply-templates select="f:ssn"/>
<xsl:text> </xsl:text>
<xsl:text></xsl:text>
<xsl:text> </xsl:text>
<xsl:apply-templates select="f:visitadr"/>
<xsl:text> </xsl:text>
<xsl:apply-templates select="d:businesshomepage"/>
<xsl:text> </xsl:text>
<xsl:apply-templates select="e:agressoid"/>
<xsl:text> </xsl:text>
<xsl:apply-templates select="e:agressoinitials"/>
<xsl:text> </xsl:text>
<xsl:apply-templates select="d:homeState"/>
<xsl:text> </xsl:text>
<xsl:apply-templates select="f:contactikon"/>
<xsl:text> </xsl:text>
<xsl:apply-templates select="f:customergroup"/>
<xsl:text> </xsl:text>
<xsl:apply-templates select="e:contactperson"/>
<xsl:text> </xsl:text>
<xsl:apply-templates select="f:projects"/>
<xsl:text> </xsl:text>
<xsl:apply-templates select="e:agressonew"/>
<xsl:text> </xsl:text>
<xsl:apply-templates select="e:extagressoid"/>
<xsl:text> </xsl:text>
<xsl:apply-templates select="e:foretn"/>
<xsl:text> </xsl:text>
<xsl:apply-templates select="f:mycontact"/>
<xsl:text> </xsl:text>
<xsl:apply-templates select="f:activeprojects"/>
<xsl:text> </xsl:text>
<xsl:apply-templates select="f:contacted"/>
<xsl:text> </xsl:text>
<xsl:apply-templates select="a:contentclass"/>
<xsl:text> </xsl:text>
<xsl:apply-templates select="e:professioncode"/>
<xsl:text> </xsl:text>
</xsl:for-each>
</xsl:for-each>
</xsl:template>

<xsl:template match="*[@b:dt='mv.string']/*[position() !=last()]">
<xsl:value-of select="." /><xsl:text>,</xsl:text>
</xsl:template>

<xsl:template match="d:street">
<xsl:value-of select="translate(., ' ', ' ')" />
</xsl:template>

<xsl:template match="d:postalcode">
<xsl:value-of select="translate(., ' ', '')" />
</xsl:template>

</xsl:stylesheet>

regards,
--
Joris Gillis (http://users.telenet.be/root-jg/me.html)
Vincit omnia simplicitas
Keep it simple
Jul 29 '05 #10
"Joris Gillis" <ro**@pandora.be> wrote in message
news:op***************@news.pandora.be...
Tempore 22:04:55, die Friday 29 July 2005 AD, hinc in foro {comp.text.xml}
scripsit Rolf Barbakken <no******@alexandria.cc>:

Here's the sylesheet, it does not look very neat, but at least it works.


How did you test it?

I get nothing out of this xsl-file. The XML fills up nicely, but when I do a

objXMLDOM.transformNode(objXSLDOM)

the result is nothing.

The XSL:
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
version="1.0"
xmlns:b="urn:uuid:c2f41010-65b3-11d1-a29f-00aa00c14882/"
xmlns:f="cln-ewa:custom:"
xmlns:c="xml:"
xmlns:g="urn:schemas-microsoft-com:office:office"
xmlns:e="cln-ewa:standard:"
xmlns:d="urn:schemas:contacts:"
xmlns:a="DAV:">
<xsl:output method="text"/>
<xsl:template
match="/">
<xsl:for-each select="a:multistatus/a:response">
<xsl:for-each select="(a:propstat/a:prop)[1]">
<xsl:text></xsl:text>
<xsl:text> </xsl:text>
<xsl:text></xsl:text>
<xsl:text> </xsl:text>
<xsl:apply-templates select="d:sn"/>
<xsl:text> </xsl:text>
<xsl:apply-templates select="d:street"/>
<xsl:text> </xsl:text>
<xsl:apply-templates select="d:postalcode"/>
<xsl:text> </xsl:text>
<xsl:apply-templates select="d:l"/>
<xsl:text> </xsl:text>
<xsl:apply-templates select="d:officetelephonenumber"/>
<xsl:text> </xsl:text>
<xsl:apply-templates select="d:telephoneNumber"/>
<xsl:text> </xsl:text>
<xsl:apply-templates select="d:mobile"/>
<xsl:text> </xsl:text>
<xsl:apply-templates select="d:email1"/>
<xsl:text> </xsl:text>
<xsl:apply-templates select="d:customerid"/>
<xsl:text> </xsl:text>
<xsl:apply-templates select="f:contacturl"/>
<xsl:text> </xsl:text>
<xsl:apply-templates select="d:facsimiletelephonenumber"/>
<xsl:text> </xsl:text>
<xsl:apply-templates select="a:creationdate"/>
<xsl:text> </xsl:text>
<xsl:apply-templates select="d:department"/>
<xsl:text> </xsl:text>
<xsl:text></xsl:text>
<xsl:text> </xsl:text>
<xsl:apply-templates select="f:deleted"/>
<xsl:text> </xsl:text>
<xsl:apply-templates select="f:maker"/>
<xsl:text> </xsl:text>
<xsl:apply-templates select="f:work"/>
<xsl:text> </xsl:text>
<xsl:text></xsl:text>
<xsl:text> </xsl:text>
<xsl:apply-templates select="f:ssn"/>
<xsl:text> </xsl:text>
<xsl:text></xsl:text>
<xsl:text> </xsl:text>
<xsl:apply-templates select="f:visitadr"/>
<xsl:text> </xsl:text>
<xsl:apply-templates select="d:businesshomepage"/>
<xsl:text> </xsl:text>
<xsl:apply-templates select="e:agressoid"/>
<xsl:text> </xsl:text>
<xsl:apply-templates select="e:agressoinitials"/>
<xsl:text> </xsl:text>
<xsl:apply-templates select="d:homeState"/>
<xsl:text> </xsl:text>
<xsl:apply-templates select="f:contactikon"/>
<xsl:text> </xsl:text>
<xsl:apply-templates select="f:customergroup"/>
<xsl:text> </xsl:text>
<xsl:apply-templates select="e:contactperson"/>
<xsl:text> </xsl:text>
<xsl:apply-templates select="f:projects"/>
<xsl:text> </xsl:text>
<xsl:apply-templates select="e:agressonew"/>
<xsl:text> </xsl:text>
<xsl:apply-templates select="e:extagressoid"/>
<xsl:text> </xsl:text>
<xsl:apply-templates select="e:foretn"/>
<xsl:text> </xsl:text>
<xsl:apply-templates select="f:mycontact"/>
<xsl:text> </xsl:text>
<xsl:apply-templates select="f:activeprojects"/>
<xsl:text> </xsl:text>
<xsl:apply-templates select="f:contacted"/>
<xsl:text> </xsl:text>
<xsl:apply-templates select="a:contentclass"/>
<xsl:text> </xsl:text>
<xsl:apply-templates select="e:professioncode"/>
<xsl:text> </xsl:text>
</xsl:for-each>
</xsl:for-each>
</xsl:template>
<xsl:template match="*[@b:dt='mv.string']/*[position() !=last()]">
<xsl:value-of select="." /><xsl:text>,</xsl:text>
</xsl:template>
<xsl:template match="d:street">
<xsl:value-of select="translate(., ' ', ' ')" />
</xsl:template>
<xsl:template match="d:postalcode">
<xsl:value-of select="translate(., ' ', '')" />
</xsl:template>
</xsl:stylesheet>
--
_________________
Rolf @ Questus ans
Jul 29 '05 #11
This one's nicer:
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
version="1.0"
xmlns:b="urn:uuid:c2f41010-65b3-11d1-a29f-00aa00c14882/"
xmlns:f="cln-ewa:custom:"
xmlns:c="xml:"
xmlns:g="urn:schemas-microsoft-com:office:office"
xmlns:e="cln-ewa:standard:"
xmlns:d="urn:schemas:contacts:"
xmlns:a="DAV:">
<xsl:output method="text"/>

<xsl:variable name="field">
<xsl:text> d:sn d:street d:postalcode d:l d:officetelephonenumber d:telephoneNumber d:mobile d:email1 d:customerid f:contacturl d:facsimiletelephonenumber a:creationdate d:department f:deleted f:maker f:work f:ssn f:visitadr d:businesshomepage e:agressoid e:agressoinitials d:homeState f:contactikon f:customergroup e:contactperson f:projects e:agressonew e:extagressoid e:foretn f:mycontact f:activeprojects f:contacted a:contentclass e:professioncode</xsl:text>
</xsl:variable>

<xsl:template match="/">
<xsl:for-each select="a:multistatus/a:response">
<xsl:for-each select="(a:propstat/a:prop)[1]">
<xsl:call-template name="fieldCreator"/>
<xsl:text> </xsl:text>
</xsl:for-each>
</xsl:for-each>
</xsl:template>

<xsl:template name="fieldCreator">
<xsl:param name="fields" select="concat($field,' ')"/>
<xsl:apply-templates select="*[name()=substring-before($fields,' ')]"/>
<xsl:if test="substring-after($fields,' ')">
<xsl:text> </xsl:text>
<xsl:call-template name="fieldCreator">
<xsl:with-param name="fields" select="substring-after($fields,' ')"/>
</xsl:call-template>
</xsl:if>
</xsl:template>

<xsl:template match="*[@b:dt='mv.string']/*[position() !=last()]">
<xsl:value-of select="." /><xsl:text>,</xsl:text>
</xsl:template>

<xsl:template match="d:street">
<xsl:value-of select="translate(., ' ', ' ')" />
</xsl:template>

<xsl:template match="d:postalcode">
<xsl:value-of select="translate(., ' ', '')" />
</xsl:template>

</xsl:stylesheet>

P.S. Watch out for wrapping. The data of <xsl:variable name="field"/> should all be on 1 line.
--
Joris Gillis (http://users.telenet.be/root-jg/me.html)
Vincit omnia simplicitas
Keep it simple
Jul 29 '05 #12

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: Joel Barsotti | last post by:
In asp3, you could set a multivalue cookie by doing something like this Response.Cookies("login")("user") = Session('user'); Response.Cookies("login")("password") = Session('password');...
2
by: Fredrik Rodin | last post by:
All, I'm having problems with my resource manager in ASP.NET 2.0 after conversion from ASP.NET 1.1. Here is a background: In ASP.NET 1.1 All my user controls and aspx pages inherit from...
16
by: Dany | last post by:
Our web service was working fine until we installed .net Framework 1.1 service pack 1. Uninstalling SP1 is not an option because our largest customer says service packs marked as "critical" by...
14
by: Dennis Benzinger | last post by:
Hi! The following program in an UTF-8 encoded file: # -*- coding: UTF-8 -*- FIELDS = ("Fächer", ) FROZEN_FIELDS = frozenset(FIELDS) FIELDS_SET = set(FIELDS)
22
by: sam_cit | last post by:
Hi Everyone, I have the following structure in my program struct sample { char *string; int string_len; };
11
by: Bob Rock | last post by:
Hello, I have an array of strings and need to find the matching one with the fastest possible code. I decided to order the array and then write a binary search algo. What I came up with is the...
0
by: nass | last post by:
hello everyone and happy new year. i am not sure how to tackle this problem or where is originates from so i am writing here in hope that if you can not help you can at least point me in a...
1
by: Ben | last post by:
NooB: Anyone help with what I could be doing incorrectly here? Trying to have a parameter drop down list where a user can select one or more of the available values contained in the table to...
5
by: varshaP | last post by:
Hi.. How to remove selected value from a readonly multivalue field, on clicking the button ?
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.