RE: [xslt] fixed/default attribute value from xml schema


> -----Original Message-----
> From: xslt-bounces gnome org [mailto:xslt-bounces gnome org] 
> On Behalf Of Steffen Malmgaard Mortensen
> Hi all
> I'm new to xml/xsl so please bear with me if I'm being stupid. For my
> application I'm using xml schema to describe the xml files and xslt to
> transform them into different output variants - pretty standard.
> In my schema I set default/fixed values for some attributes 
> that I then
> use during the xslt. My problem is the xsltproc/libxslt is not able to
> find these default/fixed values in the schema. 
> Well, I have googled a little and found the following:
> 1) In the w3c xpath spec 
> ( it
> says that "The XML Recommendation does not require an XML processor to
> read an external DTD or an external parameter unless it is 
> validating".
> 2) According to a mail in the archive this works for xml 
> files described
> by a DTD (test case 53)
> My question is: Is this supposed to work for transformation 
> of xml files
> described by an xml schema?? I also tried to write a python 
> script that
> both validates the xml file and applies the style sheet - same result.
> Any ideas/help??

Have a look at the following in order to activate the creation
of default attributes:

And have a look at the following in order to make it work, since
there was a bug which was fixed just yesterday! Use the CVS HEAD.
There might be still some more bug in this mechanism; it's really
not well tested, plus we have no regression tests for this. The
W3C XML Schema tests suite, has also no support for testing
creation of default attributes. So feedback is appreciated :-)

I haven't looked at the code you supplied and I don't know if
setting the validation options is possible through the Python
bindings (is the function exported to Python?).



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]