[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

Saxon 8.0b and NOTATIONs

Subject: Saxon 8.0b and NOTATIONs
From: Peter Flynn <pflynn@xxxxxx>
Date: Tue, 13 Jul 2004 10:34:55 +0100
xsl saxon
I'm getting an error message from Saxon 8.0b:

> Error at choose on line 19 of file:/tmp/test.xsl:
>   Value doesn't match its type annotation. No namespace binding for
> prefix in QName value {blort}
> Transformation failed: Run-time errors were reported

Under Saxon 6.5.3 it processes without this error.

Element <code> has a NOTATION attribute @bar, and the
NOTATIONs are declared with SYSTEM values (URLs).  The
value of @bar in the instance is "XML". Lines 18-27 of 
the XSLT say

  <xsl:template match="code">
    <xsl:choose>
      <xsl:when test="@bar='XML'">
        Do this
      </xsl:when>
      <xsl:otherwise>
        Do something else
      </xsl:otherwise>
    </xsl:choose>
  </xsl:template>

I thought it would be easy enough to fix by adding a 
namespace declaration xmlns:foo for the SYSTEM value of the 
NOTATION for "XML" and using the test @foo:bar='XML' but 
that fails (xsl:otherwise is executed).  If I add the prefix
to the value instead (@bar='foo:XML') it fails with the
error message above in the same way as it did with no 
namespaces declared.  What have I misunderstood here?

If each NOTATION implies a separate namespace (which makes 
sense), the error message implies the need to declare each 
namespace in the XSLT, which in turn implies having to code 
a nest of separate xsl:when elements, each one referencing 
the hardcoded namespace prefix, simply to test if the 
attribute is equal to a particular value, which would mean 
recoding the XSLT every time a new NOTATION was added to 
the DTD, which sounds wrong to me.

I knew namespaces would be trouble :-)

///Peter


///Peter

Current Thread

PURCHASE STYLUS STUDIO ONLINE TODAY!

Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
Email
First Name
Last Name
Company
Subscribe in XML format
RSS 2.0
Atom 0.3
Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery ™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2013 All Rights Reserved.