Sign In/My Account | View Cart  
advertisement

Article:
 Trickledown Namespaces?
Subject: Question on namespaces
Date: 2004-08-09 16:35:50
From: cord_thomas

I am trying to create an XSLT transform for a jabber-produced file and have namespace problem that i believe this article addresses, but i cannot figure out the answer. Following are snips of the xml and my attempted xslt - where am i going wrong:


<xdb>
<foo xdbns="jabber:jud:users" xmlns="jabber:jud:users">
<item jid="some@im.rand.org">
<key/>
<name>a person</name>
<first>a</first>
<last>person</last>
<nick/>
<email/>
</item>
<foo>
<xdb>


XSLT:
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:ja="jabber:jud:users">
<xsl:output method="html"/>
<xsl:param name="i_eid"/>
<xsl:template match="/">
<HTML>
<HEAD> <LINK REL="stylesheet" TYPE="text/css" HREF="css/tipic.css"/>
</HEAD>
<BODY>
<table class="tbb">
<tr class="trIM">
<td class="thIM" width="220">IM UserName</td>
<td class="thNick" width="220">Nick Name</td>
</tr>
<xsl:apply-templates select="*/ja:foo/item"/>
</table>
</BODY>
</HTML>
</xsl:template>


<xsl:template match="ja:item">
<tr>
<td>
<xsl:value-of select="@jid"/>
</td>
<td>
<xsl:value-of select="nick"/>
</td>
</tr>
</xsl:template>
</xsl:stylesheet>


I am not clear on:
1 - the xpath relationship between the match name i put in under apply-templates, and the one i put in under the template match
2 - where i specify my ja: namespace prefix


This XSLT results in no data -


if i take out the jabber xmlns declaration in the source XML file, my XSLT transforms nicely, but i have no control over the XML source file.


Previous Message Previous Message   Next Message Next Message


Full Text Titles Only Newest First

Sponsored By: