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

Re: Retriving a value of default attribute from schema

Subject: Re: Retriving a value of default attribute from schema(.xsd)
From: Jeni Tennison <jeni@xxxxxxxxxxxxxxxx>
Date: Fri, 12 Oct 2001 10:06:22 +0100
xslt value of default
Hi Vadiraj,

> while parsing an xml file using xml schema as validator for that
> file, the default value declared for a particular attribute is not
> been picked up by the parser. while the code works fine with the
> dtd. As a result the java source code returns null pointer
> exception.

There's a big distinction between validating an XML document against
an XML Schema (which is something that Xerces supports) and passing on
the information made available through that validation
(post-schema-validation infoset (PSVI)) through to the XSLT processor.

As far as I know, there are no XSLT processors that will access and
use the PSVI in the same way that they access and use the
post-DTD-validation infoset. You'll see the PSVI being used in XSLT
2.0, but for now if you want to set a default for an attribute you
should use a DTD.

But it's very peculiar that you're getting a null pointer exception
from not having the default attribute value present! I'd have a look
at your code and make it more robust, such that the stylesheet assumes
the default value for the attribute if the attribute is not present.
Alternatively, you could create an XSLT transformation that adds the
default and fixed attribute and element values to the XML document
before the main transformation.

I hope that helps,

Jeni

---
Jeni Tennison
http://www.jenitennison.com/


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


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.