[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: "Bruno Chatel" <bcha@xxxxxxxxxxx>
Date: Wed, 17 Jul 2002 23:11:12 +0200
fixed xml schema attribut
    Hi Jenni,

thanks for this answer :-)

> >  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);

This feature seems to check the document against a DTD.
When setting it, I get error message about needed declaration for root element
of my document (correctly declared in my schema).

But, I am not sure that the problem is here...
As far as i understand the Xalan processing model, the internal tree representation
is not (on 2.3.x) a DOM tree (but something called DTM).
I don't know if processing a DOM source (loaded by Xerces) implies that
Schema properties are kept in internal tree model.
Any idea about this ?
Is it the same with other processors (such Saxon, ect..) ?


> 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.

I ask on xalan-j-user 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.

Yes.. It is my last solution if I can not get default values.. But I hope that I will
not need to do this !!!


-- bruno --
Bruno Chatel
Tel : (+33)[0] 4 96 11 14 57
Email : bcha@xxxxxxxxxxx
http://www.chadocs.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.