OASIS Mailing List ArchivesView the OASIS mailing list archive below
or browse/search using MarkMail.


Help: OASIS Mailing Lists Help | MarkMail Help



   [xsl] Value of <id> element not returned

[ Lists Home | Date Index | Thread Index ]

Hi, folks.

I have the following stylesheet.

<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet version="1.0"
  <xsl:output method="xml" version="1.0" encoding="UTF-8" indent="yes"/>
  <xsl:key name="x" match="address" use="zip"/>

  <xsl:template match="/">
        <xsl:apply-templates mode="item-detail"
select="addressbook/address[count(. | key('x', zip)[1])=1]"/>

  <xsl:template match="address" mode="item-detail">
      <xsl:value-of select="id"/>
      <xsl:text>, </xsl:text>
      <xsl:value-of select="name/last-name"/>
      <xsl:text>, </xsl:text>
      <xsl:value-of select="zip"/>


Here's a snippet of the XML document to be transformed.

<?xml version="1.0" encoding="UTF-8"?>
    <street>283 First Avenue</street>
    <city>Skunk Haven</city>
... (etc) ...

For some reason the value of <id> is not returned. Here's the output, as it
reflects the entire XML source document.

<?xml version="1.0" encoding="UTF-8"?>
    <Name>, Frisby, 48392</Name>
    <Name>, Backstayge, 02718</Name>
    <Name>, Attired, 00218</Name>
    <Name>, McGoon, 27318</Name>
    <Name>, Reckonwith, 02930</Name>

Does anyone know why the <id> element values are not returned?




XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
or e-mail: <mailto:xsl-list-unsubscribe@lists.mulberrytech.com>


News | XML in Industry | Calendar | XML Registry
Marketplace | Resources | MyXML.org | Sponsors | Privacy Statement

Copyright 2001 XML.org. This site is hosted by OASIS