[Home] [By Thread] [By Date] [Recent Entries]
At 2009-09-29 03:44 +1300, Trevor Nicholls wrote:
As previously described I have switched from DTD modelling to XSD for my application's XML files. Today I have encountered a problem with default/fixed attribute values: the fixed attribute value appears to be forced into the parsed XML file when using the DTD (as wanted) but apparently not found when using the schema. Indeed. Unlike my earlier problems, I am not compelled to use Xalan for this transformation, and it is (mis)behaving as described ... but behaving as specified ... when the processor is Saxon: As I had expected when I first worked with schemas and XSLT 2, but learned quickly is not the case. Can somebody please explain why this is happening? Because being aware that an attribute has a default value from a schema requires schema awareness to be turned on. When dealing with Saxon, this involves the use of a commercial license (well worth the money!) rather than the free license. The commandline is identical for the two cases, no options are being supplied either to suppress or to force attribute value inheritance from the DTD/schema. Right ... but in XSLT 1.0 this was a defined behaviour and has migrated into the XSLT 2.0 specification for DTD processing, while schema awareness is new in XSLT 2.0 and being aware that an attribute has a default value is part of that. I hope this helps answer your question. . . . . . . . . . . Ken
|

Cart



