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

Re: Schema and fixed attribute value

Subject: Re: Schema and fixed attribute value
From: Jeni Tennison <jeni@xxxxxxxxxxxxxxxx>
Date: Wed, 17 Jul 2002 17:29:22 +0100
parser.setfeature validation
Hi Bruno,

>  I tried to load the unit.xml as a DOMSource by using Xerces2.0.2  parser
>  with features like
>  parser.setFeature("http://apache.org/xml/features/validation/schema-full-checking",true);
>  parser.setFeature("http://apache.org/xml/features/validation/schema",true);
>  parser.setFeature("http://xml.org/sax/features/namespaces", true);
> parser.setFeature("http://apache.org/xml/features/validation/schema/normalized-value",true
>   );
> parser.setFeature("http://apache.org/xml/features/validation/schema/element-default",true)
>  ;
>
>  but the attribute value seems to be not accessible in my stylesheet.

That surprises me. Xerces should be able to add the attribute in the
DOM just as if it had been specified in the XML document originally.
You might try setting the validation feature to true as well as the
ones that you've set above:

  parser.setFeature("http://xml.org/sax/features/validation",true);

The Xerces documentation suggests that the normalized-value and
element-default features only work if validation occurs, which implies
that the same might be true for fixed/default attribute values as
specified in XML Schema.
  
If that doesn't work, I suggest that you ask on the
xerces-j-user@xxxxxxxxxxxxxx mailing list.

If all else fails, you might be able to access the schema from XSLT in
order to work out what the fixed value of the attribute is. However,
processing XML Schemas with XSLT is not trivial (unless you constrain
the schemas), so if you can fix the DOM that you're passing to Xalan
that will be the best option.

Let us know if that works...

Cheers,

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.