This is the mail archive of the xsl-list@mulberrytech.com mailing list .


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

XSl, sorting, namespaces and data-types, a problem?


Hi there,

I'm using the following xsl:

<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform";
version="1.0">
<xsl:output method="xml" indent="yes"/>

<xsl:param name="sortorder" select="'descending'"/>
<xsl:param name="sortfield" select="'xxx'"/>

<xsl:template match="*|text()|@*">
	<xsl:copy>
		<xsl:apply-templates select="*|text()|@*"/>
	</xsl:copy>
</xsl:template>

<xsl:template match="root">
	<xsl:copy>
		<xsl:apply-templates select="@*"/>
		<xsl:apply-templates select="data">
			<xsl:sort select="*[name()=$sortfield]"
order="{$sortorder}" />
		</xsl:apply-templates>
	</xsl:copy>
</xsl:template>

</xsl:stylesheet>

And I'm using the following XML:

<?xml version="1.0"?>
<root>
 <data>
  <intNumber xmlns:dt="urn:schemas-microsoft-com:datatypes"
dt:dt="i4">0</intNumber>
  <strName/>
 </data>
 <data>
  <intNumber xmlns:dt="urn:schemas-microsoft-com:datatypes"
dt:dt="i4">1</intNumber>
  <strName>strName 1</strName>
 </data>
 <data>
  <intNumber xmlns:dt="urn:schemas-microsoft-com:datatypes"
dt:dt="i4">2</intNumber>
  <strName>strName 2</strName>
 </data>
 <data>
  <intNumber xmlns:dt="urn:schemas-microsoft-com:datatypes"
dt:dt="i4">3</intNumber>
  <strName>strName 3</strName>
 </data>
</root>

Now here's my problem:
When I strip away the type info, the XSL sorting works fine. When I add the
type-info, I seem to "loose" the content. I've added this XML to a
HTML-table as a data island. intNumber is not displayed, the cells stay
empty, strName is displayed as should be.
What's happening?

Greetz,
Ernst Wolthaus


__________________________ 
CMG Trade, Transport & Industry B.V.
Microsoft Web Development
Kralingseweg 241-249, 3062 CE ROTTERDAM
Postbus 8566, 3009 AN  ROTTERDAM
Phone:   (010) 253 7000
Fax:       (010) 253 7021
E-mail:   mailto:ernst.wolthaus@cmg.nl
 
The Information contained in this E-mail and its attachments is confidential
and may be legally privileged. It is intended solely for the use of the
individual or entity to whom it is addressed and others authorised to
receive it. If you are not the intended recipient you are hereby notified
that any disclosure, copying, distribution or taking any actions in reliance
of the contents of this E-mail and any attachments is strictly prohibited
and may be unlawful. CMG is neither liable for the proper and complete
transmission of the information contained in this E-mail and any attachments
nor for any delay in its receipt. If received in error, please contact CMG
on +31 (0)20 50 33 000 quoting the name of the sender and the addressee and
then delete it from your system. Please note that CMG does not accept any
responsibility for viruses and it is your responsibility to scan the Email
and attachments (if any). No contracts may be concluded on behalf of CMG by
means of E-mail communications. 

 XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]