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



On Thu, May 11, 2006 at 04:52:41PM +0200, Steffen Malmgaard Mortensen wrote:
> 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 (http://www.w3.org/TR/xpath#attribute-nodes) 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.

  XPath 1.0 predates XML-Schemas. An XPath-1.0 (or XSLT-1.0) processor won't try to use XSD (or Relax-NG) on a document being loaded for XPath/XSLT.
DTDs are part of the XML-1.0 core set of specs, that's why it gets that special
treatment.

Daniel


-- 
Daniel Veillard      | Red Hat http://redhat.com/
veillard redhat com  | libxml GNOME XML XSLT toolkit  http://xmlsoft.org/
http://veillard.com/ | Rpmfind RPM search engine http://rpmfind.net/


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