Subject: Re: [xsl] Retriving a value of default attribute from schema(.xsd) From: Jeni Tennison <jeni@xxxxxxxxxxxxxxxx> Date: Fri, 12 Oct 2001 10:06:22 +0100 |
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 |
---|
|
<- Previous | Index | Next -> |
---|---|---|
[xsl] Retriving a value of default , Vadiraj | Thread | Re: [xsl] Retriving a value of defa, Wendell Piez |
Re: [xsl] html inside xml, Jeni Tennison | Date | Re: [xsl] keys and idrefs - XSLT2 r, Jeni Tennison |
Month |